import sys 
from collections import Counter
 
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
 
N = int(readline())
l = read().decode().split()
c = Counter(l)
 
max = c.most_common()[0][1]
ans = [i[0] for i in c.items() if i[1] >= max]
 
print('\n'.join(sorted(ans))) import sys sys from collections import Counter read = sys.stdin.buffer.read read sys.stdin.buffer.read sys.stdin.buffer sys.stdin sys stdin buffer read readline = sys.stdin.buffer.readline readline sys.stdin.buffer.readline sys.stdin.buffer sys.stdin sys stdin buffer readline readlines = sys.stdin.buffer.readlines readlines sys.stdin.buffer.readlines sys.stdin.buffer sys.stdin sys stdin buffer readlines N = int(readline()) N int(readline()) int readline() readline l = read().decode().split() l read().decode().split() ().decode().split ().decode() ().decode () read decode split c = Counter(l) c Counter(l) Counter l max = c.most_common()[0][1] max c.most_common()[0][1] [0] c.most_common() c.most_common c most_common 0 1 i[0] for i in c.items() if i[1] >= max for i in c.items() if i[1] >= max i c.items() c.items c items i[1] >= max i[1] i 1 max if i[1] >= max i[0] i 0 ans = [i[0] for i in c.items() if i[1] >= max] ans [i[0] for i in c.items() if i[1] >= max] print('\n'.join(sorted(ans))) print '\n'.join(sorted(ans)) '\n'.join '\n' join sorted(ans) sorted ans N = int(readline()) int(readline()) N readline = sys.stdin.buffer.readline sys.stdin.buffer.readline readline l = read().decode().split() read().decode().split() l c = Counter(l) Counter(l) c readlines = sys.stdin.buffer.readlines sys.stdin.buffer.readlines readlines max = c.most_common()[0][1] c.most_common()[0][1] max read = sys.stdin.buffer.read sys.stdin.buffer.read read ans = [i[0] for i in c.items() if i[1] >= max] [i[0] for i in c.items() if i[1] >= max] ans
import sys 
from collections import Counter
 
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
 
N = int(readline())
l = read().decode().split()
c = Counter(l)
 
max = c.most_common()[0][1]
ans = [i[0] for i in c.items() if i[1] >= max]
 
print('\n'.join(sorted(ans)))