peterverebics/CodeNet_Python_118 huggingface dataset:
import collections
n = int(input())
s = [input() for _ in range(n)]
s = collections.Counter(s).most_common()
ans = []
for i in range(1, len(s) + 1):
    ans.append(s[i - 1][0])
    if i == len(s):
        break
    if s[i - 1][1] != s[i][1]:
        break
ans.sort()
print(*ans, sep='\n')
N = int(input())

dic = {}

for _ in range(N):
    a = input()
    if a in dic:
        dic[a] += 1
    else:
        dic[a] = 1

m = max(dic.values())

for s in sorted(k for k in dic if dic[k] == m):
    print(s)
S = []

N = int(input())
for i in range(N):
	S.append(input())

S.sort()
count = 0
max_count=0
s_max=[]
for i in range(N):
	if i==0:
		s_0 = S[i]
		s_max.append(s_0)
		continue
	s_1 = S[i]
    
	if s_0 == s_1:
		count += 1
	else:
		count = 0
      
	if max_count==count:
		max_count = count
		s_max.append(s_1)
	elif max_count < count:
		max_count = count
		s_max=[]
		s_max.append(s_1)
      
	s_0 = s_1
    

for i in s_max:
  print(i)
from collections import Counter
n=int(input())
a=[]
for i in range(n):
  a.append(input())
ac=Counter(a)
acs=sorted(ac.items(),key=lambda x:x[1],reverse=1)
z=len(acs)
i=0
temp=[]

while i<=z-1 and acs[i][1]==acs[0][1] :
  temp.append(acs[i][0])
  i+=1
temp.sort()
for i in temp:
  print(i)
import collections
 
n = int(input())
 
res = []
 
for _ in range(n):
  res.append(input())
 
c = collections.Counter(res)
aa = c.most_common()
 
ss = aa[0][1]
res2 = []
 
aa.sort()
for i in aa:
  if i[1] == ss:
    res2.append(i[0])
    print(i[0])
N = int(input())
S = [0]*N
for i in range(N):
    S[i] = input()
A = {}
for s in S:
    if s not in A:
        A[s] = 1
    else:
        A[s] += 1

B = [(a, A[a]) for a in A]
# print(B)
B.sort(reverse=True, key=lambda x: x[1])
# print(B)
count = B[0][1]
ans = []
for b in B:
    if b[1] == count:
        ans.append(b[0])

ans.sort()
for a in ans:
    print(a)
from collections import Counter
n=int(input())
s=[input() for i in range(n)]
c=Counter(s)
t=[]
u=c.most_common()
v=u[0][1]
t.append(u[0][0])
for i in range(1,len(c)):
  a=u[i][1]
  if v>a:
    break
  else:
    t.append(u[i][0])
t.sort()
for i in t:
  print(i)
from collections import Counter
N = int(input())
A = [None for i in range(N)]
for i in range(N):
  A[i] = input()
A = Counter(A)
keyA = list(A.keys())
valuesA = list(A.values())
most = max(valuesA)

ans = [None for _ in range(N)]
for i in range(len(valuesA)):
  if valuesA[i] == most:
    ans[i] = keyA[i]
ans = [a for a in ans if type(a) == str]
ans = sorted(ans)
for i in range(len(ans)):
  print(ans[i])
import sys
stdin = sys.stdin
from collections import defaultdict

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))

n = ni()
d = defaultdict(int)
for _ in range(n):
    s = ns()
    d[s] += 1
d = sorted(d.items(), key = lambda x:x[1], reverse=True)
ki, vi = d[0]
k = [ki]
for ki, v in d[1:]:
    if v == vi:
        k.append(ki)
k.sort()
for ki in k:
    print(ki)
N = int(input())
d = {}
for i in range(N):
    s = input()
    if s in d.keys():
        d[s] += 1
    else:
        d[s] = 1
Max = max(d.values())
keys = [k for k, v in d.items() if v == Max]
keys.sort()
for k in keys:
    print(k)
from collections import Counter
n = int(input())
s = []
for _ in range(n):
    s.append(input())
