3 1
1 2 0 0 2
1 1 1 3 3
3 2 0 1 3
3 2
1 2 0 0 2
1 1 1 3 3
3 2 0 1 3
3 3
1 2 0 0 2
1 1 1 3 3
3 2 0 1 3
0 1
