DWITE '09 R1 #3 - That Missing Number

View as PDF

Points: 5
Time limit: 2.0s
Memory limit: 64M

Problem type
DWITE Online Computer Programming Contest, October 2009, Problem 3

You have a continuous sequence of unique numbers, , that you like very much, but your little sister always steals one (and only one), and randomly re-arranges the rest in an attempt to hide the crime. Given numbers, in a random order, find out which number was taken.

The input will contain 5 sets of input. The first line will be an integer , the number of items remaining. Followed by lines of unique integers, from at least to at most .

The output will contain 5 lines, each an integer from the missing set.

Note: the original sorted sequence is . Any of the numbers (including or ) can be taken.

Sample Input

2
1
2
2
2
3
2
1
3

Sample Output

3
1
2