#K77292. Football Tournament
Football Tournament
Football Tournament
You are given a football tournament in which teams compete in matches. In each match, one team wins and the other loses. You need to determine the team or teams that have secured the highest number of wins. Only teams that win at least one match are considered. In case multiple teams share the highest wins, output all of them in increasing order.
Note: If no match is played, print nothing.
The input starts with two integers: the number of teams N and the number of matches M. This is followed by M lines, each containing two integers representing the winner and the loser of a match.
inputFormat
The first line contains two space-separated integers N and M, where N is the number of teams and M is the number of matches.
Each of the next M lines contains two space-separated integers, where the first integer represents the winning team and the second represents the losing team.
outputFormat
Print the team number(s) with the highest number of wins, in ascending order, separated by a single space. If no team has won any match (i.e. when M = 0), output nothing.
## sample2 1
1 2
1