SMS voting

SMS voting

In the final American Idol SMS voting was conducted to determine the winners among the N participants. TV viewers to send SMS with the number (a number from 1 to N) of your favorite artist and number of the SMS were rating each participant. Total on the host computer competition, of M messages SMS. Need to make a program that displays numbers of three winners in descending order of their rankings and increasing numbers, if the ratings are equal.


The first line contains two numbers N and M (3N 100, 1 M 1000000).

The next line of M numbers, each of which does not exceed N.


Three numbers - numbers of the winners recorded in a single line through the space.

Time limit 1 second
Memory limit 128 MiB
Input example #1
5 10
1 2 3 4 5 2 1 2 4 2
Output example #1
2 1 4