LearnPy Hub
← Arena
IntermediateRating 1100

The Town Judge

In a town of n people, 'a b' means a trusts b. The judge trusts nobody and is trusted by everyone else. Print the judge, or -1 if there is none.

Input

n and m; then m lines 'a b'.

Output

One integer.

Sample 1

Input
2 1
1 2
Output
2

Sample 2

Input
3 2
1 3
2 3
Output
3
solution.py
Output appears here
The Town Judge · Python Arena problem · LearnPy Hub