peterverebics/CodeNet_Python_118 huggingface dataset:
from collections import Counter

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

counter = Counter(S)
count = counter.most_common()
most = count[0][1]
c = []

for i in range(len(counter)):
    if count[i][1] == most:
        c.append(count[i][0])

c.sort()
print(*c, sep='\n')
from collections import Counter
N = int(input())
S = Counter([input() for i in range(N)])
k = max(S.values())
A = []
for s in S:
    if S[s]==k:
        A.append(s)
A.sort()
for a in A:print(a)
from collections import Counter
n = int(input())
s = [input() for i in range(n)]
c = Counter(s)
mc = c.most_common()
ans = [i[0] for i in mc if i[1] == mc[0][1]]
ans.sort()
for i in ans:
    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(max_s):
    print(i)
from collections import defaultdict
n = int(input())
s = [input() for _ in range(n)]
dd = defaultdict(int)

for x in s:
    dd[x] += 1
mx = max(dd.values())

for k in sorted(j for j,y in dd.items() if y == mx):
    print(k)
from collections import defaultdict

n = int(input())

s_dict = defaultdict(int)
for _ in range(n):
    s = input()
    s_dict[s] += 1

count_max = max(s_dict.values())
s_list = sorted([s for s, count in s_dict.items() if count == count_max])
print("\n".join(s_list))
num = int(input())

from collections import defaultdict
dic = defaultdict(int)

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

k = {}
k = [key for m in [max(dic.values())] for key,val in dic.items() if val == m]
k.sort()
for i in k:
  print(i)
import sys
from collections import Counter
N = int(input())
S = (str(x) for x in sys.stdin.read().split())
cnt = Counter(s for s in S)
max_cnt = max(cnt.values())
keys = [k for k, v in cnt.items() if v == max_cnt]
print("\n".join(sorted(keys)))
from collections import Counter

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

counter = Counter(S)
c_most = counter.most_common()

# a = {}
# for s in S_unique:
#     a[s] = S.count(s)

maxval = c_most[0][1]

anss = []

for s in c_most:
    if s[1] == maxval:
        anss.append(s[0])
    else:
        break

anss = sorted(anss)

for a in anss:
    print(a)
import collections
n = int(input())
s = []
for i in range(n):
    S = str(input())
    s.append(S)
c = collections.Counter(s)
jud = c.most_common()[0][1]
set_s = set(s)
lists = []
for i in set_s:
    if jud == int(c[i]):
        lists.append(i)
lists.sort()
for i in range(len(lists)):
    print(lists[i])
N=int(input())
DIC={}
for i in range(N):
    S=input()
    if S in DIC:
        DIC[S]+=1
    else:
        DIC[S]=1
largest=max(DIC.values())
ans=[]
for s in DIC:
    if DIC[s]==largest:
        ans.append(s)
    else:
        continue
ans.sort()
for t in ans:
    print(t)
n = int(input())
data_list = []
for _ in range(n):
    data_list.append(input(""))

data_list_a = set(data_list)
data_list_a = list(data_list_a)
m = len(data_list_a)

data_a = [0 for _ in range(m)]

data_dic = dict(zip(data_list_a, data_a))

for i in range(n):
    data_dic[data_list[i]] += 1

data_score = data_dic.values()
max_value = max(data_score)
ans = []


for i in range(m):
    if data_dic[data_list_a[i]] == max_value:
        ans.append(data_list_a[i])


ans.sort()

for i in range(len(ans)):
    print(ans[i])
import collections

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

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

max_val = counts[0]
ans = []
for i in range(len(counts)):
    if counts[i] == max_val:
        ans.append(values[i])
    else:
        break
        
ans.sort()
for a in ans:
    print(a)
import collections
n = int(input())
s = []
for i in range(n):
    s.append(input())
s = collections.Counter(s)
ans = []
k = list(s.most_common())
k_len = k[0][1]
for i in k:
    word, count = i
    if count == k_len:
        ans.append(word)
ans.sort()
for i in ans:
    print(i)
N = int(input())
S = [input() for _ in range(N)]

res = {}
for s in S:
    if s in res:
        res[s] += 1
    else:
        res[s] = 1
max_ = max(res.values())

ans = []
for k in res:
    if res[k] == max_:
        ans.append(k)
ans.sort()

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

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