s = Counter(s)
words, counts = zip(*s.most_common())
selected = []
num = None
for w, c in zip(words, counts):
    if num == None:
        num = c
        selected.append(w)
    else:
        if c == num:
            selected.append(w)
        else:
            break
print(*sorted(selected), sep='\n')
n = int(input())

d = {}
for _ in range(n):
    s = input()
    if s in d:
        d[s] += 1
    else:
        d[s] = 1

MAX = 0
ans = []
for k, v in d.items():
    if v > MAX:
        ans = [k]
        MAX = v
    elif v == MAX:
        ans.append(k)


ans.sort()
for a in ans:
    print(a)
n = int(input())
d  ={}
for i in range(n):
    s = str(input())
    if s in d:
        d[s] += 1
    else:
        d[s] = 1

d = sorted(d.items(), key=lambda x : x[0])
d = sorted(d, key=lambda x : x[1],reverse=1)

flag = d[0][1]
for i in d:
    if i[1] == d[0][1]:
        print(i[0])
    else:
        exit()
dic={}

n=int(input())
for i in range(n):
    s=input()
    if s in dic:
        dic[s]+=1
    else:
        dic[s]=1

#print(dic)

maxa=0
for val in dic:
    maxa=max(dic[val],maxa)
ans=[]
for val in dic:
    if dic[val]==maxa:
        ans.append(val)
print("\n".join(sorted(ans)))
import collections

N=int(input())
S=[input() for i in range(N)]

lis=collections.Counter(S)

max_lis_v=sorted(list(lis.values()))[-1]
lis_i=sorted(list(lis.items()))

for i in lis_i:
    if i[1]==max_lis_v:
        print(i[0])
import collections

N = int(input())

words=[]

for i in range(N):
    words.append(input())

c = collections.Counter(words)

l=c.most_common()

max_num = l[0][1]

max_words =[]
    
for i in l:
    if i[1] == max_num:
        max_words.append(i[0])
    else:
        break
        
max_words.sort()

for word in max_words:
    print(word)
from collections import defaultdict
n = int(input())
dic = defaultdict(int)
for i in range(n):
  dic[input()] += 1
max_s = max(dic.values())
for k, v in sorted(dic.items()):
  if v == max_s:
    print(k)
import collections

N = int(input())
S = [0]*N
for i in range(N):
  S[i] = input()

dic = collections.Counter(S)
max_value = max(dic.values())

A = []

for k, v in dic.items():
  if v == max_value:
    A.append(k)

A = sorted(A)

for i in A:
  print(i)
from collections import defaultdict
def main():
    N = int(input())
    vote = defaultdict(int)
    for i in range(N):
        vote[input()] += 1
    max_vote = max(vote.values())
    new_vote = sorted(list(vote.items()), key= lambda x : x[0])
    new_vote = sorted(new_vote, key= lambda x : x[1], reverse = True)
    for k, v in new_vote:
        if v == max_vote:
            print(k)
        else:
            break
if __name__ == "__main__":
    main()
N = int(input())

count = dict()
for _ in range(N):
    x = input()
    count[x] = count.get(x, 0) + 1

max_val = -float("infinity")
for k, v in sorted(count.items(), key=lambda x: (-x[1], x[0])):
    max_val = max(v, max_val)
    if v == max_val:
        print(k)
    else:
        break
from collections import defaultdict
d=defaultdict(int)
for i in range(int(input())):
    d[input()]+=1
ans=[]
d=list(d.items())
d.sort(key=lambda x:-x[1])

m=d[0][1]
for i,j in d:
    if m==j:
        ans+=[i]
    else:
        break

for i in sorted(ans):
    print(i)
# -*- coding: utf-8 -*-
"""
Created on Thu May  7 22:30:26 2020

@author: shinba
"""

from operator import itemgetter

N = int(input())

data = {}

for i in range(N):
    string = input()
    if string in data:
        data[string] += 1
    else:
        data[string] = 1

s = sorted(data.items(),key=itemgetter(1),reverse = True)

M = s[0][1]

ans = [s[0][0]]
for i in range(1,len(s)):
    if s[i][1] == M:
        ans.append(s[i][0])
    else:
        break

ans.sort()

for i in ans:
    print(i)
