Problem:


Score: 300 points

Problem Statement

We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it.

Print all strings that are written on the most number of votes, in lexicographical order.

Constraints

1 \leq N \leq 2 \times 10^5

S_i (1 \leq i \leq N) are strings consisting of lowercase English letters.

The length of S_i (1 \leq i \leq N) is between 1 and 10 (inclusive).

Input

Input is given from Standard Input in the following format:

N
S_1
:
S_N

Output

Print all strings in question in lexicographical order.

Sample Input 1

7
beat
vet
beet
bed
vet
bet
beet

Sample Output 1

beet
vet

beet and vet are written on two sheets each, while beat, bed, and bet are written on one vote each. Thus, we should print the strings beet and vet.

Sample Input 2

8
buffalo
buffalo
buffalo
buffalo
buffalo
buffalo
buffalo
buffalo

Sample Output 2

buffalo

Sample Input 3

7
bass
bass
kick
kick
bass
kick
kick

Sample Output 3

kick

Sample Input 4

4
ushi
tapu
nichia
kun

Sample Output 4

kun
nichia
tapu
ushi



Sample input:
7
beat
vet
beet
bed
vet
bet
beet


Sample output:
beet
vet

Submission status: Wrong Answer

Solution code:
N=int(input())
moji_list = []
moji_count = []
for i in range(N):
  S=input()
  if not S in moji_list:
    moji_list.append(S)
    moji_count.append(1)
  else:
    moji_count[moji_list.index(S)] += 1

koho_moji = []
for i in range(len(moji_count)):
  if moji_count[i] == max(moji_count):
    koho_moji.append(moji_list[i])

#print(koho_moji)

jisho = "abcdefghijklmnopqrstuvwxyz"
suji_jisho = []
max_len = 0
for i in range(len(koho_moji)):
  max_len = max([max_len,len(koho_moji[i])])
#print(max_len)

for i in range(len(koho_moji)):
  k = 0
  for t in range(len(koho_moji[i])):
#    print(koho_moji[i][t], (jisho.index(koho_moji[i][t])+1) * (100**(max_len-t-1)) )
    k = k + (jisho.index(koho_moji[i][t])+1) * (100**(max_len-t-1))
  suji_jisho.append(k)

print(suji_jisho)

Submission status: Wrong Answer

Solution code:
N=int(input())
moji_list = []
moji_count = []
for i in range(N):
  S=input()
  if not S in moji_list:
    moji_list.append(S)
    moji_count.append(1)
  else:
    moji_count[moji_list.index(S)] += 1

koho_moji = []
for i in range(len(moji_count)):
  if moji_count[i] == max(moji_count):
    koho_moji.append(moji_list[i])

print(koho_moji)

Submission status: Wrong Answer

Solution code:
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
  else:
    counter+=[count]
    count=1
    
counter+=[count]    
MAX=max(counter)
count=1

for i in range(N-1):
  if listS[i]==listS[i+1]:
    count+=1
  else:
    count=1
  if count==MAX:
    print(listS[i])
if count==MAX:
  print(listS[-1])

Submission status: Wrong Answer

Solution code:
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

Submission status: Wrong Answer

Solution code:
import collections

#まずは代入
n = int(input())
s = [input() for _ in range(n)]
c = collections.Counter(s).most_common() #もうリストにしちゃった<3
d = max([c[x][1] for x in range(len(c))])
#この時点で, cは個数が多い順に並んでる
#たとえば入力例1だと
#[('vet', 2), ('beet', 2), ('beat', 1), ('bed', 1), ('bet', 1)]

ans = []
max = c[0][1] #最大の個数は何か? 数値を代入
for item,count in c[0:d]:
	if count==max:
		ans.append(item)
	else:
		break #もうこれ以下は弱いのしかないのでbreakします

ans.sort() #辞書順に並べる

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

Submission status: Wrong Answer

Solution code:
from collections import Counter
n = int(input())
lst = [input() for i in range(n)]

count = Counter(lst)
m = max(count.values())

for k, v in count.items():
  if v == m:
    print(k)

Submission status: Wrong Answer

Solution code:
N = int(input())
S = [input() for _ in range(N)]
dic = dict()
for s in S:
    if s in dic:
        dic[s] += 1
    else:
        dic[s] = 1
