peterverebics/CodeNet_Python_118 huggingface dataset:
from collections import Counter

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

S.sort() #l = sorted(S)と同義 *Sは変化させたくないときはsorted使う◎
counted = Counter(S)
l = counted.most_common()
m = l[0][1]
l.sort()
for i in l:
    if m == i[1]:
        print(i[0])
    else:
        break
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())

for i in range(len(s_list_keys)):
    if s_list_values[i] == max_count:
        print(s_list_keys[i])
    else:
        sys.exit()
n = input()
n = int(n)
s = []

max_s = 0
m_str = []
for i in range(n):
	temp = input()
	s.append(temp)
	temp = s.count(s[i])
	#print(temp,s[i],m_str)
	if temp > max_s :
		#print("if")
		max_s = temp
		m_str = []
		m_str.append(s[i])
	elif temp == max_s :
		#print("elif")
		if not s[i] in m_str:
			#print("if not")
			m_str.append(s[i])
score = {}
for i in m_str: score[i] = 1
#print(score)
print("===============")
score_sorted = sorted(score.items(),key=lambda x:x[0])
for ans in score_sorted:
	print(ans[0])
n = int(input())

lis = []

for _ in range(n):
    lis.append(input())

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

for e in lis:
    dic[e] += 1

max_list = [e[0] for e in dic.items() if e[1] == max(dic.values())]
for i in reversed(max_list):
    print(i)
from collections import Counter
N = int(input())
S = Counter(input() for _ in range(N))
m = max(S.values())
for v in sorted(s for k, v in S.items() if k == m):
	print(v)
import collections

N = int(input())
S = [input() for i in range(N)]
S = sorted(S)
c =collections.Counter(S)
C = c.most_common()
list_C = []
for i in range(len(c)):
    list_C.append(C[i][1])
m = 1
for i in range(len(list_C)-1):
    if list_C[i]==list_C[i+1]:
        m += 1
    else:
        break
ans = []
for i in range(m):
    print(C[i][0])
N = int(input())

A=[]
B=[]
saidai = 0
for i in range(N):
    x = input()
    A.append(x)
    y = A.count(x)
    B.append([x, y])
    saidai = max(y, saidai)
B.sort() 
print(B)
for i in range(N):
    if B[i][1] == saidai:
        print(B[i][0])
n = int(input())
dict = {}
mx = 0
for i in range(n):
    s = input()
    if s not in dict:
        dict[s] = 0
    dict[s] += 1
    mx = max(mx, dict[s])
print(dict)
print(mx)
ans = []
for s in dict:
    if dict[s] == mx:
        ans.append(s)
ans.sort()
for s in ans:
    print(s)
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=sorted(ans)
for i in range(len(ans)):
    print(ans[i])
import collections

N=int(input())
S=[]
for i in range(N):
	S.append(input())
K=sorted(S)
M=collections.Counter(K)
A=max(M.values())
for i,j in M.items():
	if j==A:
		print(i)
n=int(input())
di=dict()
for i in range(n):
	s = input()
	if s in di.keys():
		di[s]+= 1
	else:
		di[s]=1
di = sorted(di.items(),reverse = True,key = lambda h:h[1])
ans=di[0][0]
print(''.join(sorted(ans)))
def main():
    n = int(input())
    S = sorted([input() for s in range(n)])
    D = list(set(S))
    count = []
    for i in range(len(D)):
        count.append(S.count(D[i]))
    maxi = max(count)
    for i in range(len(D)):
        if(count[i]==maxi):
            print(D[i])
main()
# input
N = int( input() )
S = list()
for ii in range(N):
    S.append( input() )
S.sort()

# calc 
import collections
C     = collections.Counter( S )

# output      
for key in C.most_common():
    print(key[0])
n = int(input())
info = []
for i in range(n):
    info.append(input())

info.sort()

ans = [info[0]]
record = 1
tem_record = 1
for i in range(n-1):
    if info[i] == info[i+1]:
        tem_record += 1
    else:
        if tem_record > record:
            record = tem_record
            ans = [info[i]]
        elif tem_record == record:
            ans.append(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)
n = int(input())
word = [input() for i in range(n)]
test = list([x,0] for x in set(word))
sen = []

