eolymp
bolt
Try our new interface for solving problems
Problems

Field Plan

Field Plan

World Soccer Championship is coming soon and coach Yogi wants to prepare his team as well as possible. So he made up a strategy field plan for every player of the team. One plan describes a number of possible locations for the player on the field. Moreover, if Yogi wants the player to be able to move from one location A to another location B then the plan specifies the ordered pair (A, B). He is sure that his team will win if the players run over the field from one location to another using only moves of the plan.

prb6535.gif

Yogi tells every player to follow his plan and to start from a location that reaches every other location on the plan (by possibly multiple moves). However, it is quite difficult for some soccer players, simple minded as they are, to find a suitable starting location. Can you help every player to figure out the set of possible start locations?

Input

The first line gives the number of field plans. The input contains at most eleven field plans (what else?). Every plan starts with a line of two integers n and m, with 1n100 000 and 1m100 000, giving the number of locations and the number of moves. In the following m lines a plan specifies moves (A, B) by two white space separated integers A, B (0A, B < n). The plans are separated by a blank line.

Output

For every plan print out all possible starting locations, sorted increasingly and one per line. If there are no possible locations to start, print "Confused". Print a blank line after each plan output.

Time limit 1 second
Memory limit 128 MiB
Input example #1
2
4 4
0 1
1 2
2 0
2 3

4 4
0 3
1 0
2 0
2 3
Output example #1
0
1
2

Confused

Source 2010 ACM ICPC German Collegiate Programming Contest, Problem D