import sys
from collections import Counter

input = sys.stdin.readline

n = int(input())
S = [input().rstrip() for _ in range(n)]

c = Counter(S).most_common()

words = []
max = c[0][1]
for i in range(len(c)):
    if max == c[i][1]:
        words.append(c[i][0])

words.sort()
print(*words, sep='\n')
from collections import Counter
n = int(input())
s = [input() for i in range(n)]
s = Counter(s)

maxs = max(s.values())
ss = []
for k, v in s.items():
  if maxs == v:
    ss.append(k)
ss.sort()
for si in ss:
  print(si)
n = int(input())
d = dict()

for _ in range(n):
    s = input()

    if s in d:
        d[s] += 1
    else:
        d[s] = 1


items = list(d.items())
max_num = max([v[1] for v in items])
ans = []

for k,v in items:
    if max_num == v:
        ans.append(k)

ans.sort()

for v in ans:
    print(v)
N = int(input())
S_list = []
for n in range(N):
    S_list.append(input())

dic = dict()
for s in S_list:
    if s in dic:
        dic[s] += 1
    else:
        dic[s] = 1

dict_sorted = sorted(dic.items(), key=lambda x: x[1], reverse=True)

outs = []
max = None
for (out, num) in dict_sorted:
    if max is None:
        outs.append(out)
        max = num
    elif max == num:
        outs.append(out)
    else:
        break

for out in sorted(outs):
    print(out)
import math
import sys
n = int(input())
li=[input()]
for i in range(n-1):
    li.append(input())
li.sort()
cnt = 0
tmp = 1
li.append('')
for i in range(n):
    if (li[i] == li[i + 1]):
        tmp += 1
    else:
        if(cnt<tmp):
            cnt=tmp
        tmp = 1
tmp=1
for i in range(n):
    if (li[i] == li[i + 1]):
        tmp += 1
    else:
        if (cnt == tmp):
                print(li[i])
        tmp = 1
import collections

N = int(input())
S = []
for i in range(N):
    S.append(input())

#print(N,S)
#print("------------")
c = collections.Counter(S)
#print(c.most_common())
temp = c.most_common()
max_count = temp[0][1]

T = []
for i in range(N):
    if len(temp) > 1:
        if temp[i][1] == max_count:
            T.append(temp[i][0])
        else:
            break
    else:
        T.append(temp[0][0])
        break

T.sort()
for i in range(len(T)):
    print(T[i])
import collections
n = int(input())
c = collections.Counter([ input() for i in range(n) ])
ma = max(c.values())
print(*sorted([ i for i, j in c.items() if j == ma ]), sep='\n')
def main():
  num = int(input())

  tmp = [input() for i in range(num)]

  tmp2 = {}
  for t in tmp:
    if len(tmp2) == 0:
      tmp2[t] = 1
    else:
      if t in tmp2:
        tmp2[t] += 1
      else:
        tmp2[t] = 1

  _tmp2 = sorted(tmp2.items(), key=lambda x:x[1])
  tmp3 = sorted(tmp2.items())
  for t in tmp3:
    if _tmp2[-1][1] == t[1]:
      print(t[0])

main()
from collections import Counter

n = int(input())
s = []
for i in range(n):
  s.append(input())

cnt = -1
counter_s = Counter(s)
ans = []
for word, num in counter_s.most_common():
  if cnt == -1 or cnt == num:
    ans.append(word)
    cnt = num
  else:
    break

ans.sort()
for word in ans:
  print(word)
n = int(input())
s = [input() for _ in range(n)]
d = {}
for w in s:
    if w not in d:
        d[w] = 0
    d[w] += 1
d2 = sorted(d.items(), key=lambda x:x[1], reverse=True)
maxcnts = [w[0] for w in d2 if w[1] == d2[0][1]]
maxcnts.sort()
for ans in maxcnts:
    print(ans)
from collections import Counter
N = int(input())
S = []
for i in range(N):
    S.append(input())
A = []
d = Counter(S)
md = d.most_common(1)[0][1]

for key, value in d.items():
    if value == md:
        A.append(key)

As = sorted(A)
for a in As:
    print(a)
