#K12416. Missing Match Result
Missing Match Result
Missing Match Result
In a round-robin tournament with (m) players, every pair of players is supposed to have exactly one match, resulting in a total of (\binom{m}{2}) games. However, due to a recording error, one match result is missing. The recorded match results are given in the form of two integers per line (winner and loser). Your task is to determine the missing match result. When the missing result is found, if there is evidence (from the recorded data) that the match should actually be considered in the reversed order, output the reversed result accordingly.
For example, if players 1 and 2 have not played according to the records and no reversal condition applies, output "1 2". Otherwise, if a reversal is indicated based on the existing records, output the reversed order. This problem tests your ability to complete the nearly full tournament schedule.
inputFormat
The input is given via standard input. The first line contains a single integer (m) representing the number of players. It is followed by (\binom{m}{2} - 1) lines, each containing two integers separated by a space, representing the match results where the first integer is the winner and the second is the loser.
outputFormat
Output a single line to standard output containing two integers separated by a space, which represent the missing match result in the correct order determined by the problem's conditions.## sample
5
1 3
1 4
1 5
2 3
2 4
2 5
3 4
3 5
4 5
1 2