L = Counter(S)
m = 0
for v in L.values():
    m = max(m, v)
ans = []
for k, v in L.items():
    if v == m:
        ans.append(k)
ans.sort()
print(*ans, sep="\n")
N = int(input())
l = {}
for _ in range(N):
  s = input()
  l.setdefault(s, 0)
  l[s] += 1
l = sorted([(v, k) for k, v in l.items()])
c = l[-1][0]
r = []
for i in range(-1, -len(l)-1, -1):
  if l[i][0] < c:
    break
  r.append(l[i][1])
for x in reversed(r):
  print(x)
n = int(input())

a = {}
l = []

for _ in range(n):
  s = input()
  
  if s not in a:
    a[s] = 1
  else:
    a[s] += 1

num = max(a.values())

for i in a:
  if a[i] == num:
    l.append(i)

l.sort()

for j in l:
  print(j)
# C - Poll

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

for a in sorted([d for d in D if D[d] == mx]):
    print(a)
from collections import Counter

N = int(input())
strings = Counter([input() for _ in range(N)])
lst = sorted(list(strings.items()), key=lambda x: (-x[1], x[0]))
num = lst[0][1]
for l in lst:
    if l[1] != num: break
    print(l[0])
n = int(input())
from collections import defaultdict
d=defaultdict(int)

max_cnt=-1
for _ in range(n):
    s=input()
    d[s]+=1
    max_cnt=max(max_cnt, d[s])


ans=sorted([k for (k,v) in d.items() if v==max_cnt])
    
for a in ans:
    print(a)
from collections import Counter
n = int(input())

s = [input() for i in range(n)]
c = Counter(s)
ans = []
cnt = 0
for k in sorted(c.keys()):
    if c[k] > cnt:
        ans = [k]
        cnt = c[k]
    elif c[k] == cnt:
        ans.append(k)
[print(i) for i in ans]
n = int(input())
s_count = {}

for c in range(n):
    s = input()
    if s not in s_count:
        s_count[s] = 0
    s_count[s] += 1

# print(s_count)

max_count = 0

for word, count in s_count.items():
    max_count = max(count, max_count)

# print(max_count)
res = []
for word, count in s_count.items():
    if count == max_count:
        res.append(word)
# print(word)
for word in sorted(res):
    print(word)
import collections
N = int(input())
S = {}
for i in range(N):
    si = input()
    if si in S:
        S[si] += 1
    else:
        S[si] = 1
#print(S)
m = max(S.values())
for i in sorted(S.items()):
    #print(sorted(S.items()))
    #print(S,i[0])
    if i[1] == m:
        print(i[0])
from collections import Counter
n = int(input())
s = [input() for _ in range(n)]

count = Counter(s)
t = max(count.values())
ans = []
for i in count.items():
  if i[1] == t:
    ans.append(i[0])
print(*sorted(ans), sep='\n')
import collections
n = int(input())
s_ = [input() for i in range(n)]

cnt = collections.Counter(s_)
cntList = list(cnt.most_common())
cnt_f = cnt.most_common()[0][1]

resList = []
for i in range(len(cntList)):
    if cntList[i][1] == cnt_f:
        resList.append(cntList[i][0])
    else:
        break

resList.sort()
for i in resList:
    print(i)
from collections import Counter
n = int(input())
s = Counter([input() for i in range(n)])
max_s = max(s.values()) 
print(*sorted([k for k, v in s.items() if v == max_s]), sep='\n')
import collections
N = int(input())
S = []
ans = []
for i in range(N):
  S.append(input())
d = collections.Counter(S)
ome = max(d.values())
for k, v in d.items():
  if v == ome:
    ans.append(k)
ans.sort()
for x in ans:
  print(x)
import collections

n=int(input())
list=[]
for i in range(n):
    s=input()
    list.append(s)
c=collections.Counter(list)
most=c.most_common()
i=0
ans=[most[0][0]]
flag=1
for i in range(len(most)-1):
    if most[i][1]==most[i+1][1]:
            ans.append(most[i+1][0])
    else:
        break
ans.sort()
for i in range(len(ans)):
    print(ans[i])
import collections

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

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

count = collections.Counter(s)

c = count.most_common()

max_num = 0
ans = []
for string,num in c:
	if max_num <= num:
		max_num = num
		ans.append(string)
	else:
		break