N=int(input())
S = [input() for i in range(N)]
import collections
c = collections.Counter(S)
values, counts = zip(*c.most_common())

n=0
for i in range(len(counts)-1):
  if counts[i]==counts[i+1]:
    n=n+1
  else:
    break
answer=[]    
for i in range(n+1):
  answer.append(values[i])
answer=sorted(answer)

for i in answer:
  print(i)
from collections import Counter

c = Counter(input() for _ in range(int(input())))
m = max(c.values())
for s in sorted(s for s, k in c.items() if k == m): 
  print(s)
n = int(input())
cnt_dict = {}
for _ in range(n):
    s = input()
    cnt_dict.setdefault(s,0)
    cnt_dict[s] += 1

cnt_t = sorted(cnt_dict.items(), key=lambda x:(-1)*x[1])

ans_s = []
max_cnt = cnt_t[0][1]
for t in cnt_t:
    if t[1] != max_cnt:
        break
    ans_s.append(t[0])

ans_s.sort()
for s in ans_s:
    print(s)
from collections import Counter
N = int(input())
S = [input() for i in range(N)]
C = Counter(S)
dekai = max(C.values())
M = [kv[0] for kv in C.items() if kv[1] == dekai]
M.sort()
A = '\n'.join(M)
print(A)
n=int(input())
a=[]
for i in range(n):
  a.append(str(input()))

a=sorted(a)
b=[]
c=[]

tmp="."
count=0

for i in range(n):
  if tmp != a[i]:
    b.append(tmp)
    c.append(count)
    tmp=a[i]
    count=1
  else:
    count += 1
 
b.append(tmp)
c.append(count)
k=sorted(c)[-1]
for i in range(len(b)):
  if c[i]==k:
    print(b[i])
import sys
input = sys.stdin.readline

N = int(input())
data = dict()
for _ in range(N):
    s = input()[:-1]
    if s in data:
        data[s] += 1
    else:
        data.setdefault(s, 1)

ans = sorted(data.items(), key=lambda x:x[1], reverse=True)
M = ans[0][1]
A = []
for item, i in ans:
    if M == i:
        A.append(item)
    else:
        break
A.sort()
for item in A:
    print(item)
N = int(input())

dic = {}
m = 1
for i in range(N):
    st = input()
    if st not in dic:
        dic[st] = 1
    else:
        dic[st] += 1
        if dic[st] > m:
            m = dic[st]

ans = []
for s in dic:
    if dic[s] == m:
        ans.append(s)
ans.sort()
for i in range(len(ans)):
    print(ans[i])
import collections
import itertools

N=int(input())
S=[input() for i in range(N)]

counted = collections.Counter(S)

# 最頻値を求める
m = max(counted.values())

# 頻出数の文字を集める
chars = [key for key, value in counted.items()
             if value == m]
chars=sorted(chars)
for a in chars:
  print(a)
from collections import Counter


def main():
    N = int(input())
    A = [input() for _ in range(N)]

    c = Counter(A)
    d = c.most_common()
    ans = []
    for i in c.items():
        if i[1] == d[0][1]:
            ans.append(i[0])
    for i in sorted(ans):
        print(i)


if __name__ == '__main__':
    main()
n=int(input())
dic={}
for i in range(n):
  s=input()
  if s in dic:
    dic[s]+=1
  else:dic[s]=1
sc=[[] for _ in range(n+1)]
mx=0
for i in dic:
  sc[dic[i]].append(i)
  mx=max(mx,dic[i])

for i in sorted(sc[mx]):
  print(i)
def main():
    import sys
    import collections
    input = sys.stdin.readline
    N = int(input())
    S = [input() for i in range(N)]
    c = collections.Counter(S)
    max_num = c.most_common(1)[0][1]
    ss = []
    for cc in c.most_common():
        if cc[1] == max_num:
            ss.append(cc[0])
    ss.sort()
    print("".join(ss))

if __name__ == "__main__":
    main()
#C
#入力
N=int(input())
S=[input() for i in range(N)]

#処理
result={}
for i in S:
    if i in result:
        result[i]+=1
    else:
        result[i]=1

x=max(result.values())