score_sorted = sorted(dic.items(), key=lambda x: -x[1])
dic_sorted = sorted(score_sorted, key=lambda x: x[0])
m = score_sorted[0][1]
for k,v in dic_sorted:
    if v == m:
        print(k)
    else:
        break

Submission status: Wrong Answer

Solution code:
from collections import defaultdict
dic = defaultdict(int)

n = int(input())
A = [input() for i in range(n)]
for elem in A:
    dic[elem] += 1
# print(dic)
m = max(dic.values())
# print(m)

Ans = []
for key in dic:
    # print(dic[key])
    if dic[key] == m:
        Ans.append(key)

Ans = sorted(Ans)
print([i for i in Ans])

Submission status: Wrong Answer

Solution code:
from collections import defaultdict
dic = defaultdict(int)

n = int(input())
A = [input() for i in range(n)]
# A = list(map(str, A))
# print(A)

vote = 0

for elem in A:
    dic[elem] += 1
# print(dic)
m = max(dic.values())
# print(m)

for key in dic:
    # print(dic[key])
    if dic[key] == m:
        print(key)

Submission status: Wrong Answer

Solution code:
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)

Submission status: Wrong Answer

Solution code:
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], reverse = True)

va = -1
for key,value in s2:
    if va == -1:
        va = value
        print(key)
    else:
        if va == value:
            print(key)

Submission status: Wrong Answer

Solution code:
import collections
N=int(input())
S=[]
for i in range(N):
   S.append(str(input())) 
c=collections.Counter(S)
c_sorted=c.most_common()
s=max(c.values())
for i in c_sorted:
    if i[1]==s:
        print(i[0])

Submission status: Wrong Answer

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

dic={}
for s in S:
  if s in dic:
    dic[s]=dic[s]+1
  else:
    dic[s]=1

num = max(dic.values())
[print(k) for k, v in dic.items() if v==num]

Submission status: Wrong Answer

Solution code:
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)

Submission status: Wrong Answer

Solution code:
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 [s for s in S if s in max_s]:
    print(i)

Submission status: Wrong Answer

Solution code:
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
for i in [s[0] for s in s_counter.items() if s[1] == max]:
    print(i)

Submission status: Wrong Answer

Solution code:
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
for i in s_counter.items():
    if i[1] == max and i[0] not in printed_items:
        print(i[0])
        append(i[0])

Submission status: Wrong Answer

Solution code:
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
for i in s_counter.items():
    if s[1] == max and s[0] not in printed_items:
        print(s[0])
        append(s[0])

Submission status: Wrong Answer

Solution code:
from collections import Counter

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

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

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

for i in s_counter.items():
    if s[1] == max:
        print(s[0])

Submission status: Wrong Answer

Solution code:
import collections

n = int(input())
l = []*n

for x in range(0, n) :
    l.append(input())

l_sorted = sorted(l)
c = collections.Counter(l_sorted)
mc = c.most_common()

pre_v = 0
ans = []
for m in mc :
    k = m[0]
    v = m[1]
    if v < pre_v :
        break
    pre_v = v
    ans.append(k)

ans_sorted = sorted(ans)
print(ans_sorted)

Submission status: Wrong Answer

Solution code:
import collections

n = int(input())
l = []*n

for x in range(0, n) :
    l.append(input())

l_sorted = sorted(l)
c = collections.Counter(l_sorted)
mc = c.most_common()

pre_v = 0
for m in mc :
    k = m[0]
    v = m[1]
    if v < pre_v :
        break
    pre_v = v
    print(k)

Submission status: Wrong Answer

Solution code:
import collections
N = int(input())
S = [input() for n in range(N)]

cnt = collections.Counter(S)
m = max(cnt.values())

for k, v in dict(sorted(cnt.items())).items():
    if v == m:
        print(k)

Submission status: Wrong Answer

Solution code:
N=int(input())
l={}
ans =[]
 
"""for i in range(N):
  s=input()
  if s in l:
    l[s]+=1
  else:
    l[s]=1
print(l)"""
for i in range(N):
    s=input()
    if s in l:
        l[s]+=1
    else:
        l[s]=1
#print(l)
num = max(l.values())
print(max)
for i in l:
    #print(l[i])
    if l[i]==num:
      ans.append(i)
b = sorted(ans)
for i in b:
    print(i)

Submission status: Wrong Answer

Solution code:
import collections
N = int(input())
S = sorted([input() for n in range(N)])