for i, num in enumerate(test):
  test[i][1] = word.count(num[0])

num = int(max(test, key=lambda x: x[1])[1])

for i, num in enumerate(test):
  if(int(num[1]) == num):
    sen.append(num[0])

print('\n'.join(sorted(sen)))
N = int(input())
D = {}

for i in range(N):
  S = input()
  if S not in D:
    D[S] = 1
  else:
    D[S] += 1
    
E = [k for k, v in D.items() if v == max(D.values())]
print(sorted(E))
n = int(input())
s = list(input() for _ in range(n))
s.sort()
now = s[0]
ans = [s[0],]
cnt = 0
m_cnt = 0

for i in range(n):
    word = s[i]
    if word == now:
        cnt +=1
        if cnt > m_cnt:
            ans = [word,]
            m_cnt = cnt
        elif cnt == m_cnt:
            ans.append(word)
    else:
        cnt = 1
        now = word

for k in sorted(ans):
    print(k)
n=int(input())
a={}
for _ in range(n):
  m=input()
  if m in a:
    a[m]+=1
  else:
    a[m]=1
for k in a.items() :
     if k[1] == max(a.values()):
      print(k[0])
import itertools
from collections import Counter

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

a = sorted(a)
#print(a)


counter = Counter(a)

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

for k, v in it:
	print(k)
n=(int)(input())
dic={}
max_num=0
for i in range(n):
  get_str=input()
  max_num=0
  if not get_str in dic:
    dic[get_str]=1
  else:
    dic[get_str]+=1
  if dic[get_str]>max_num:
    max_num=dic[get_str]
  
  
for i in dic:
  if dic[i]==max_num:
    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]
 
for i in a[0:]:
		print(i)
import sys


def main():
    readline = sys.stdin.readline
    N = int(readline())
    li = list(readline().split("\n"))
    se = set(li)
    l = len(se)
    li2 = [None] * l
    for i, s in enumerate(se):
        li2[i] = [s, li.count(s)]
    li2.sort(key=lambda x:x[1])
    maxcount = li2[l - 1][1]
    li3 = [j[0] for j in li2 if j[1] == maxcount]
    li3.sort()
    for k in li3:
        print(k)


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

Di={"":0}

for i in range(N):
    poll=str(input())
    
    if poll in Di.keys():
        Di[poll] += 1
    else:
        Di[poll] = 1

maxvalue=0
maxkey=[]

for k in Di.keys():

    if Di[k] > maxvalue:
        maxvalue=Di[k]
        maxkey=[]
        maxkey.append(k)
    elif Di[k] == maxvalue:
        maxkey.append(k)

for m in maxkey:
    print(m)
from collections import Counter

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

c = Counter(ss)

print(c)
max_count = max(c.values())
for k, v in c.items():
  if v == max_count:
    print(k)
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])
import collections

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

c_sort = collections.Counter(s).most_common()
list_most = [c_sort[i][0] for i in range(len(c_sort)) if c_sort[i][1] == c_sort[0][1]]
for i in list_most:
    print(i)
def my_index(l, x, default=False):
    return l.index(x) if x in l else default
      
n=int(input())
lk = [0]*n
k=0
ls = []
for i in range(n):
  s = str(input())
  dup = my_index(ls, s, -1)
  if dup == -1:
    ls.append(s)
    lk[k] += 1    
    k += 1
  else:
    lk[dup] += 1

lk_max = [i for i, x in enumerate(lk) if x == max(lk)]

ls_max=[]
for i in range(len(lk_max)):
  ls_max.append(ls[lk_max[i]])

print(sorted(ls_max))
N = int(input())
ans = {}
for i in range(N):
	cood = input()
	if  cood not in ans:
		ans[cood] = 1
	else:
		ans[cood] += 1
max_k_list = [kv[0] for kv in ans.items() if kv[1] == max(ans.values())]
for i in range(len(max_k_list)):
	print(max_k_list[i])
n = int(input())
s = {}

for i in range(n):
    ss = input()

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

s2 = sorted(s.items(), key=lambda x:x[1])

s2.reverse()

max_value = s2[0][1]

for sss in s2:
    if sss[1] == max_value:
        print(sss[0])
    else:
        break
