JDCC '17 Contest 3 J1 - Applying for Jobs

View as PDF

Submit solution

Points: 3
Time limit: 2.0s
Memory limit: 64M

Problem type

Everyone knows that working at a chocolate company is the best job in the world. Everyone also knows that the longer the name of the chocolate company, the more free samples they give their employees!

Given a list of chocolate company names, find the one that gives away the most chocolate.

Input Specification

The first line contains an integer N (1 \le N \le 100), which is the number of companies.

The next N​ lines each contain the name of one chocolate company.

Output Specification

Output the name of the company that gives away the most chocolate. If there is a tie, choose the one that appears first in the input.

Sample Input

4
Exquisite Evening
Chocolate Factory
Fancy Chocos
Milky Delight

Sample Output

Exquisite Evening

Explanation for Sample

The two companies with the longest names are Exquisite Evening and Chocolate Factory, and Exquisite Evening is first in the list.


Comments

There are no comments at the moment.