cnt = collections.Counter(S)
cnt = dict(sorted(cnt.items(), key=lambda x: x[1], reverse=True))
m = max(cnt.values())

for k, v in cnt.items():
    if v == m:
        print(k)
    else:
        break

Submission status: Wrong Answer

Solution code:
import collections
N = int(input())
S = sorted([input() for n in range(N)])

cnt = collections.Counter(S)
cnt = dict(sorted(cnt.items(), key=lambda x:x[1], reverse=True))
m = max(cnt.values())

for k, v in cnt.items():
    if v == m:
        print(k)
    else:
        break

Submission status: Wrong Answer

Solution code:
#########行列読み込み ##############################################
"""
from sys import stdin
n = int(stdin.readline().rstrip())
data = [stdin.readline().rstrip().split() for _ in range(n)]
print(data)
print(*data, sep='\n')
"""
##################################################################
#########入力系####################################################
"""
s =input()
s=list(input())
a=int(input())
x,y = map(int,input().split())	
li = input().split()	
li = list(map(int,input().split()))	
li = input().split('T')	
"""
##################################################################
n = int(input())
S = []
A = []
B = []
C = []

for i in range(n):
    S.append(input())
    #S.sort()
    
#print(S)
A = list(set(S))
A.sort()
for j in A:
    B.append(S.count(j))
#print(A)
#print(B)
d = dict(zip(A,B))
#print(d)
keys = [k for k, v in d.items() if v == max(B)]
for i in keys:
    print(i)

Submission status: Wrong Answer

Solution code:
N = int(input())
dic = {}
for i in range(1,N+1):
    key = input()
    if key not in dic:
        dic[key] = 1
    else:
        dic[key] += 1
lis = []
for key,val in dic.items():
    lis.append([val,key])
lis.sort(reverse = True)

lis2 = []
fnum = lis[0][0]
j = 0
for x in range(0,len(lis)): 
    if lis[j][0] == fnum:
        lis2.append(lis[j][1])
    else:
        break
lis2.sort()
for k in lis2:
    print(k)

Submission status: Wrong Answer

Solution code:
#########行列読み込み ##############################################
"""
from sys import stdin
n = int(stdin.readline().rstrip())
data = [stdin.readline().rstrip().split() for _ in range(n)]
print(data)
print(*data, sep='\n')
"""
##################################################################
#########入力系####################################################
"""
s =input()
s=list(input())
a=int(input())
x,y = map(int,input().split())	
li = input().split()	
li = list(map(int,input().split()))	
li = input().split('T')	
"""
##################################################################
n = int(input())
S = []
A = []
B = []

for i in range(n):
    S.append(input())
#print(S)
A = list(set(S))
for j in A:
    B.append(S.count(j))
#print(B)
d = dict(zip(A,B))
#print(d)
keys = [k for k, v in d.items() if v == max(B)]
#print(keys)
for i in keys:
    print(i)

Submission status: Wrong Answer

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



count={}
for i in range(n):
    if s[i] not in count:
        count[s[i]] = 1
    else:
        count[s[i]] += 1

ans = [k for k,v in count.items() if v == max(count.values())]
for i in range(len(ans)):
    print(ans[i])

Submission status: Wrong Answer

Solution code:
N=int(input())
l={}

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


# l=sorted(l,key=lambda x:x[1])

ma=max(l)
max_value=l[ma]

ans=[]

for i in l:
  if max_value==l[i]:
    ans.append(i)
ans.sort()

for i in ans:
  print(i)

Submission status: Wrong Answer

Solution code:
N=int(input())
l={}

for i in range(N):
  s=input()
  if s in l:
    l[s]+=1
  else:
    l[s]=1
l=sorted(l.items(),key=lambda x: x[1],reverse=True)
ma=max(l)
ans=[]

for i in l:
  if i[1]==ma[1]:
    ans.append(i[0])

ans.sort()
  
for i in ans:
  print(i)

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
input = sys.stdin.buffer.readline

def RD(): return sys.stdin.read()
def II(): return int(input())
def MI(): return map(int,input().split())
def LI(): return list(map(int,input().split()))
def TI(): return tuple(map(int,input().split()))


def main():
    N = II()
    S = [input() for i in range(N)]
    Sset = set(S)
    max = 0
    n = 0
    ans = []

    for i in Sset:
        count = S.count(i)
        if count > max:
            max = count

    for j in Sset:
        count = S.count(j)
        if count == max:
            ans.append(j)
            n += 1
    ans = sorted(ans)
    for k in range(n):
        print(ans[k])