Z=[]
for i in result.items():
    if i[1]==x:
        Z.append(i[0])
Z.sort()
for i in Z:
    print(i)
# ABC155 C
si = lambda: input()
ni = lambda: int(input())
nm = lambda: map(str, input().split())
nl = lambda: list(map(int, input().split()))
from collections import defaultdict as dd
from operator import itemgetter
n=ni()
d=dd(int)
# s=[si() for i in range(n)]
for i in range(n):
    s=input()
    d[s]+=1

mv=0
for k,v in d.items():
    mv=max(mv,v)
ans=set()
for k,v in d.items():
    if mv==v:
        ans.add(k)
ans=list(ans)
ans.sort()
for aaa in ans:
    print(aaa)
N = int(input())
S = []
for i in range(N):
    S.append(input())
S.sort()
S.append("A")
B = []
M = 1
T = 1
for i in range(N):
    if S[i] == S[i+1]:
        T += 1
    elif T < M:
        T = 1
    elif T == M:
        T = 1
        B.append(S[i])
    else:
        M = T
        T = 1
        B = [S[i]]

for i in range(len(B)):
    print(B[i])
N = int(input())
S = [input() for i in range(N)]

from collections import Counter
B = []
mycounter = Counter(S)
max_v = max(mycounter.values())
for s, v in mycounter.items():
  if v == max_v:
    B.append(s)
for a in sorted(B):
  print(a)
n = int(input())
dic = {}
for i in range(n):
    w = input()
    if dic.get(w) is None:
        dic[w] = 1
    else:
        dic[w] += 1

ans = sorted(dic.items(), key=lambda x:x[1],reverse=True)

maxn = ans[0][1]

ans = [x for x,y in ans if maxn==y]
ans.sort()
for i in ans:
    print(i)
n = int(input())
s = [input() for i in range(n)]

# 辞書作成
s_dict = dict()
for i in s:
    if i not in s_dict:
        s_dict[i] = 1
    else:
        s_dict[i] += 1

m = max(s_dict.values())
ans = []
for k, v in s_dict.items():
    if v == m:
        ans.append(k)
ans.sort()
# ソート
print(*ans, sep="\n")
import collections
n = int(input())
s = [input() for _ in range(n)]

s = collections.Counter(s).most_common()
mx = s[0][1]

ans = []
for k, v in s:
    if mx == v:
        ans.append(k)


for i in sorted(ans):
    print(i)
N=int(input())
List=[input() for i in range(N)]

dict = {}

for i in range(N):
	if List[i] in dict:
		dict[List[i]] += 1
	else:
		dict[List[i]] = 1

dict_list = list(dict.items())
dict_list.sort(key=lambda x: x[1], reverse=True)
max = dict_list[0][1]
dict_list.sort(key=lambda x: x[0])

for id in dict_list:
	if max == id[1]:
		print(id[0])
N = int(input())
D = {}
for _ in range(N):
  s = input()
  if s in D:
    D[s] += 1
  else:
    D[s] = 1
m = max(D.values())
for k, v in sorted(D.items()):
  if v==m:
    print(k)
n = int(input())

s = []
for i in range(n):
    s.append( input())

x = set(s)

dic = {}
for i in x:
    dic[i] = 0


for i in s:
    dic[i] +=1

max_dic = max(dic.values())

ans = []
for i in x:
    if dic[i] == max_dic:
        ans.append(i)


for i in sorted(ans):
    print(i)
from collections import Counter
def main():
    n = int(input())
    S = [input() for _ in range(n)]
    c = Counter(S).most_common()
    V = c[0][1]
    ans = [k for k, v in c if v == V]
    [print(a) for a in sorted(ans)]

if __name__ == '__main__':
    main()
_,*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)
n = int(input())
s = []
for i in range(n):
    s.append(input())

dic = {}

for x in s:
    if x in dic.keys():
        dic[x] += 1
    else:
        dic[x] = 1

max_v = max(dic.values())
a = []
for k, v in dic.items():
    if v == max_v:
        a.append(k)

ans = sorted(a)
for a in ans:
    print(a)
n= int(input())
s = {}

for _ in range(n):
    t = input()
    s.setdefault(t, 1)
    s[t] += 1