ans.sort()
for i in ans:
	print(i)
n = int(input())
s = []
count = [0] * n
count[0] = 1

for i in range(n):
    s_e = str(input())
    s.append(s_e)
s.sort()

last = s[0]
s_max = 1

for i in range(1, n):
    if last == s[i]:
        count[i] = count[i-1] + 1       
    else:
        s_max = max(s_max, count[i-1])
        last = s[i]
        count[i] = 1

s_max = max(s_max, count[n-1])

for i in range(n):
    if s_max == count[i]:
        print(s[i])
import collections

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

c=collections.Counter(l)
cc=c.most_common()
ccc=[]
for j in cc:
    if j[1]==cc[0][1]:
        ccc.append(j[0])

for k in sorted(ccc):
    print(k)
from collections import Counter

N = int(input())
Sn = [input() for _ in range(N)]

C = Counter(Sn)
most = C.most_common()
max = most[0][1]
ans = []
for i in most:
    if max == i[1]:
        ans.append(i[0])
    else:
        break

ans.sort()
for word in ans:
    print(word)
from collections import defaultdict
N = int(input())
dic = defaultdict(int)
for i in range(N):
    s = input()
    dic[s]+=1
m = 0
for i in dic:
    m = max(m, dic[i])
ans = []
for i in dic:
    if dic[i]==m:
        ans.append(i)
ans.sort()
for i in ans:
    print(i)
from collections import defaultdict
N = int(input())
P = defaultdict(int)
for i in range(N):
  P[input()] += 1
m = max(P.values())
E = []
for k, v in P.items():
  if v == m:
    E.append(k)
E.sort()
for e in E:
  print(e)
import collections

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

for _ in range(N):
    S.append(input())
    
c = collections.Counter(S)
m = c.most_common()
mc = m[0][1]
a = list(filter(lambda x: x[1] == mc, m))
b = sorted(a)
for e in b:
    print(e[0])
n = int(input())
dicts = {}
for i in range(n):
    k = input()
    try:dicts[k] += 1
    except:dicts.setdefault(k, 1)
s = sorted(dicts.values(), reverse=True)
m = 0
for i in dicts:m = max(m, dicts[i])

ans = []
for i in dicts:
    if(dicts[i] == m):ans.append(i)

for i in sorted(ans):
    print(i)
from collections import Counter
n=int(input())
mylist=[]
for i in range(n):
    s=input()
    mylist.append(s)
#print(mylist)
c=Counter(mylist)

#max=sum(x==max(mylist) for x in mylist)
answer=[]
flag=0
#print(max)
for word,i in c.most_common():
    #print(word,i)
    if flag==0:
        max=i
        flag+=1
        answer.append(word)
    else:
        if i==max:
            answer.append(word)
        else:
            break

answer.sort()
for i in range(len(answer)):
    print(answer[i])
from collections import Counter
n = int(input())
s = [input() for _ in range(n)]
c=Counter(s)
max_cnt=0
for key in c:
    max_cnt=max(max_cnt,c[key])
ans=[]
for key in c:
    if c[key]==max_cnt:
        ans.append(key)
    else:
        continue
ans.sort()
for item in ans:
    print(item)
from collections import Counter
N=int(input())
S=[input() for _ in range(N)]

C=Counter(S)
A=[]
B=[]
T=[]

for i,j in C.most_common():
    A.append(i)
    B.append(j)
for k in range(len(A)):
    if B[k]==B[0]:
        T.append(A[k])
T=sorted(T)
for m in range(len(T)):
  print(T[m])
from collections import Counter
S = []
N = int(input())
for i in range(N):
    s = input()
    S.append(s)

c = Counter(S)
max_num = max(c.values())
max_list = [i for i,j in c.items() if j==max_num]
max_list.sort()
print('\n'.join(max_list))
from collections import Counter

N = int(input())
counter = Counter()

for _ in range(N):
    counter[input()] += 1

max_count = max(counter.values())

results = sorted([k for k, v in counter.items() if v == max_count])
print('\n'.join(results))
n = int(input())
dic = {}
for i in range(n):
    string = input()

    if string in dic:
        dic[string] += 1
    else:
        dic[string] = 0

answers = []
app = 0

for key, value in dic.items():
    if value > app:
        answers.clear()
        answers.append(key)
        app = value
    elif value == app:
        answers.append(key)

