The student thinks of other schemes to improve on this (including perhaps checking users' ages) but York announces that the snow day must be made up and this throws the student into deep depression. Your job is to implement the student's idea.
Input
You will be given several instances of the problem. Each instance starts with integers n,m on the first line (separated by a blank). The number of nodes is n (numbered 1..n) and the number of edges is m. For this problem, n,m < 100,000.
This is followed by m lines each with a pair of node id's a,b (separated by a blank) that specifies a single directed edge from node a to node b. This is followed by one or more lines with node pairs (separated by a blank) for which you must produce output. The last line in this list is indicated by 0 0; no output should be produced for this line. After the last instance there is a line containing 0 0 that denotes end of input; this line is used only as an end of input indicator and should not be otherwise processed.
Output
For each instance, print the instance number, starting from 1. Then for each given node pair (a,b) the set of nodes c (in increasing order) that satisfy the condition that directed edges (a,c), (b,c) are in the graph. See the sample output for the precise format.
Sample input
3 3
1 2
1 3
2 3
1 2
2 3
0 0
0 0
Sample output
Instance 1
Common neighbours of nodes 1,2:
3
Common neighbours of nodes 2,3: