peterverebics/CodeNet_Python_118 huggingface dataset:
import collections
a = int(input())
l = []
for i in range(a):
    l.append(input())
counted = collections.Counter(l)
 
# 最頻値を求める
m = max(counted.values())
 
# 頻出数の文字を集める
chars = [key for key, value in counted.items()
             if value == m]
 
for i in chars:
    print(i)
# C - Poll

N = int(input())
D = {}
for _ in range(N):
    s = str(input())
    if s not in D:
        D[s] = 1
    else:
        D[s] += 1

ans = []
mx = D[max(D)]
for d in D:
    if D[d] == mx:
        ans.append(d)

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

s = {}
i = 0
while n > i:
    s_tmp = input()
    if s.get(s_tmp):
        s[s_tmp] += 1
    else:
        s.setdefault(s_tmp, 1)
    i += 1
    
max_k_list = [kv[0] for kv in s.items() if kv[1] == max(s.values())]

for i in max_k_list:
    print(i)
N = int(input())

strs = []
dicts = {}
for i in range(N):
    s = input()
    if dicts.get(s) is not None:
        dicts[s] += 1
    else:
        dicts[s] = 1

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

i = 0
for s in dict_sorted:
    if dicts[s[0]] >= i:
        print(s[0])
    i = dicts[s[0]]
N = int(input())
S =[input() for _ in range(N)]
A = [S.count(S[i]) for i in range (N)]
Max_A = max(A)
ans = []
for j in range(N):
    if S.count(S[j]) == Max_A:
        ans.append(S[j])
ans = set(ans)
ans = list(ans)
ans.sort
for k in ans:
    print(k)
from collections import Counter
n = int(input())
s = [input() for _ in range(n)]
ans = []

c = Counter(s)
max_count = max(c.values())

for k, v in c.items():
    if v == max_count:
        ans.append(k)
ans.sort()
print('\￿n'.join(ans))
from collections import Counter
n = int(input())
lst = [input() for i in range(n)]
c = Counter(lst)
c2 = c.most_common()
m = c2[0][1]
ans = [i[0] for i in c2 if i[1] == m]
print('\n'.join(sorted(ans, key=lambda x:x[0])))
N = int(input())
l = []

for _ in range(N):
    s = str(input())
    l.append(s)

import collections
c = collections.Counter(l)
c = c.most_common()
c.sort()
most_count = c[0][1]
for i in range(len(c)):
    if c[i][1] == most_count:
        print(c[i][0])
from collections import Counter

n = int(input())
s = [input() for _ in range(n)]

counter = Counter(s)
index = 0
ans = []
for k, v in counter.most_common():
    if index == 0:
        max_v = v
        ans.append(k)
    else:
        if v == max_v:
            ans.append(k)
        else:
            exit()
    index += 1
ans = sorted(ans)
for i in range(len(ans)):
    print(ans[i])
import collections
n=int(input())
s=[]
for _ in range(n):
    s.append(str(input()))
ans=collections.Counter(s)
values,count=zip(*ans.items())
for l in range(len(count)):
    if max(count)==count[l]:
        print(values[l])
from collections import Counter


N = int(input())
S = Counter(sorted([input() for _ in range(N)]))
max_app = max(S.values())
for k, v in S.items():
    if v == max_app:
        print(k)
n = int(input())
a = [input() for _ in range(n)]
a_dict = {i:0 for i in set(a)}

for i in a:
    for j in a_dict:
        if i == j:
            a_dict[j] += 1

ans = []
for key, value in a_dict.items():
    if value == max(a_dict.values()):
        ans.append(key)
ans.sort()
print(ans)
import collections

count = input()

l = []
for i in range(int(count)):
    l.append(input())
c = collections.Counter(l)
#print(l)
#print(c)
#print(c.most_common()[0][1])
max_count = c.most_common()[0][1]
for i in c.most_common():
    if i[1] != max_count:
        exit()
    print(i[0])
