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