#P15185. [SWERC 2019] Biodiversity

[SWERC 2019] Biodiversity

题目描述

Alicia has a huge garden which is the habitat of many animals that she really cares about. After listening to a podcast about biodiversity, she becomes very concerned about the balance between species in her garden. She wants to know if there is a species that could overtake the others. In order to do so, she decides to carry out a census of all animals in the garden, writing down the species of each of them. Can you help her checking if there is strictly more animals from one species than the animals from all others species together?

输入格式

The input consists of the following lines:

  • on the first line: an integer NN;
  • on each of the next NN lines: the species of an animal as a string of length at most 20, containing only ASCII alphanumeric characters.

输出格式

A string that appears a number of times that is greater than the sum of the others, if there is any, or the string "NONE" otherwise.

3
frog
fish
frog
frog
4
cat
mouse
mouse
cat
NONE

提示

Limits

  • 1N2×1051 \leq N \leq 2 \times 10^5.