if __name__ == "__main__":
	main()

Submission status: Wrong Answer

Solution code:
from collections import Counter,deque
n=int(input())
s=Counter([input() for i in range(n)])
l=deque([])
for i in s:
  l.append(i)
  if s[l[0]]<s[i]:
    l.popleft()
  elif s[l[0]]>s[i]:
    l.pop()
l=sorted(list(l))
for i in l:
  print(i)

Submission status: Wrong Answer

Solution code:

n = int(input())
dic = {}
b = []
for i in range(n):
    a = input()
    b.append(a)
    if i in dic:
        dic[i] += 1
    else:
        dic[i] = 1
M = max(dic.values())
for j,k in sorted(dic.items()):
    if k == M:
        print(j)

Submission status: Wrong Answer

Solution code:
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])

Submission status: Wrong Answer

Solution code:
n = int(input())
d = {}
for i in range(n):
  s = input()
  d[s] = d.get(s, 0) + 1
  
maxKeys = [x[0] for x in enumerate(d.items()) if x[1] == max(d.values())]
so = sorted(maxKeys)
for e in so:
  print(e)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
N = int(input())
s = []
c = []
d = []
for i in range(N):
    S = input()
    s.append(S)
for i in range(N):
    c.append(s.count(s[i]))
for i in range(N):
    if max(c) == c[i]:
        d.append(s[i])
d = set(d)
d = list(d)
d.sort(reverse = True)
for i in range(len(d)):
    print(list(d)[i])

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
N = int(input())
s = []
c = []
d = []
for i in range(N):
    S = input()
    s.append(S)
for i in range(N):
    c.append(s.count(s[i]))
for i in range(N):
    if max(c) == c[i]:
        d.append(s[i])
d = set(d)
for i in range(len(d)):
    print(list(d)[i])

Submission status: Wrong Answer

Solution code:
n = int(input())
a = [input() for hoge in range(n)]
b = sorted(a)
c = set(a)
d = 0
ans = []
for poge in c:
  if d < b.count(poge):
    d = b.count(poge)
for raw in b:
  if d == b.count(raw):
    ans.append(raw)
answer = set(ans)
for q in answer:
  print(q)

Submission status: Wrong Answer

Solution code:
import collections
N = int(input())
l = []
for _ in range(N):
    s = input()
    l.append(s)
c = collections.Counter(l)
i=0
j=0
while True:
    print(c.most_common()[i][0])
    if i+1<len(c.most_common()):
        if c.most_common()[i+1][1] == c.most_common()[i][1]:
            i+=1
            continue
        else:
            break
    else:
        break

Submission status: Wrong Answer

Solution code:
import sys
n = int(sys.stdin.readline())
li = []
for _ in range(n):
  li.append(sys.stdin.readline().strip())
max = 0
li2 = list(set(li))
li3 = []
for i in li2:
  if li.count(i) > max:
    li3 = [i]
  elif li.count(i) == max:
    li3.append(i)
li3.sort()
print('\n'.join(li3))

Submission status: Wrong Answer

Solution code:
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")

Submission status: Wrong Answer

Solution code:
import collections
n = int(input())
s = [input() for i in range(n)]
c = collections.Counter(s)
num = c.most_common()[0][1]
list=[]
for i in range(len(c)):
	if num == c.most_common()[i][1]:
		list.append(c.most_common()[i][0])
list = sorted(list,reverse=True)
for i in list:
	print(i)

Submission status: Wrong Answer

Solution code:
import collections
n = int(input())
s = [input() for i in range(n)]
c = collections.Counter(s)
num = c.most_common()[0][1]
list=[]
for i in range(len(c)):
	if num == c.most_common()[i][1]:
		print(c.most_common()[i][0])
		#list.append(c.most_common()[i][0])

Submission status: Wrong Answer

Solution code:
import collections

N = int(input())

chars = [input() for _ in range(N)]
char_counts = collections.Counter(chars)

for char in sorted(char_counts.most_common()):
  print(char[0])

Submission status: Wrong Answer

Solution code:
import collections

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

c = collections.Counter(s)
values,counts = zip(*c.most_common())
max_w = counts[0]
l = len(counts)

