BlueBook - Mode

View as PDF

Submit solution

Points: 3
Time limit: 1.0s
Memory limit: 16M

Problem type
BlueBook

Determine the mode of a set of data.

Input Specification

A sequence of lines. Each line will contain a non-negative integer no greater than 100 and represents one element of the data, except the last line, which will contain the single integer -1 and is not part of the data.

Output Specification

The mode of the set of data. If there is more than one mode, output all modes sorted in ascending order on separate lines.

Sample Input

2
3
4
4
-1

Sample Output

4

Comments

There are no comments at the moment.