from collections import Counter
n = int(input())
s = sorted([input() for i in range(n)])

counter = Counter(s)
max_num = max(counter.values())
for i in counter:
    if counter[i] == max_num:
        print(i)
import collections
n = int(input())
s = [input() for _ in range(n)]
c = collections.Counter(s)
c = c.most_common()
base = c[0][1]
for i in range(len(c)):
    if (c[i][1]==base):
        print(c[i][0])
    else:
        exit()
from collections import Counter

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

S.sort()
C = Counter(S)
number = (C.most_common()[0][1])

for i in range(len(C)):
	if C.most_common()[i][1] == number:
		print(C.most_common()[i][0])
	else:
		break
from collections import defaultdict
N = int(input())
word_count = defaultdict(int)
for _ in range(N): 
    word_count[input()] += 1
max_amount = sorted(word_count.items(), reverse=True)[0][1]
max_amount_words = sorted([k for k, v in word_count.items() if v == max_amount])
print('\n'.join(max_amount_words))
n = int(input())
dic = {}
for _ in range(n):
    s = input()
    if s not in dic:
        dic[s] = 1
    else:
        dic[s] += 1
m = max(dic.values())
anslis = []
for k, v in dic.items():
    if v == m:
        anslis.append(k)
print('/n'.join(anslis))
import collections
n = int(input())
s=[]
for i in range(0,n):
    s.append(input())
#print(n,s)

c = collections.Counter(s)

d=[]
for i in range(0,len(set(s))):
    d.append(c.most_common()[i][1])
#print(d)

d_len=[]
for i in range(0,len(d)):
    if d[0]==d[i]:
        d_len.append(d[i])
#print(d_len)

e=[]
for i in range(0,len(set(s))):
    e.append(c.most_common()[i][0])
#print(e)

for i in range(0,len(d_len)):
    print(e[i])
import sys

N = int(sys.stdin.readline())
S = [None]*N
counter = {}
for i in range(N):
    tmp = input()
    if not tmp in counter:
        counter[tmp] = 0
    else:
        counter[tmp] += 1

counter_sorted = sorted(counter.items(), reverse = True)
tmp = counter_sorted[0][1]

output = []
L = len(counter)
for i in range(L):
    if tmp == counter_sorted[i][1]:
        output.append(counter_sorted[i][0])
    else:
        break

output = sorted(output)
for i in output:
    print(i)
N = int(input())
S = []

import collections

for n in range(N):
  S.append(input())

C = collections.Counter(S)
C = C.most_common()

c_max = C[0][1]

for i, c in enumerate(C):
  if c[1] == c_max:
    print(c[0])
  else:
    break
n = int(input())
s = list(input() for i in range(n))
ans = []
s.sort()
b = 0
for i in s:
    a = s.count(i)
    if a > b :
        ans.clear()
        ans.append(i)
    elif a == b:
        ans.append(i)
    b = a
ans = set(ans)
print(*ans, sep = "\n")
from collections import Counter

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
N = int(readline())
S = read().split()
S.sort()

res = []
c = Counter(S)
max_num = c.most_common(1)[0][1]
for i, j in list(c.items()):
    if j == max_num:
        res.append(i.decode())
        
print('\n'.join(res))
from collections import Counter

N = int(input())

S = [input() for _ in range(N)]

dic = Counter(S)

ans = [key for key, value in dic.items() if value == max(dic.values())]

print(sorted(ans))
N=int(input())
a=[]
for i in range(N):
  a.append(input())
b=list(set(a))
c=[]
for j in range(len(b)-1):
  if a.count(b[0])>a.count(b[1]):
    b.remove(b[1])
  elif a.count(b[0])==a.count(b[1]):
    c.append(b[0])
    b.remove(b[0])
  else:
    b.remove(b[0])
c.append(b[0])
d=[]
for l in range(len(c)):
  d.append(min(c))
  c.remove(d[l])
for m in d:
  print(m)
import collections

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

c = collections.Counter(s)
values, counts = zip(*c.most_common())

for i in range(counts.count(max(counts))):
	print(values[i])
N = int(input())
S = []
for i in range(N):
  S.append(str(input()))