from collections import Counter
def main():
    a=int(input())
    tmp=0
    x = [input() for _ in range(a)]
    x.sort()
    count=Counter(x)
    for i in count.most_common():
        if tmp <= i[1]:
            print(i[0])
            tmp=i[1]
        else:
            break

main()
import collections
N=int(input())
S=[]
for i in range(N):
  s=str(input())
  S +=[s]
T=collections.Counter(S)
P=list(T.keys())
Q=list(T.values())
for i in range(len(P)):
  if Q[i]==max(Q):
    print(P[i])
#coding:utf-8

n = int(input())

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

max_key = max(dic)
max_v = dic[max_key]
li = []
for key in dic:
    if max_v == dic[key]:
        li.append(key)
        
li.sort()
for v in li:
    print(v)
n = int(input())
si = []
for i in range(n):
    si.append(input())

wkmax = wk = m = 0
c = []
b = list(set(si))
m = len(b)

for i in range(m):
    wk = si.count(b[i])
    if wkmax <= wk:
        wkmax = wk
    c.append([b[i],wk])

for i in range(len(c)):
    if c[i][1] == wkmax:
        print(c[i][0])
n=int(input())
l=[input() for i in range(n)]
from collections import Counter as co
k=co(l).most_common()
d=k[0][1]
for a,s in k:
  if s!=d:break
  else:
      print(a)
N = int(input())
lists = []
for n in range(N):
    s = input()
    lists.append(s)
from collections import Counter
counter = Counter(lists)
#print(counter)
anslist = sorted(counter.items(), key = lambda x:x[1])
anslist.reverse()
#print(anslist)
num = anslist[0][1]
len = len(anslist)
#print(num)
for n in range(len):
    if anslist[n][1] == num:
        print(anslist[n][0])
    else:
        pass
import collections
n = int(input())
l = []

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

l.sort()

c = collections.Counter(l)

print(c.most_common()[0][0])

for i in range(1, len(c)):
    if c.most_common()[0][1] == c.most_common()[i][1]:
        print(c.most_common()[i][0])
    else:
        break
from collections import Counter

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

s.sort()
cnt = Counter(s).most_common()

print(cnt[0][0])
if len(cnt) > 1:
    for i in range(1, n):
        if cnt[i-1][1] == cnt[i][1]:
            print(cnt[i][0])
        else:
            break
def main():
    N = int(input())
    S = []
    c = {}
    for i in range(N):
        S.append(input())
    S = sorted(S)
    for i in range(N):
        s = S[i]
        c[s] = c[s] + 1 if (s in c)  else 1
    m = max(list(c.values()))
    for s in c.keys():
        if c[s] == m:
            print(s)

if __name__ == "__main__":
    main()
from collections import Counter
n = int(input())
s = [input() for _ in range(n)]
s.sort()
s_cnt = Counter(s)
max_cnt = s_cnt.most_common()[0][1]
s_cnt_common = s_cnt.most_common()
for i in range(len(s_cnt_common)):
    if s_cnt_common[i][1] == max_cnt:
        print(s_cnt_common[i][0])
N = int(input())
S = []
for n in range(N):
    S.append(input())
dic = {}


for n in range(N):
    if S[n] not in dic:
        dic[S[n]] = 1
    else:
        dic[S[n]] += 1

max = max(dic.values())

for key,val in dic.items():
    if val == max:
        print(key)
import math
import sys
import collections
import bisect
readline = sys.stdin.readline


def main():
    n = int(readline().rstrip())
    S = [readline().rstrip() for _ in range(n)]
    c = collections.Counter(S)
    maxS = c.most_common()[0][1]
    for i in range(len(c)):
        if c.most_common()[i][1] == maxS:
            print(c.most_common()[i][0])


if __name__ == '__main__':
    main()
N = int(input())
S_list = []
for i in range(N):
  S_list.append(input())
 