answers.sort()
for ans in answers:
    print(ans, sep="\n")
import collections
N = int(input())
A = [input() for _ in range(N)]

C = collections.Counter(A).most_common()
ans = []
for k, v in C:
    if v == C[0][1]:
        ans.append(k)

print(*sorted(ans), sep='\n')
N = int(input())
S = [input() for i in range(N)]
d = {}
for s in S:
    if s not in d:
        d[s] = 1
    else:
        d[s] += 1

max_cnt = 0
for i in d:
    max_cnt = max(max_cnt, d[i])

t = []
for i in d:
    if d[i]==max_cnt:
        t.append(i)
t.sort()
print(*t, sep='\n')
N = int(input())
S = []
for i in range(N):
    s = input()
    S.append(s)

from collections import Counter
c = Counter()

for si in S:
    c[si] += 1

a = []

for k, v in c.items():
    a.append([v, k])

from operator import itemgetter
a.sort(key=itemgetter(1))
a.sort(key=itemgetter(0), reverse=True)


for ai in a:
    if ai[0] == a[0][0]:
        print(ai[1])
n = int(input())

memo = {}

for _ in range(n):
    s = input()
    try:
        memo[s] += 1
    except KeyError:
        memo[s] = 1

m = max(memo.values())

print(*sorted([ i for i, j in memo.items() if j == m]), sep='\n')
N = int(input())
count = {}
for _ in range(N):
    s = input()
    if s in count:
        count[s] += 1
    else:
        count[s] = 1
res = sorted(count.items(), key=lambda x: (-x[1], x[0]))
max_count = res[0][1]
res = [x[0] for x in res if x[1] == max_count]
print(*res, sep='\n')
n=int(input())
S=[input() for _ in range(n)]
from collections import Counter
d=Counter(S)
e=[]
c=d.most_common()[0][1]
for i in d.keys():
  if d[i]==c:
    e.append(i)
e.sort()
print(*e,sep="\n")
#!/usr/bin/env python3
#import sys; sys.stdin=open('input_file.txt')
#------------------------------------------
from collections import defaultdict
import sys
input = sys.stdin.readline
N = int(input())
D = defaultdict(int)
for i in range(N):
    D[input().rstrip()] += 1
A = []
maxv = 0
for k,v in sorted(D.items(),key=lambda x:x[1],reverse=True):
    if maxv > v:
        break
    maxv = v
    A.append(k)
A.sort()
print('\n'.join(A))
from collections import defaultdict
S = defaultdict(lambda: 0)
N = int(input())
ma = 0
for _ in range(N):
    s = input()
    S[s] += 1
    ma = max(ma, S[s])
res = [s for (s, cnt) in S.items() if cnt == ma]
res.sort()
print(*res, sep='\n')
# coding: utf-8
import collections
N=int(input())
S=[]
for i in range(N):
    S.append(input())

c = collections.Counter(S)

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

ans=[]
cnt=0
m=counts[0]
for i in range(len(values)):
    if counts[i]==m:
        ans.append(values[i])
        cnt+=1
    else:
        break
ans.sort()
for i in range(cnt):
    print(ans[i])
N = int(input())

dict = {}
for i in range(N):
    s = input()
    if(s in dict):
        dict[s] += 1
    else:
        dict[s] = 1

max = max(dict.values())
for key, val in sorted(dict.items()):
    if(val == max):
        print(key)
import collections
N=int(input())
A=[]
for i in range(N):
  a=str(input())
  A.append(a)

S = collections.Counter(A)
T=[]
R=[]
ans=0
T=S.most_common()
T.sort(reverse=True,key=lambda x: x[1])
a=T[0][1]
for i in range(len(T)):
  if T[i][1]==a:
    R.append(T[i][0])
R.sort()
for i in R:
  print(i)
from collections import Counter

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

c = Counter(s)
tmp = c.most_common()
ans = []

for i in range(len(tmp)):
    if tmp[i][1] != tmp[0][1]:
        break
    else:
        ans.append(tmp[i][0])

ans.sort()
print(*ans, sep="\n")
from collections import defaultdict
n = int(input())
S = [input() for _ in range(n)]
d = defaultdict(int)
for s in S:
    d[s] += 1
