Problem3349--【Div2】abc395d-鸽笼交换

3349: 【Div2】abc395d-鸽笼交换

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 128 MB

Description



Input



Sample Input Copy

6 8
1 2 4
1 3 6
3 2
2 4 5
3 2
1 4 2
3 4
3 2

Sample Output Copy

4
5
2
5

HINT

Source/Category