print(values[0])
i = 1
while True:
    if i < l:
        if counts[i] == max_w and i < l:
            print(values[i])
    else:
        break
    i += 1

Submission status: Wrong Answer

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

A = {}
for i in S:
    A.setdefault(i, 1)
    A[i] += 1

B = max(A.values())
C = [i for i in A if A[i] == B]
C = sorted(C)
print(C)

Submission status: Wrong Answer

Solution code:
N = int(input())
L = [input() for _ in range(N)]

word = {}
for i in range(N):
    if L[i] in word:
        word[L[i]] += 1
    else:
        word[L[i]] = 1

max_count = 0
for i in range(N):
    max_count = max(max_count, word[L[i]])
    
ans = []
for i in range(N):
    if word[L[i]] == max_count:
        ans.append(L[i])
        
ans.sort()

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

Submission status: Wrong Answer

Solution code:
import collections
N = int(input())
S = [input() for i in range(N)]
c = collections.Counter(S)
l = c.most_common()
n, m = l[0]
ans = []
for i, j in l:
    if j == m:
        ans.append(i)
print(ans.sort())

Submission status: Wrong Answer

Solution code:
import collections
N = int(input())
S = [input() for i in range(N)]
c = collections.Counter(S)
l = c.most_common()
n, m = l[0]
for i, j in l:
    if j == m:
        print(i)

Submission status: Wrong Answer

Solution code:
import collections
N = int(input())
S = [input() for i in range(N)]
s = collections.Counter(S)
ss = list(s)

count = 0 #多く出現する要素の個数を調べる
max = 0
for i in ss:
    if s[i] > max:
        count = 1
        max = s[i]
    elif s[i] == max:
        count += 1

for i in range(count):
	print(s.most_common()[i][0])

Submission status: Wrong Answer

Solution code:
n,*s=open(0).read().split()
t=set(sorted(s))
c=[0]*len(t)
for i,a in enumerate(t):
  c[i]=s.count(a)
m=max(c)
for i,a in zip(c,t):
  if i==m:
    print(a)

Submission status: Wrong Answer

Solution code:
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()

Submission status: Wrong Answer

Solution code:
from collections import Counter
N = int(input())
S = [input() for i in range(N)]

count = Counter(S)
maxnum = max(count.values())
maxlist= [i for i,j in count.items() if j==maxnum]

maxlist.sort()
print("/n".join(maxlist))

Submission status: Wrong Answer

Solution code:
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[0])

Submission status: Wrong Answer

Solution code:
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)

Submission status: Wrong Answer

Solution code:
import collections
n = int(input())
s = collections.Counter([input() for i in range(n)])

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

len = counts.count(max(counts))

for i in range(len):
    print(values[i])

Submission status: Wrong Answer

Solution code:
n = int(input())
s = sorted([input() for i in range(n)])
l = []
tmp = 0
for i in range(1,n):
    if s[i-1] == s[i]:
        tmp += 1
    else:
        l.append(tmp)
        tmp = 0
if s[-1] == s[-2]:
    l.append(tmp)
x = [i for i, x in enumerate(l) if x == max(l)]
s = sorted(set(s))
for i in x:
    print(s[i])

Submission status: Wrong Answer

Solution code:
import collections
l=[]
n=int(input())
for i in range(n):
  l.append(input())
c=collections.Counter(l)
max_list=[kv[0] for kv in c.items() if kv[1]==max(c.values())]

for j in max_list:
  print(j)

Submission status: Wrong Answer

Solution code:
region1 = ['2','3','4','2']
region2 = ['8','2','7']
print(set(region1) & set(region2))

Submission status: Wrong Answer

Solution code:
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)))

Submission status: Wrong Answer

Solution code:
from collections import defaultdict

N = int(input())
S_dic = defaultdict(int)

for i in range(N):
  S = input()
  S_dic[S] += 1

m = max(S_dic.values())
max_S = [i[0] for i in S_dic.items() if i[1] == m ]
print("\n".join(max_S))

Submission status: Wrong Answer

Solution code:
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 = max(S_dic.values())

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

Submission status: Wrong Answer

Solution code:
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

Submission status: Wrong Answer

Solution code:
N=int(input())
L=[]
M=[0]*N
for i in range(N):
  L.append(str(input()))
L.sort()
l=0
m=0
A=[]
for j in L:
  if j not in A:
    A.append(j)
    l=max(m,l)
    m=1
  else:
    m+=1
  M[A.index(j)]+=1