m = max(S.count(S[i]), i in range(N))
S_new = set(S)
for s in S_new:
  if S.count(s) == m:
    print(s)
N = int(input())
S = [input() for i in range(N)]

import collections

c = collections.Counter(S)

#最頻値の個数
mx = c[max(c)]
#print(mx)


L = set()
for s in S:
    if c[s] == mx:
        L.add(s)

L = list(L)
L.sort()
for l in L:
    print(l)
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)
print(m, d)

for j in sorted(d):
    if d[j] == m:
        print(j)
import collections
N = int(input())
listA = []
listB = []
for i in range(N):
    listA.append(input())
c = collections.Counter(listA)
c = c.most_common()
max_number = c[0][1]
listB.append(c[0][0])
A = len(c)
for i in range(1,A-1):
    if max_number == c[i][1]:
        listB.append(str(c[i][0]))
    else:
        break
listB.sort()
for i in listB:
    print(i)
from collections import Counter

# input
N = int(input())
S = []
s_append = S.append

for i in range(N):
    s = input()
    s_append(s)

# check
s_counter = Counter(S)
max = max(s_counter.values())

printed_items = []
append = printed_items.append
max_s = [s[0] for s in s_counter.items() if s[1] == max]
for i in sorted([s for s in S if s in max_s]):
    print(i)
N=int(input())
A=[]
for i in range(N):
  A.append(str(input()))
A.sort()
B=list(set(A))
m=0
for j in range(len(B)):
  m=max(m,A.count(B[j]))
for k in range(len(B)):
  if A.count(B[k])==m:
    print(B[k])
from collections import Counter
N = int(input())
S  = []
for i in range(N):
  S.append(input())
cnt = Counter(S).most_common()
ans = []
for a,b in cnt:
  ans.append(a*(b==cnt[0][1]))
ans = sorted(ans)
print(ans)
N = int(input())
names = []
words = {}
for i in range(N):
    name = input()
    if name not in names:
        words[name] = 1
        names.append(name)
    elif name in names:
        words[name] += 1
        
max_name_list = []
for nm in words.items():
    if nm[1] == max(words.values()):
        max_name_list.append(nm[0])
max_name_list = sorted(max_name_list)
print('-')
for i in range(len(max_name_list)):
    print(max_name_list[i])
import collections as col
N=int(input())
counts=[]
A=[]
S=[]
T=[]
U=[]
for _ in range(N):
    S.append(input())
T=sorted(S)
s=col.Counter(T)
values, counts = zip(*s.most_common())

print(values[0])
t=1

while t<=(len(values)-1) and counts[t]==counts[t-1]:
    print(values[t])
    t+=1
import collections

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

c = collections.Counter(s)
c2 = c.most_common()
a = c2[0][1]
ans = []

for i in range(len(c)):
    ans.append(c2[i][0])

ans.sort()
print(*ans,sep="\n")
import collections

N = int(input())
S = [input() for val in range(N)]
S_c = collections.Counter(S)
values, counts = zip(*S_c.most_common())
cnt = 0
for val in counts:
    if val == max(counts):
        print(values[cnt])
        cnt += 1
    else:
        cnt += 1
from collections import Counter
N = int(input())
 
A=[]
for i in range(N):
    A.append(input())

B = Counter(A)

saidai = max(B.values())

C=[]
for i, j in B.items():
    if j == saidai:
        C.append(i)
C.sort()
print(*C, sep="")
import collections
N = int(input())
S = [input() for _ in range(N)]
c = collections.Counter(S)
m = max(c.values())
for k, v in c.items():
    if m == v:
        print(k)
N=int(input())
S=[]
c=[]
for i in range(N):
  tmp=input()
  if not (tmp in S):
    S.append(tmp)
    c.append(1)
  else:
    c[S.index(tmp)]+=1
m=max(c)
for i in range(len(S)):
  if c[i]==m:
    print(S[i])
n= int(input())
s = [input() for _  in range(n)]
compare = list(set(s))
ans1 = [s.count(i) for i in compare]
ans2 = [i for i,x in enumerate(ans1) if x == max(ans1)]
for i in ans2:
  print(compare[i])
N=int(input())
S=[input() for _ in range(N)]

from collections import Counter

