Counting Students
Input: Standard Input (stdin)
Output: Standard Output (stdout)
Memory limit: 16 megabytes
Time limit: 1.0 seconds
Output: Standard Output (stdout)
Memory limit: 16 megabytes
Time limit: 1.0 seconds
Andrew isn't very good at counting students. Instead he has the students number themselves and count off. Unfortunately they don't want to count off in order and some of the students forget their number and use someone else's. Your job is to tell Andrew which numbers students use more than once.
Input format
- The first line of input will contain one integer, n, representing the number of students. 1 <= n <= 1,000,000.
- The next n lines will contain one integer each, x, representing the number given by the student 1 <= x <= n.
Output format
- You should output a sorted list of new line separated integers representing numbers that have been used more than once.
Sample input
5
2
2
4
4
1
Sample output
2
4