TCCC '24 November P4 - Gemstones

View as PDF

Submit solution

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

Author:
Problem type

John collects gemstones. In his collection are N different gemstones. Each of these gemstones are marked with a number a_i, which represents the type of gemstone it is. John is looking to make some money off his collection, so he wants to find the rarest gemstone to sell (since rarer obviously means better). However, he has a lot of gems, and there might be multiple equally rare types. He has promised a cut of the profit to you if you can find them all. Can you do it?

Limitations

1 \le N \le 10000
1 \le a_i \le 10^5

Input Specification

The first line of input will be N.
The next N lines will consist of one integer a_i each, representing the type of gemstone i.

Output Specification

A series of lines each containing 1 integer, representing all the rarest types of gemstone in John's collection, sorted from least to greatest.

Sample Input

4
1
2
2
3

Sample Output

1
3

Comments

There are no comments at the moment.