The races became more popular than ever at Pandora planet. But these races are quite unusual.
There are
The car number
Handsome Mike wants to knock some cars out of the race using dynamite. Thus he has
Your task is to answer Mike's questions.
Input Specification
The first line of the input file contains two integers
Each of the following
Each of the following
Output Specification
Write
Sample Input
5 5
0 1
0 2
2 3
3 5
4 5
0 5 0
0 1 2
0 2 1
2 5 2
2 5 3
Sample Output
5
1
2
4
3
Comments