import collections
 
N,*S = open(0).read().split()
C = collections.Counter(S)
 
i = C.most_common()[0][1]
print(*sorted([k for k,v in C.most_common() if v == i]), sep='\n') import collections collections N,*S = open(0).read().split() N open(0).read().split() (0).read().split (0).read() (0).read (0) open 0 read split *S S C = collections.Counter(S) C collections.Counter(S) collections.Counter collections Counter S i = C.most_common()[0][1] i C.most_common()[0][1] [0] C.most_common() C.most_common C most_common 0 1 k for k,v in C.most_common() if v == i for k,v in C.most_common() if v == i k v C.most_common() C.most_common C most_common v == i v i if v == i k print(*sorted([k for k,v in C.most_common() if v == i]), sep='\n') print *sorted([k for k,v in C.most_common() if v == i]) sorted([k for k,v in C.most_common() if v == i]) sorted [k for k,v in C.most_common() if v == i] sep='\n' sep '\n' i = C.most_common()[0][1] C.most_common()[0][1] i N,*S = open(0).read().split() open(0).read().split() N C = collections.Counter(S) collections.Counter(S) C
import collections
 
N,*S = open(0).read().split()
C = collections.Counter(S)
 
i = C.most_common()[0][1]
print(*sorted([k for k,v in C.most_common() if v == i]), sep='\n')