sorted(S_list)
name_list = []
vote_list = []
i, j = 0, 0
while i < len(S_list):
  name = S_list[i]
  while j < len(S_list) and S_list[j] == name:
    j += 1
  name_list.append(name)
  vote_list.append(j - i)
  i = j
max_vote = max(vote_list)
for k in range(len(name_list)):
  if vote_list[k] == max_vote:
    print (name_list[k])
N = int(input())
S = []
for i in range(N):
    S.append(input())
S.sort()
T = {S[0]:1}
for j in range(1,N):
    if S[j] not in T:
        T[S[j]] = 1
    else:
        T[S[j]] += 1
T_sorted = sorted(T.items(),key = lambda x:-x[1])
maxT = T_sorted[0][1]
print(T_sorted)
for k in range(len(T_sorted)):
    if T_sorted[k][1] != maxT:
        break
    print(T_sorted[k][0])
import collections
strlist = []
N = int(input())
for i in range(N):
    strlist.append(str(input()))
c = collections.Counter(strlist)
p = max(c.values())
for i in c.most_common():
    if i[1] == p:
        print(i[0])
n = int(input())
dic = {}

for i in range(n):
  temp = input()
  try:
    dic[temp] += 1
  except:
    dic[temp] = 0

dic = dict(sorted(dic.items(), key=lambda x: x[0]))

for i in dic.keys():
  print(i)
from collections import Counter
n = int(input())
l = []
for i in range(n):
  l.append(input())

d = Counter(l)
m = d.most_common()[0][1]
#print(m)
ans = []
for k, v in d.most_common():
  if v != m:
    break
  ans.append(k)

print("\n".join(ans[::-1]))
N = int(input())
cnt_list = {}
for i in range(N):
  S = input()
  if S in cnt_list:
    cnt_list[S] += 1
  else:
    cnt_list[S] = 0

max_cnt = max(cnt_list.values())
res_list = []

for a in cnt_list.items():
  if a[1] == max_cnt:
    res_list.append(a[0])

res_list.sort()
print(res_list)
import collections

n = int(input())
s = [input() for _ in range(n)]

c = collections.Counter(s)

b, most = c.most_common(1)[0]

for i,j in c.most_common():
  if j != most:
    break
  print(i)
N = int(input())

S = [None] * N

m = dict()

for i in range(N):
  s = input()
  if not s in m.keys():
    m[s] = 1
  else:
    m[s] += 1

max_cnt = max(m.values())

ret = []

for k, v in sorted(m.items(), key=lambda x: x[1], reverse=True):
  if v < max_cnt:
    break
  ret.append(k)

ret.sort()
print(ret)
import collections
n = int(input())
l =[]
for i in range(n):
    t = input()
    l.append(t)
d = collections.Counter(l)
m = max(d.values())
for k,v in d.items():
    if v == m:
        print(k)
import collections
n=int(input())
s=[input() for k in range(n)]
s1=[k for k in list(sorted(set(s))) if s.count(k)>1]
c=collections.Counter(s)
p=[]
for i in s1:
    p.append(c[i])
for j, x in enumerate(p):
    if(x == max(p)):
        print(s1[j])
n = int(input())
info = []
for i in range(n):
    info.append(input())

info.sort()

ans = []
record = 1
tem_record = 1
for i in range(n-1):
    if info[i] == info[i+1]:
        tem_record += 1
        if tem_record == record:
            ans.append(info[i])
    else:
        if tem_record > record:
            record = tem_record
            ans = [info[i]]
        tem_record = 1

if record == 1 and  info[n-1] != info[n-2]:
    ans.append(info[n-1])


ans.sort()
for i in ans:
    print(i)
import collections as c

n = int(input())
l = [input() for _ in range(n)]
c = c.Counter(l)
c = c.most_common()
for i in c:
  if i[1] == c[0][1]: 
    print(i[0])
n = int(input())

words = {}

for i in range(n):
    key = input()
    if key not in words:
        words[key] = 0
    words[key] += 1