ans = []
m = max(s.values())
for k, v in s.items():
    if v == m:
        ans.append(k)

for m in sorted(ans):
    print(m)
def resolve():
    N = int(input())
    S = [str(input()) for _ in range(N)]
    words = dict(zip(set(S), [0] * len(S)))
    for s in S:
        if s in words:
            words[s] += 1

    words = sorted(words.items(), key=lambda x: x[1], reverse=True)
    mx = words[0][1]
    words = sorted(words, key=lambda x: x[0])
    for word in words:
        if word[1] == mx:
            print(word[0])

    return


resolve()
import sys

input = sys.stdin.readline
d = {}
for _ in range(int(input())):
    s = input().replace("\n", "")
    if s in d:
        d[s] += 1
    else:
        d[s] = 1

x = max(d.values())
l = sorted(s for (s, i) in d.items() if i == x)
print(*l, sep="\n")
from collections import Counter
N = int(input())
S = [input() for _ in range(N)]
cntr = Counter(S)
mc = cntr.most_common()
n = mc[0][1]
ans = []
for k, v in mc:
    if n!=v:
        break
    ans.append(k)
ans.sort()
print("\n".join(ans))
n=int(input())
a={}
for i in range(n):
    key=input()
    if key in a:
        a[key]+=1
    else:
        a[key]=1
b=max(list(a.values()))
c=[]
for k,v in a.items():
    if v==b:
        c.append(k)
c=sorted(c)
for i in range(len(c)):
    print(c[i])
N = int(input())
A = [""] * N
for i in range(N):
	A[i] = input()
A.sort()

c, m = 1, [1, []]
for i in range(1, N):
	if A[i - 1] == A[i]:
		c += 1
	else:
		if m[0] == c:
			m[1].append(A[i - 1])
		elif m[0] < c:
			m[1].clear()
			m[1].append(A[i - 1])
			m[0] = c
		c = 1

if m[0] == c:
	m[1].append(A[-1])
elif m[0] < c:
	m[1].clear()
	m[1].append(A[-1])

for i in m[1]:
	print(i)
n = int(input())
s= []
for _ in range(n):
    x = input()
    s.append(x)
s.sort()
mydict = {}
for i in range(n):
    x = s[i]
    if x in mydict:
        mydict[x]+=1
    else :
        mydict[x] = 1

max_n = -1
for v in mydict.values():
    max_n = max(max_n,v)
aa = []
for k in mydict:
    if mydict[k] == max_n:
        aa.append(k)
aa = sorted(aa)
for i in aa:
    print(i)
from collections import Counter
n = int(input())
S = ['_']*n
for i in range(n):
    S[i] = input()
cS = Counter(S).most_common()
mx = cS[0][1]
ans = []
for i in range(len(cS)):
    if cS[i][1]==mx:
        ans.append(cS[i][0])
    else:
        break
ans = sorted(ans)
for i in range(len(ans)):
    print(ans[i])
N = int(input())
dic, rst = {}, []
for i in range(N):
    s = input()
    if not s in dic:
        dic[s] = 1
    else:
        dic[s] += 1
max_val = max(dic.values())
rst = [ key for key, val in dic.items() if val == max_val ]
[ print(i) for i in sorted(rst) ]
n = int(input())
d = {}
for i in range(n):
  s = input()
  d[s] = d.get(s,0)+1
m = max(d[i] for i in d)
for s in sorted(d):
  if d[s]==m:
    print(s)
from collections import Counter
N=int(input())
Ss=[input() for i in range(N)]
Ss=Counter(Ss).most_common()
mincount=Ss[0][1]
ans=[]
for s in Ss:
    if s[1]==mincount:
        ans.append(s[0])
for a in sorted(ans):
    print(a)
N = int(input())
S = []
for i in range(N):
    S.append(input())

S.sort()

dic = list((set(S)))
dic.sort()
times = [0] * len(dic)
aa=0

for s in S :
    if dic[aa] == s:
        times[aa] += 1
    else:
        aa += 1
        times[aa] += 1

ans = [0] * len(dic)
ma = max(times)

s_ans = []