m = max(d.values())
items = d.items()
a = sorted([c[0] for c in items if c[1] == m])
[print(i) for i in a]
N = int(input())
S =[]
times = {}
for i in range(N):
  word = input()
  if word in times:
    times[word] = times[word] + 1
  else:
    times[word] = 1
max_value = max(times.values())
words = []
for i in times.items():
  if i[1] == max_value:
    words.append(i[0])
words = sorted(words)
for i in words:
  print(i)
n = int(input())

cnt = {}
mx = 0
for i in range(n):
    s = input()
    if s not in cnt:
        cnt[s] = 0
    cnt[s] += 1
    mx = max(mx, cnt[s])

ans = []
for s in cnt:
    if cnt[s] == mx:
        ans.append(s)

ans.sort()
for s in ans:print(s)
import collections

N = int(input())
S = [input() for i in range(N)]
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):
    ans.append(C[i][0])
ans = sorted(ans)
for i in range(len(ans)):
    print(ans[i])
import sys
read = sys.stdin.read
from collections import Counter
def main():
    n, *s = read().split()
    n = int(n)
    sc = Counter(s)
    scm = sc.most_common()
    maxnum = scm[0][1]
    r = []
    for scme in scm:
        if scme[1] == maxnum:
            r.append(scme[0])
        else:
            break
    r.sort()
    print(*r, sep="\n")

if __name__ == '__main__':
    main()
n = int(input())
items = [input() for _ in range(n)]

counts = {}
for item in items:
  if item in counts.keys():
    counts[item] += 1
  else:
    counts[item] = 1

max_counts = max([item[1] for item in counts.items()])

rets = [item[0] for item in counts.items() if item[1] == max_counts]
rets = sorted(rets)
print('\n'.join(rets))
import sys
from collections import Counter
input = sys.stdin.readline
N = int(input())
S = [input() for _ in range(N)]

c = Counter(S)
max_c = max(c.values())
names = [name for name, cnt in c.items() if cnt == max_c]
names.sort()
print(*names, sep='\n')
from collections import Counter
n = int(input())
s = [input() for _ in range(n)]
c = Counter(s)
m = 0
for v in c.values():
	m = max(m, v)
ans = []
for k, v in c.items():
	if v == m:
		ans.append(k)
ans.sort()
print(*ans, sep="\n")
n=int(input())
dic={}
maxx=1
for i in range(n):
  s=input()
  if s in dic:
    dic[s]+=1
  else:
    dic[s]=1
  if dic[s]>maxx:
    maxx=dic[s]
lis=[]
for i in range(len(dic)):
  kk=dic.popitem()
  if kk[1]==maxx:
    lis.append(kk[0])
lis.sort()
for i in range(0,len(lis)):
  print(lis[i])
n=int(input())
s=[input() for i in range(n)]
d=[]
x=0
count=1
s.sort()
for i in range(n-1):
  if s[i]==s[i+1]:
    count+=1
  else:
    d.append([count,s[i]])
    count=1
d.append([count,s[-1]])
d.sort()
x=d[-1][0]
for i in range(len(d)):
  if x==d[i][0]:
    print(d[i][1])
N=int(input())
S = []
for i in range(N):
  S.append(input())

import collections
c = collections.Counter(S)
values, counts = zip(*c.most_common())
#print(c)
if len(counts)==1:
  print(values[0])
else:
  n = 0
  for j in range(1,N):
    if counts[j]!=counts[j-1]:
      n = j
      break
    else:
      n = j+1
  #print(n)
  ans = list(values[:n])
  ans = sorted(list(ans))
  #print(ans)
  for k in ans:
    print(k)
import collections
N = int(input())
words = []
for i in range(N):
    words.append(input())
c = collections.Counter(words)
counts = c.most_common()
counts = sorted([i for i in counts if i[1] == counts[0][1]])
for i in counts:
    print(i[0])
from collections import Counter
N = int(input())
S  = []
for i in range(N):
  S.append(input())
cnt = Counter(S)
ans = []
max_vote = max(cnt.values())
for a,b in cnt.items():
  if max_vote==b:
    ans.append(a)
ans = sorted(ans)
print("\r\n".join(ans))
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]
print(*sorted([a for a,s in k if s==d]),sep="\n")
n = int(input())
d = dict()
for i in range(n):
    s = input()
    if not s in d:
        d[s] = 1
    else:
        d[s] += 1