ans = sorted(words.items(), key=lambda x:x[1])[::-1]

for i in ans:
    if ans[0][1] == i[1]:
        print(i[0])
    else:
        break
N = input()
S=[]
for i in range(int(N)):
    S.append(input())

ls=[]
for i in S:
    if i not in ls:
        ls.append(i)
str_ls =[]
num_ls = []
flag = 0

for i in ls:
    num_ls.append(S.count(i))
    str_ls.append(i)

for i in range(len(str_ls)):
    if num_ls[i] == max(num_ls):
        print(str_ls[i])
import collections

n = int(input())
s_list=[input() for i in range(n)]

s_dict=collections.Counter(s_list)
    
ans = [kv[0] for kv in s_dict.items() if kv[1] == max(s_dict.values())]
print(*ans, sep='\n')
from collections import Counter
import numpy as np
N = int(input())
S = [input() for _ in range(N)]
c = Counter(S)
candidate = np.array(list(c.keys()))[np.array(list(c.values())) == max(c.values())]
for i in range(len(candidate)):
  print(candidate[i])
n=int(input())
S=[]
for i in range(n):
    S.append(input())
S=sorted(S)
from collections import defaultdict
d = defaultdict(int)

for k in S:
    d[k]+=1

d=dict(d)
dmax=max(d)
ansn=d[dmax]
ans=[]
for i in d.keys():
    if d[i]==ansn:
        ans.append(i)

ans.sort()
for i in range(len(ans)):
    print(ans[i])
n=int(input())
s=sorted([input() for k in range(n)])
s3 = sorted(list(set(s)))
if(len(set(s))==len(s)):
    for u in range(len(s)):
        print(s[u])
    exit()
else:
    s1=s2 = [m for m in s3 if s.count(m)>1]
    i = (len(s)-len(s1))//2
    while(len(s2)!=0):
        s2 = [m for m in s3 if s.count(m)>i]
        if(len(s2)==0):
               break
        s1 = s2
        i+=1
for j in s1:
    print(j)
from collections import Counter
n = int(input())

l = [input() for i in range(n)]
l.sort()
c = Counter(l)

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

for k, v in c.most_common():
    if v == max:
        print(k)
    else:
        exit()
import collections

count = input()

l = []
ans = []
for i in range(int(count)):
    l.append(input())
c = collections.Counter(l)
#print(l)
#print(c)
#print(c.most_common()[0][1])
print("--")
max_count = c.most_common()[0][1]
for i in c.most_common():
    if i[1] != max_count:
        exit()
    #print(i[0])
    ans.append(i[0])
ans.sort()
for i in ans:
    print(i)
N=int(input())
listS=[]
for i in range(N):
  S=input()
  listS+=[S]
listS.sort()
counter=[]
count=1
for i in range(N-1):
  if listS[i]==listS[i+1]:
    count+=1
    if count==N:
      counter+=[count]
  else:
    counter+=[count]
    count=1
    
MAX=max(counter)
count=1

for i in range(N-1):
  if listS[i]==listS[i+1]:
    count+=1
    if count==MAX:
      print(listS[i+1])
  else:
    counter+=[count]
    count=1
n = int(input())
s = [input() for _ in range(n)]

ans = {}
for si in s:
    if si in ans:
        ans[si] += 1
    else:
        ans[si] = 0

max_cnt = ans[max(ans)]


ans = [t for t in ans.keys() if ans[t] == max_cnt]
for t in sorted(ans):
    print(t)
def main():
  n = int(input())
  dict = {}
  for i in range(n):
    s = input()
    dict.setdefault(s, 0)
    dict[s] += 1
  max_val = 0
  ans_ls = []
  for kv in dict.items():
    if kv[1] > max_val:
      max_val = kv[1]
      ans_ls = [kv[0]]    
    elif kv[1] == max_val:
      ans_ls.append(kv[0])


if __name__ == '__main__':
  main()