for k in range(N):
  if M[k]==m:
    print(A[k])

Submission status: Wrong Answer

Solution code:
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])

Submission status: Wrong Answer

Solution code:
N=int(input())
A=[]
for i in range(N):
  A.append(str(input()))
A.sort()
B=list(set(A))
m=0
for i in range(len(B)):
  m=max(m,A.count(B[i]))
for j in range(len(B)):
  if A.count(B[j])==m:
    print(B[j])

Submission status: Wrong Answer

Solution code:
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])

Submission status: Wrong Answer

Solution code:
from collections import Counter
N = int(input())
data = [0] * N


for i in range(0, N):
    data[i] = input()

count = Counter(data)
#count = sorted(count, key=lambda x: x[0])
#count = sorted(count)
most = count.most_common()
mostNum = most[0][1]
print(count)    # counter_object
print(most)     # list;[(val,num),(val,num),/////]
print(mostNum)  # number of most

most.sort()

for i in most:
    if (i[1] == mostNum):
        print(i[0])

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

# input
N = int( input() )
S = list()
for ii in range(N):
    S.append( input() )
S.sort()

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

# output      
max_count = 0
for key in C.most_common():
    if( max_count <= key[1] ):
        max_count = key[1]
        print(key[0])

Submission status: Wrong Answer

Solution code:
# 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])

Submission status: Wrong Answer

Solution code:
n = int(input())
d = {}
for _ in range(n):
    s = input()
    if s  in d:
        d[s] = +1
    else:
        d[s] = 1
max_d = max(d.values())
ans = [kv[0] for kv in d.items() if kv[1] == max_d]
ans.sort()

print(*ans, sep='\n')

Submission status: Wrong Answer

Solution code:
n = int(input())
d = {}
for _ in range(n):
    s = input()
    if s  in d:
        d[s] = +1
    else:
        d[s] = 1
max_d = max(d.values())
ans = sorted([kv[0] for kv in d.items() if kv[1] == max_d])
print(ans)

Submission status: Wrong Answer

Solution code:
class atcoder:
    N=int(input())
    S=[input() for i in range(N)]
    S.sort()
    d={}
    for i in S:
        if i not in d:
            d[i]=1
        else:
            d[i]+=1
    ma=max(d.values())
    
    for i in d:
        if d[i]==ma:
            print(i)
        else:
            pass

Submission status: Wrong Answer

Solution code:
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()

Submission status: Wrong Answer

Solution code:
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

Submission status: Wrong Answer

Solution code:
n = int(input())
list_a = []

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

key = sorted([k for k, v in d.items() if v == d[max(d)]])
for i in key:
    print(i)

Submission status: Wrong Answer

Solution code:
n=int(input())
box={}
for i in range(n):
  vote=input()
  if not(vote in box):
    box[vote]=1
  else:
    box[vote]+=1
m=0
win=[]
for num in box.values():
  if num > m:
    m=num
for name,num in box.items():
  if num==m:
    win.append(name)
sorted(win)
for i in win:
  print(i)

Submission status: Wrong Answer

Solution code:
N = int(input())
arr = sorted([input() for _ in range(N)])

dict ={}
for i in arr:
    if i not in dict:
        dict[i] = 1
    else:
        dict[i] += 1

max_n = max(dict.values())


for i in dict:
    if dict[i] == max_n:
        print(i)

Submission status: Wrong Answer

Solution code:
import sys
import os
import math

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

MOD = 10 ** 9 + 7


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N = ii()
    S = [iss() for _ in range(N)]
    S.sort()
    ret = 0
    di = {}
    mx = 0
    for s in S:
        if s in di:
            di[s] += 1
            mx = max(di[s], mx)
        else:
            di[s] = 0

    for s in di:
        if di[s] == mx: print(s)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import sys
import os
import math

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

MOD = 10 ** 9 + 7


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N = ii()
    ret = 0
    di = {}
    mx = 0
    for n in range(N):
        s = iss()
        if s in di:
            di[s] += 1
            mx = max(di[s], mx)
        else:
            di[s] = 0

    for s in di:
        if di[s] == mx: print(s)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
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
print(times)
max_k_list = [kv[0] for kv in times.items() if kv[1] == max(times.values())]
new_str_list = sorted(max_k_list)
for i in new_str_list:
  print(i)