cnt_s = Counter(S)

t = max(cnt_s.values())
kv=cnt_s.items()
for k,v in kv:
    if v==t:
        print(k)
import itertools
from collections import Counter

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

a = sorted(a)
#print(a)


counter = Counter(a)

mode_v = counter.most_common()[0][-1]

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

#sorted(it)

for k, v in it:
	print(k)
from collections import Counter

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

c = Counter(s)
c2 = c.most_common()
m = c2[0][1]#最大値
ans = [i[0] for i in c2 if i[1] == m]#回数が最大となるもの
print(*ans)
from collections import Counter
num = int(input())
value = [input() for i in range(num)]
print(type(value))
votes = Counter(value)
dict = {}

for value in votes.values():
    dict[value] = []

for (key, value) in votes.items():
    dict[value].append(key)
maxVote = sorted(dict.keys(), reverse=True)[0]
if len(dict[maxVote]) > 1:
    print(sorted(dict[maxVote])[0])
else:
    print(dict[maxVote][0])
n = int(input())
s = [input() for i in range(n)]
kesu = list(set(s))

num = []
num.append(s.count(kesu[0]))
max = []
max.append(0)
for i in range(1,len(kesu)):
    num.append(s.count(kesu[i]))
    if num[i - 1] < num[i]:
        max = []
        max.append(i)
    elif num[i - 1] == num[i]:
        max.append(i) 
       
for  i in range(len(max)):
    print(kesu[max[i]])
N = input()
S = list(map(str, input().split()))

box = []
S_box = []
last = []
sss = set(S)
an = []

for k in sss:
    S_box.append(k)

for i in range(0, len(sss)):
    box.append(S.count(S_box[i]))

num = max(box)

for a in range(0, len(box)):
    if num == box[a]:
        last.append(a)

for iii in last:
    an.append(S_box[iii])
an = sorted(an)
for aaa in an:
    print("\n")
    print(aaa)
n=int(input())
d=dict()
for i in range(n):
    s=input()
    if s not in d.keys():
        d[s]=-1
    else:
        d[s]-=1

a=sorted(d.items(),key=lambda x:x[0])
for k,v in a:
    if v!=a[0][1]:
        break
    print(k)
import collections

n = int(input())
s = [input() for i in range(n)]
c = collections.Counter(s)
m = c.most_common()

maxn = m[0][1]
ans = []

for i in range(len(m)-1):
    if m[i][1] == maxn:
        ans.append(m[i][0])
    else:
        break
for i in sorted(ans):
    print(i)
import collections as coll

N = int(input())
A = sorted([input() for _ in range(N)])
C = coll.Counter(A).most_common()
C = [k for k,v in C if v == C[0][1]]
print(*C, sep='\n')
n = int(input())
s= []

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

s.sort()
n =set(s)
n=list(n)

f = []

for i in range(len(n)):
    f.append([n[i],s.count(n[i])])

f.sort(reverse=True,key=lambda f:f[1])
max = f[0][1]
fl=[]
for i in range (len(f)):
    if f[i][1] == max:
        fl.append(f[i][0])
    else:
        break

fl.sort()
ans=(set(fl))
ansf=list(ans)

for i in range(len(ansf)):
    print(ansf[i])
from collections import defaultdict
from operator import itemgetter

N = int(input())
A = [input() for _ in range(N)]
d = defaultdict(int)
for a in A:
    d[a] += 1

li = sorted(d.items())
l = sorted(li, key = itemgetter(0), reverse=True)
max_v = l[0][1]

for k, v in li:
    if v == max_v:
        print(k)
    else:
        continue
import collections

N = int(input())
S = [input() for _ in range(N)]
c = collections.Counter(S)
c.most_common().sort()
values, counts = zip(*c.most_common())
if len(values) == 1:
    print(values[0])
else:
    for i in range(N):
        if counts[i] == counts[0]:
            print(values[i])
        else:
            exit()
N = int(input())
test = []
name = {}
num = []

## gather all word to test ##
for i in range(N):
  add = str(input())
  test.append(add)
#print(test)

## count appear time ## 
for i in test:
  if i in name:
    name[i] += 1
  if i not in name:
    name[i] =1
#print(name)