N=int(input())

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

ds={}  
for a in S:
  if a in ds:
    ds[a] +=1
  else:
    ds[a] =1
    
m = max(ds.values())

keys = [k for k,v in ds.items() if v == m]
print(keys)
n = int(input())
s = []
for i in range(n):
    s.append(input())


numbers = dict()
maxval = 1
for val in s:
    if val in numbers:
        if maxval == numbers[val]:
            maxval = maxval + 1
        numbers[val] += 1
    else:
        numbers[val] = 1

[print(kv[0]) for kv in numbers.items() if kv[1] == maxval]
from collections import Counter

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

s = Counter(S)
print(s)
max_cnt = s.most_common()[0][1]
names = [name for name, cnt in s.items() if cnt == max_cnt]
names.sort()

print("\n".join(names))
from collections import Counter
n = int(input())
S = []
for _ in range(n):
    s = input()
    S.append(s)
cnt = Counter(S)
l = max(cnt.values())

ans = []
for k,v in cnt.items():
  if v == l:
    ans.append(k)
print(ans)
ans.sort()
for i in ans:
  print(i)
from collections import defaultdict

n = int(input())
dict1 = defaultdict(int)

for i in range(n):
    s = str(input())
    dict1[s] += 1
dict1 = dict(sorted(dict1.items()))
dict1 = sorted(dict1.items(), key=lambda x:x[1], reverse=True)
max = dict1[0][1]

for i in range(len(dict1)):
    if dict1[i][1] == max:
        print(dict1[i][0])
    else:
        break
import collections
S = []
N = int(input())
for i in range(N):
    s = input()
    S.append(s)
S = sorted(S)
#print(S)
c = collections.Counter(S)
#print(c)
j = 0

while c.most_common()[j][1]==c.most_common()[0][1] and j<len(collections.Counter(S)):
    if j==len(collections.Counter(S))-1:
        print(c.most_common()[j][0])
        break
    print(c.most_common()[j][0])
    j+=1
N = int(input())

S=[str(input()) for i in  range(N)]
S=[x for x in set(S) if S.count(x)>=1]
S.sort()
for i in range(len(S)):
    print(S[i])
import collections
import itertools

a = int(input())

s = [input() for i in range(a)]

counter = collections.Counter(s)

mode_v = counter.most_common()[0][-1]
it = itertools.takewhile(
    lambda kv: kv[-1] == mode_v, counter.most_common()
)

l = []

for k, v in it:
  l.append(k)

print(sorted(l))
from collections import Counter
n = int(input())
lst = [input() for i in range(n)]
print(dict(Counter(lst)))
n = int(input())
b = {}
for i in range(n):
    temp = input()
    if temp not in b:
        b[temp] = 1
    else:
        b[temp] += 1

list1 = sorted(b.items(), key=lambda x: x[1])

a = len(list1)-1
temp = len(list1)-1
list2 = []
while a > 0 and list1[temp][1] == list1[a][1]:
    list2.append(list1[a][0])
    a -= 1
list2.sort()

for a in list2:
    print(a)
from sys import stdin

n = int(stdin.readline().rstrip())

words = [stdin.readline().rstrip() for _ in range(n)]

words_s = sorted(list(set(words)))

count = {}

for i in words_s:
    count[i] = words.count(i)

maxIndex = [i for i, x in enumerate(
    count.values()) if x == max(count.values())]

for i in maxIndex:
    print(list(count.keys())[i])
N = int(input())
lst = []
for i in range(N):
  lst.append(input())
count_dict = {}
for v1 in lst[:-1]:
  count_dict[v1] = 1
  for v2 in lst[lst.index(v1)+1:]:
    if v1 == v2:
      count_dict[v1] += 1
max_count = 1
for key, value in count_dict.items():
  if count_dict[key] > max_count:
    max_key = key
    max_count = count_dict[key]
max_keys = []
for key in count_dict.keys():
  if count_dict[key]  == max_count:
    max_keys.append(key)
