3
5 3
0 1 10
0 2 20
0 3 30
5
0 1 2 3 4
0
5 3
0 1 10
0 2 20
0 3 30
1
4
0
5 3
0 1 10
0 2 20
0 3 30
1
0
0
