UptoSkills Pizza PartyEasy

UptoSkills Pizza Party

Easy+10 XP · +5 Aurahash mapcountingfrequency

It's pizza party time at UptoSkills Arena! The student committee ordered a bunch of pizzas, and each pizza has a list of toppings. They want to know which topping is the most popular, meaning it appears on the most pizzas. If there's a tie for the most popular topping, they'll choose the one that comes first alphabetically. Help them find that winning topping!

Input

The first line contains an integer N, the number of pizzas. Each of the next N lines describes a pizza, starting with an integer K, the number of toppings on that pizza, followed by K strings representing the toppings.

Output

Print a single string: the name of the most popular topping. If there is a tie, print the topping that comes first alphabetically.

Constraints

1 <= N <= 50 1 <= K <= 10 Each topping name consists of lowercase English letters and has length between 1 and 10. There will be at least one pizza and one topping.

Time limit 1 s (native code; slower languages get more)Memory 256 MB13 hidden tests

Example 1

Input
3
3 pepperoni mushroom onion
2 mushroom cheese
4 pepperoni olive mushroom
Output
mushroom

Mushroom appears on 3 pizzas, pepperoni on 2, onion on 1, cheese on 1, olive on 1. Mushroom is the most popular.

Example 2

Input
2
2 ham pineapple
3 ham bacon pineapple
Output
ham

Ham and pineapple both appear on 2 pizzas. Ham comes first alphabetically.

Hints