for v in sorted(max_keys):
  print(v)
import collections

n = int(input())

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

c = collections.Counter(ss)

l = c.most_common()

print(l[0][0])
for i in range(len(l)-1):
  if l[i][1] == l[i+1][1]:
    print(l[i+1][0])
  else:
    break
n = int(input())
ans = {}
li = []
for _ in range(n):
    li.append(input())

ma = 0

for i in li:
    if i in ans:
        ans[i] += 1
        if ma < ans[i]:
            ma = ans[i]
    else:
        ans[i] = 1

ans = [i for i, j in ans.items() if j==ma]
ans.sort()
for i in ans:
    print(i)
from collections import Counter
N = int(input())
S = [input() for _ in range(N)]
CS = Counter(S)
v = 0
ans = []
for i  in CS.values():
  v = max(v,i)
for j,k in CS.items():
  if v == k:
    ans.append(j)
ans.sort()
print(ans)
import collections
N = int(input())
S = [str(input()) for _ in range(N)]

c = collections.Counter(sorted(S))
keys = [k for k, v in c.items() if v == c.most_common()[0][1]]

for i in range(len(keys)):
    print(keys[i])
import sys
from collections import Counter
input=sys.stdin.readline
N=int(input())
d=Counter(list(input()[:-1] for _ in range(N)))
d1=dict(sorted(d.items(), key=lambda x:x[1],reverse=True))

L=[]
for k, v in d1.items():
 if v == max(d1.values()):
  L.append(k)
 else:break

L.sort()
for i in L:
 print(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]
print(ki)
for k, v in d[1:]:
    if v == vi:
        print(k)
    else:
        quit()
# C - Poll

N = int(input())
D = {}
for _ in range(N):
    s = str(input())
    if s not in D:
        D[s] = 0
    D[s] += 1

ans = []
mx = D[max(D)]
for d in D:
    if D[d] == mx:
        ans.append(d)

for a in sorted(ans):
    print(a)
from collections import defaultdict
import collections
N=int(input())
ss = []
for i in range(N):
  ss.append(input())
#d = defaultdict(lambda: 0)
c = collections.Counter(ss)
d_=c.most_common()
d_.sort()
#print(d_)
mx = d_[0][1]
m=len(d_)
for i in range(m):
  if d_[i][1] == mx:
    print(d_[i][0])
  else:
    break
#155c
import collections
n = int(input())
s = [input() for _ in range(n)]

c = collections.Counter(s)
ret = []
tmp = []
current_v = 0

for k, v in c.most_common():
  if current_v != v:
    current_v = v
    if tmp != []:
      ret.extend(sorted(tmp))
      break
  tmp.append(k)

for r in ret:
  print(r)
N = int(input())
S = list(input() for i in range(N))  #スペース抜きの単語を複数行
S = sorted(S)

import collections
A = collections.Counter(S)

max_k_list = [kv[0] for kv in A.items() if kv[1] == max(A.values())]
print(max_k_list)
n = int(input())
num_list = []
for i in range(n):
    num_list.append(input())

from collections import Counter
checked =  Counter(num_list)
before_count = 0
check_count = 0

for keyword, count in sorted(checked.items(), key=lambda x: -x[1]):
    # print(keyword, count)
    if check_count == 0:
        check_count += 1
        print(keyword)
        before_count = count
    else:
        if count != before_count:
            exit()
        else:
            check_count += 1
            print(keyword)
            before_count = count
n = int(input())

dic = {}
ma = 1

for i in range(n):
    wo = input()
    if(wo in dic):
        dic[wo] += 1
        if(dic[wo] > ma):
            ma = dic[wo]
    else:
        dic.update({wo:1})

print(dic)

for i in dic.keys():
    if(dic[i] == ma):
        print(i)
n = int(input())
d = dict()
S = list()
ans = list()
for _ in range(n):
    s = input()
    S.append(s)
    d[s] = 0