sorted_d = sorted(d.items(), reverse=True, key=lambda x:x[1])
ans_list = []
for x in sorted_d:
    if x[1] == sorted_d[0][1]:
        ans_list.append(x[0])
    else:
        break

ans_list.sort()
print(*ans_list, sep='\n')
from collections import Counter
import sys
n=int(sys.stdin.readline().rstrip())
S=[sys.stdin.readline().rstrip() for _ in range(n)]
    
cnt=Counter(S)
ma = max(cnt.values())
list=[]
for k in cnt.keys():
    if cnt[k] == ma:
      list.append(k)

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

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

ans = []
for index, s in enumerate(c):

    if index == 0:
        ans.append(s[0])
    elif c[index][1] == c[index-1][1]:
        ans.append(s[0])
    else:
        break
for result in sorted(ans):
    print(result)
n = int(input())

#sを辞書に入れてカウントする
d = {}
for _ in range(n):
    s = input()
    if s in d:
        d[s] += 1
    else:
        d[s] = 1

#valueが最大であるkeyを辞書順にプリントする
m = max(d.values())
for s in sorted(k for k in d if d[k] == m):
    print(s)
n=int(input())
dic = {}
for i in range(n):
    st=input()
    dic.setdefault(st,0)
    dic[st]+=1
ans=0
answers=[]
for k,v in dic.items():
    if v==ans:
        ans=v
        answers.append(k)
    elif v>ans:
        ans=v
        answers=[k]
answers.sort()
for ans in answers:
    print(ans)
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 sorted(best_words):
    print(string)
import collections
N = int(input())
S = [input() for _ in range(N)]
c = collections.Counter(S)
C=c.most_common()
result = []
for i in range(len(C)):
  if C[i][1] == C[0][1]:
    result.append(C[i][0])
  else:
    break
result.sort()
for j in range(len(result)):
  print(result[j])
N = int(input())
S = [input() for i in range(N)]

table = {}
for Si in S:
    table[Si] = 1 if table.get(Si) is None else table.get(Si) + 1

maximum = max(table.values())

condition = lambda maxium: lambda item: item[1] == maximum
answer = filter(condition(maximum), table.items())
answer = dict(answer)
answer = list(answer.keys())
answer.sort()
answer = "\n".join(answer)

print(answer)
from collections import defaultdict

N = int(input())
S = defaultdict(int)
for _ in range(N):
    s = input()
    S[s] += 1

t = max(S.values())
for v in sorted(dict(filter(lambda kv: kv[1] == t, S.items())).keys()):
    print(v)
import numpy as np
N=int(input())
S=[]
ans={}

pri=[]

for i in range(N):
    tmp=input()
    if(tmp.isdecimal()==0):
        S.append(tmp)

for i in S:
    if(ans.get(i)==None):
        ans[i]=1
    else:
        ans[i]+=1
a=np.max(np.array(list(ans.values())))

for i,j in ans.items():
    if(j==a):
        pri.append(i)
        
pri=sorted(pri)


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

d=Counter(S)
maxi=0
for i in d.keys():
    maxi=max(maxi,d[i])

ans=[]
for i in d.keys():
    if d[i]==maxi:
        ans.append(i)
ans=sorted(ans)
print('\n'.join(ans))
import numpy as np
from collections import Counter

# 最頻値
def mode(list):
    c = Counter(list)
    freq_scores = c.most_common()
    max_count = freq_scores[0][1]
    modes = []
    for num in freq_scores:
        if num[1] == max_count:
            modes.append(num[0])
    return(modes)

def main():
  n = int(input())
  s_list = ["a"] * n
  for i in range(n):
    s_list[i] = input()
  ans_list = mode(s_list)
  ans_list.sort()
  for i in ans_list:
    print(i)

main()
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])
n=int(input())
arr=[input() for _ in range(n)]
dic={}
for i in range(n): #各単語の出現回数を数える
 if arr[i] not in dic:
   dic[arr[i]]=1
 else:
   dic[arr[i]]+=1
largest=max(dic.values()) #最大の出現回数を求める
ans=[]
for keys in dic.keys():
 if dic[keys]==largest: #出現回数が最も多い単語を集計する
   ans.append(keys)
ans=sorted(ans) #単語を辞書順に並べ替えて出力する
for words in ans:
 print(words)