for a in range(len(dic)):
    if times[a] == ma:
        s_ans.append(dic[a])

s_ans.sort()

for j in range(len(s_ans)):
    print(s_ans[j])
N=int(input())
kouholist=[]
worddict=dict()
maxvalue=0
for i in range(N):
    S=input()
    if S in worddict.keys():
        worddict[S]+=1
    else:
        worddict[S]=1
    maxvalue=max(maxvalue,worddict[S])
#print("ここから")
#print(worddict)
for k in worddict.keys():
    if worddict[k]==maxvalue:
        kouholist.append(k)
kouholist=sorted(kouholist)
for h in range(len(kouholist)):
    print(kouholist[h])
from collections import Counter

n = int(input())
s = Counter()

for _ in range(n):
    s.update({input():1})

t = s.most_common()

ans = []
for item in t:
    if item[1] != t[0][1]:
        break
    ans.append(item[0])

ans = sorted(ans)

for i in ans:
    print(i)
n=int(input())
s_list=[input() for _ in range(n)]

import collections
s_counter = collections.Counter(s_list)

import sys
max_count = s_counter.most_common()[0][1]

s_list_keys = list(s_counter.keys())
s_list_values = list(s_counter.values())

list_ans = []

for i in range(len(s_list_keys)):
    if s_list_values[i] == max_count:
        list_ans.append(s_list_keys[i])

list_ans.sort()

for i in range(len(list_ans)):
    print(list_ans[i])
N = int(input())

d = {}
for _ in range(N):
    S = input()
    if S in d:
        d[S] += 1
    else:
        d[S] = 1

m = max(d.values())
for s in sorted(k for k in d if d[k] == m):
    print(s)
N = int(input())
S = [0] * N
for i in range(N):
    S[i]= input()

dic = {}
for i in range(N):
    if (S[i] in dic.keys()) == False:
        dic[S[i]] = 1
    else:
        dic[S[i]] = dic[S[i]] + 1

sortdic = sorted(dic.items(), key = lambda x:x[1])

m = sortdic[len(sortdic)-1][1]
ans = []
for i in range(len(sortdic)):
    if sortdic[i][1] == m:
        ans.append(sortdic[i][0])

ans.sort()
for i in range(len(ans)):
    print(ans[i])
# -*- coding: utf-8 -*-

N = int(input().strip())
S_list = [input().strip() for _ in range(N)]
#-----

S_dic = {}

for s in S_list:
    S_dic.setdefault(s, 0)
    S_dic[s] += 1

S_dic_sorted = sorted(S_dic.items(), key = lambda x: x[1], reverse=True)
max_cnt_S = S_dic_sorted[0][1]
ans = []

for k,v in S_dic_sorted:
    if v == max_cnt_S:
        ans.append(k)

ans.sort()

for word in ans:
    print(word)
from collections import Counter

n = int(input())
s_list = []

for i in range(n):
    s_list.append(input())

s_list.sort()
c = Counter(s_list)
l = c.most_common()    
count = l[0][1]
l.sort()
for i in l:
    if count == i[1]:
        print(i[0])
from collections import Counter
from itertools import groupby
from operator import itemgetter

c = Counter(input() for _ in range(int(input())))
a = sorted((-c[x],x) for x in c)
for _, s in next(groupby(a, itemgetter(0)))[1]:
  print(s)
N = int(input())
S = [input() for i in range(N)]
S.sort()

dic = {}
for i in S:
  dic[i] = 0
for i in S:
  dic[i] += 1
M = max(dic.values())
for i in dic:
  if dic[i] == M:
    print(i)
n = int(input())

import collections

s = []
for _ in range(n):
  s.append(input())

sc = collections.Counter(s)
m = sc.most_common()

cc = m[0][1]
r = []
for v, c in m:
  if c != cc:
    continue
  r.append(v)
  
for v in sorted(r):
  print(v)
from collections import Counter

n = int(input())
xc = Counter()
for _ in range(n):
    xc[input()] += 1

mx = xc.most_common(1)[0][1]
ans = []
for v in xc.items():
    if v[1] == mx:
        ans.append(v[0])
ans.sort()
print(*ans, sep="\n")