max_num =name[max(name)]
#print(max_num)

word = []
for i in name:
  if name[i] == max_num:
    word.append(i)

word.sort()
for i in word:
  print(i)
import collections

N = int(input())
S_lis = []

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

S_lis.sort()
S_dic = collections.Counter(S_lis)
m = S_dic.most_common()[0][1]

for i in range(len(S_dic)):
  if S_dic.most_common()[i][1] == m:
    print(S_dic.most_common()[i][0])
  else:
    break
import collections

N = int(input())
S = list(input() for i in range(N))
S.sort()

common = collections.Counter(S).most_common()
N_common = common[0][1]

for i in range(len(common)):
    if (common[i][1] == N_common):
        print(common[i][0])
n = int(input())
l = [str(input()) for i in range(n)]
l.sort()
i = 0
count = 1
ans = []
max = 1
while i < n-1:
  if l[i] == l[i+1]:
    count += 1
    i += 1
    if count >= max:
      max = count
    if i == n-1:
      ans.append([l[n-1], count])

  else:
      ans.append([l[i],count])
      count = 1
      i += 1

for i in ans:
  if i[1] == max:
    print(i[0])
from collections import Counter
n = int(input())
l=[input() for x in range(n)]
p=Counter(l)
l=sorted(l)
s=list(set(l))
s=sorted(s)
for i in range(len(s)):
    if l.count(s[i])==p[max(p)]:
        print(s[i])
n = int(input())
counts = {}
best = 0
best_words = []
for idx in range(n):
    string = input()
    if counts.get(string) is None: counts[string] = 1
    else: counts[string] += 1

    score = counts[string]

    if score > best:
        best = score
        best_words = [string]
    
    elif score == best:
        best_words.append(string)

for string in best_words:
    print(string)
N = int(input())
Ss = {}
for _ in range(N):
  s = input()
  if s in Ss:
    Ss[s] += 1
  else:
    Ss[s] = 1

max_value = max(Ss.values())  # maximum value
max_keys = [k for k, v in Ss.items() if v == max_value]
for k in max_keys:
  print(k)
N = int(input("in>"))

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

unique_str = list(set(all_str))

max_cnt = 0
str_num = dict()
for i in unique_str:
    cnt = all_str.count(i)
    str_num[i] = cnt
    if max_cnt < cnt:
        max_cnt = cnt

disp_list = []
for i in str_num:
    current_cnt = str_num[i]
    disp_list.append(i)

for i in disp_list:
    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])
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)
# C - Poll

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

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

for a in sorted(ans):
    print(a)
n=int(input())
s=[input() for i in range(n)]
s.sort()
se=list(set(s))
a=[]

for i in range(len(se)):
    a.append(s.count(se[i]))

for i in range(len(a)):
    if a[i]==max(a):
        print(se[i])
    else:
        continue
case = int(input())
l = [""] * case
for i in range(case):
  l[i] = input()

for str in set(l):
  print(str)
import collections
n=int(input())
s=[input() for i in range(n)]
c = collections.Counter(s)
#print(c.most_common())
for i in range(len(set(s))):
    if c.most_common()[i][1]==c.most_common()[0][1]:
        print(c.most_common()[i][0])
N = int(input())
S = [input() for _ in range(N)]
import collections
c = collections.Counter(S)
A = sorted(c.items(), key=lambda x: x[1], reverse=True)
count = 0
for a, b in A:
    if b >= count:
        print(a)
        count = b
    else:
        exit()
import collections
N=int(input())
L=[]
for i in range(N):
  L.append(input())
S=collections.Counter(L)
MS= max(S.values())
for k,v in S.items():
  if v==MS:
    print(k)
import collections
from collections import OrderedDict
 
N = int(input())
l = list(map(str,input().split()))
 
for i in range(len(l)):
    if type(l[i]) == int:
        del l[i]
    
c = collections.Counter(l)
 
A = OrderedDict(sorted(c.items(), key=lambda x:x[1],reverse=True))
B = list(A.items())
l2 = [B[0][0]]
 
for i in range(len(B)-1):
    if B[0][1] == B[i+1][1]:
        l2.append(B[i+1][0])

for i in range(len(l2)):
    print(l[i])