PEG 11/12 Programming Test 1 - October 19

Problem 2: Cyclopian Suits

After securing a steady supply of oxygen, FurWear is ready to begin production of their fine apparel. Unfortunately, since the Oelfinn are giants, it takes a long time to make clothing for them, so FurWear can only make one size of clothing. They have acquired the Cyclopian census data and would like to find the most common size. Can you help them?

Input

The first line consists of a single integer N (1 ≤ N ≤ 50 000). The following N lines each contain a single integer ai (10 ≤ ai ≤ 1000), the size of clothing worn by the ith Oelfinn.

Output

Output the number of most common sizes, followed by the most common sizes in ascending order, each on a separate line.

Sample Input

5
30
34
30
20
34

Sample Output

2
30
34

All Submissions
Best Solutions


Point Value: 3
Time Limit: 2.00s
Memory Limit: 16M
Added: Oct 17, 2011
Author: jargon

Languages Allowed:
C++03, PAS, C, HASK, ASM, RUBY, PYTH2, JAVA, PHP, SCM, CAML, PERL, C#, C++11, PYTH3

Comments (Search)

It's quiet in here...