_,*ss = open(0).read().split()

from collections import Counter
c = Counter(ss)

mx = c.most_common(1)[0][1]

for s in sorted(key for key,count in c.items() if count==mx):
    print(s) _,*ss = open(0).read().split() _ open(0).read().split() (0).read().split (0).read() (0).read (0) open 0 read split *ss ss from collections import Counter c = Counter(ss) c Counter(ss) Counter ss mx = c.most_common(1)[0][1] mx c.most_common(1)[0][1] [0] c.most_common(1) c.most_common c most_common 1 0 1 for s in sorted(key for key,count in c.items() if count==mx):
    print(s) s sorted(key for key,count in c.items() if count==mx) sorted key print(s) print s c = Counter(ss) Counter(ss) c mx = c.most_common(1)[0][1] c.most_common(1)[0][1] mx _,*ss = open(0).read().split() open(0).read().split() _
_,*ss = open(0).read().split()

from collections import Counter
c = Counter(ss)

mx = c.most_common(1)[0][1]

for s in sorted(key for key,count in c.items() if count==mx):
    print(s)