The Live Hit Parade
A local radio station runs a wild live chart. Listeners text in votes for their favorite song, and the host instantly announces the current top song after each vote.
Your job is to keep the scoreboard and tell the host what to say after every single vote.

The first line of the input contains a single integer n
- the number of incoming votes.
The second line contains n
space-separated song names (lowercase strings without spaces), in the exact order the votes arrive.
After processing each vote, the program should print the name of the song that is currently in the lead among all votes so far. If several songs are tied for first place, announce the alphabetically smallest one.
Input | Output |
---|---|
10 | starlight |
7 | aria |
Constraints
Time limit: 2 seconds
Memory limit: 512 MB
Output limit: 1 MB