N=int(input())
S=list(input() for _ in range(N))

from collections import Counter

cnt=Counter(S)
max_cnt=cnt.most_common()[0][1]
ans=[name for name, cnt in cnt.items() if cnt==max_cnt]
print(*sorted(ans), sep="\n")  N=int(input()) N int(input()) int input() input S=list(input() for _ in range(N)) S list(input() for _ in range(N)) list input() input from collections import Counter cnt=Counter(S) cnt Counter(S) Counter S max_cnt=cnt.most_common()[0][1] max_cnt cnt.most_common()[0][1] [0] cnt.most_common() cnt.most_common cnt most_common 0 1 name for name, cnt in cnt.items() if cnt==max_cnt for name, cnt in cnt.items() if cnt==max_cnt name cnt cnt.items() cnt.items cnt items cnt==max_cnt cnt max_cnt if cnt==max_cnt name ans=[name for name, cnt in cnt.items() if cnt==max_cnt] ans [name for name, cnt in cnt.items() if cnt==max_cnt] print(*sorted(ans), sep="\n") print *sorted(ans) sorted(ans) sorted ans sep="\n" sep "\n" S=list(input() for _ in range(N)) list(input() for _ in range(N)) S cnt=Counter(S) Counter(S) cnt ans=[name for name, cnt in cnt.items() if cnt==max_cnt] [name for name, cnt in cnt.items() if cnt==max_cnt] ans N=int(input()) int(input()) N max_cnt=cnt.most_common()[0][1] cnt.most_common()[0][1] max_cnt
N=int(input())
S=list(input() for _ in range(N))

from collections import Counter

cnt=Counter(S)
max_cnt=cnt.most_common()[0][1]
ans=[name for name, cnt in cnt.items() if cnt==max_cnt]
print(*sorted(ans), sep="\n") 