Predictive algorithms are simple rules that use what happened before to make a good guess about what might happen next. They power everyday tools: apps recommend videos you’ll enjoy, email filters catch spam, maps estimate your arrival time, stores plan how many items to stock, banks spot suspicious card charges, hospitals flag patients who may need extra care, energy teams forecast tomorrow’s demand, and support desks route tickets to the right team. The same idea shows up in research and industry projects alike - anywhere a past-to-future pattern helps people decide faster and better.
First Challenge: The Best Snack
The company you work for has a snack cart in the office with different snacks. Employees love taking those snacks during the day, but some snacks run out faster than others.
So, the company decides to order an additional shelf of the most popular snack for today, based on what people chose from the snack cart yesterday.
They ask you to help them predict the most popular snack based on yesterday's data.
The first line of the input contains a single integer n representing the number of snacks employees ate yesterday.
The second line contains n space-separated snack names (the snack names don't contain spaces).
The program should print the name of the snack that the company should order to put on the additional shelf. In case there are several equally popular candidates, the program should print the alphabetically smallest one.