for s in S:
    if s in d:
        d[s] += 1
d = sorted(d.items(),key = lambda x:x[1], reverse = True)
max = d[0][1]
for word in d:
    if word[1] == max:
        ans.append(word[0])
    else:
        break
ans.sort()
print(ans)
from collections import Counter
n = int(input())
s = [input() for _ in range(n)]
s.sort()
maxcnt = 0
counter = Counter(s)
for word, cnt in counter.most_common(1):
	maxcnt = cnt
for word, cnt in counter.most_common():
	if maxcnt == cnt:
		print (word)
import sys


def input():
    return sys.stdin.readline()[:-1]


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

S_dict = dict(zip(S, NUM))
for s in S:
	S_dict[s] += 1

S_dict1 = dict(sorted(S_dict.items(), key=lambda x:x[0]))
S_dict2 = dict(sorted(S_dict1.items(), key=lambda x:x[1], reverse=True))
max_ = max(S_dict.values())

for i, j in S_dict2.items():
	if j == max_:
		print(i)
import collections
 
N = int(input())
l = [input() for _ in range(N)]
 
c = collections.Counter(l)
 
L = c.most_common()
 
values, counts = zip(*c.most_common())
 
A = list(values)
B = list(counts)
 
b = B.count(B[0])
 
a = A[0:b + 1]
 
for i in a[0:]:
		print(i)
n = int(input())
s=[]
for i in range(n):
  s.append(input())
t=set(s)
d={}
for k in t:
  d[k] = s.count(k)
for g,j in d.items():
  if(j==max(d.values())):
    print(g)
import collections
N = int(input())
S_list = [input() for i in range(N)]
C = collections.Counter(S_list)
L = C.most_common()
max_ = L[0][1]
ans = []
#print("========")
for i in L:
    if i[1] == max_:
        ans.append(i[0])
    else:
        exit()
ans.sort()
for i in ans:
    print(i)
case = int(input())
l = [""] * case
for i in range(case):
  l[i] = input()

for str in sorted(set(l)):
  print(str)
from collections import Counter
 
n=int(input())
s = [input() for _ in range(n)]
 
c=[i for i,j in Counter(s).items() if j == max(Counter(s).values())]
 
for k in c:
	print(k)
import collections


N = int(input())
S = [input() for _ in range(N)]
S.sort()
c = collections.Counter(S)

values, counts = zip(*c.most_common())


if len(values) == 1:
    print(values[0])
    exit()
for i in range(N):
    if counts[i] == counts[0]:
        print(values[i])
    else:
        exit()
import collections
n = int(input())
s = [input() for _ in range(n)]
word = collections.Counter(s)
word = word.most_common()
max_num = word[0][1]
word.sort()
for i in range(len(word)):
    if word[i][1] == max_num:
        print(word[i][0])
    else:
        exit()
n = int(input())
l = [input() for i in range(n)]
an = list(set(l))
alm = []
for i in range(len(an)):
    alm.append(l.count(an[i]))
    
ans = max(alm)

for i in range(len(an)):
    if alm[i] == ans:
        print(an[i])
import collections
N = int(input())
S = {}
for i in range(N):
    value = input()
    if value not in S:
        S[value] = 1
    else:
        S[value] += 1
S_largest = max(S.values())
S_sorted = sorted(S.items(),reverse=True)
print(S_sorted)
ans = []
for i in range(len(S_sorted)):
    if S_sorted[i][1] == S_largest:
        ans.append(S_sorted[i][0])
    else:
        break
ans_sorted = sorted(ans)
for a in ans_sorted:
    print(a)
from collections import defaultdict
n=int(input())
dic=defaultdict(int)
for _ in range(n):
    s = input()
    dic[s]+=1
L=list(dic.items())
L.sort(key=lambda x:-x[1])
c = L[0][1]
for p in L:
    if p[1] == c:
        print(p[0])
    else:
        break