N=10
0: 4 -1
1: 0 -1
2: 1 7 -1
3: 2 -1
4: 0 3 -1
5: 0 8 -1
6: 1 9 -1
7: 5 -1
8: 6 3 -1
9: 7 4 -1
