Problem:


Mode Value

Your task is to write a program which reads a sequence of integers and prints mode values of the sequence.
The mode value is the element which occurs most frequently. 

Input

A sequence of integers ai (1 ≤ ai ≤ 100). The number of integers is less than or equals to 100.

Output

Print the mode values. If there are several mode values, print them in ascending order.

Sample Input

5
6
3
5
8
7
5
3
9
7
3
4

Output for the Sample Input

3
5

For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5.



Sample input:
5
6
3
5
8
7
5
3
9
7
3
4


Sample output:
3
5

Submission status: Accepted

Solution code:
import collections
import itertools
t=[]
while True:
    try:
        k=int(input())
        t.append(k)
        
    except EOFError:
        break
    
counter=collections.Counter(t)
mode_v=counter.most_common()[0][-1]
it=itertools.takewhile(lambda kv:kv[-1]==mode_v,counter.most_common())
m=(k for k,v in it)
[print(i) for i in m]

Submission status: Accepted

Solution code:
a=[]
try:
  while True:
     a.append(int(input()))
except EOFError:
  pass

counts = [0] * 101

for n in a:
  counts[n] += 1

for n in range(len(a)):
  if counts[n] == max(counts):
    print(n)

Submission status: Accepted

Solution code:
a=[]
try:
    while True:
        a.append(int(input()))
except EOFError:
    pass
counts=[0]*101

for n in a:
    counts[n] += 1
    
for n in range(len(a)):
    if counts[n] == max(counts):
        print(n)

Submission status: Accepted

Solution code:
x=[]
while True:
    try:
        n=int(input())
        x.append(n)
    except:
        break
c=[0]*101
for i in x:
    c[i]+=1
b=max(c)
for j in range(100):
    if c[j]==b:
        print(j)

Submission status: Accepted

Solution code:
a=[]
try:
    while True:
        a.append(int(input()))
except EOFError:
    pass
#print('@',a)

counts = [0]*101
# counts[n] nの個数を数える
#print('@',counts)

for n in a:
    counts[n] +=1
    
#print('@',counts)
#print('@',max(counts))

for n in range(len(a)):
    if counts[n]==max(counts):
        print(n)

Submission status: Accepted

Solution code:
a=[]
try:
    while True:
        a.append(int(input()))
except EOFError:
    pass

counts=[0]*101

for n in a:
    counts[n] += 1

for n in range(len(a)):
    if counts[n]==max(counts):
        print(n)

Submission status: Accepted

Solution code:
a=[]
try:
    while True:
        a.append(int(input()))
except EOFError:
    pass
counts=[0]*101

for i in a:
    counts[i]+=1
    
for i in range (len(a)):
    if counts[i]==max(counts):
        print(i)

Submission status: Accepted

Solution code:
a=[]
try:
    while True:
        a.append(int(input()))
except EOFError:
    pass
counts=[0]*101

for n in a:
    counts[n]+=1

for n in range(len(a)):
    if counts[n]==max(counts):
        print(n)

Submission status: Accepted

Solution code:
x=[0]*101
while True :
    try :
        n=int(input())
        x[n]+=1
    except EOFError: break

for i in range(sum(x)):
    if x[i]==max(x) :
        print(i)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

a = []
try :
    while True:
        a.append(int(input()))
except EOFError:
    pass

counts = [0] * 101

for n in a:
    counts[n] += 1
    
for n in range(len(a)):
    if counts[n] == max(counts):
        print(n)

Submission status: Accepted

Solution code:
a=[]
while True:
    try:
        a.append(int(input()))
    except:
        break
counts=[0]*101
for n in a:
    counts[n]+=1
    
for n in range(len(a)):
    if counts[n]==max(counts):
        print(n)

Submission status: Accepted

Solution code:
a=[]
try:
    while True:
        a.append(int(input()))
except EOFError:
    pass
count=[0]*101
for n in a:
    count[n]+=1
for n in range(len(a)):
    if count[n]==max(count):
        print(n)

Submission status: Accepted

Solution code:
a=[]
try:
    while True:
        a.append(int(input()))
except EOFError:
    pass


counts=[0]*101

for n in a:
    counts[n]+=1

for n in range(len(a)):
    if counts[n]==max(counts):
        print(n)

Submission status: Accepted

Solution code:
a=[]
try:
    while True:
        a.append(int(input()))
except EOFError:
    pass

count=[0]*101
for n in a:
    count[n]+=1

for n in range(len(a)):
    if count[n]==max(count):
        print(n)

Submission status: Accepted

Solution code:

a = []
try :
    while True:
        a.append(int(input()))
except EOFError:
    pass
# print('@', a)

counts = [0] * 101
# counts[n]  n の個数を数える

for n in a:
    counts[n] += 1

# print('@', counts)
# print('@', max(counts))

for n in range(len(a)):
    if counts[n] == max(counts):
        print(n)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

import collections
import itertools
t=[]
while True:
    try:
        k=int(input())
        t.append(k)
    except EOFError:
        break
counter=collections.Counter(t)
mode_v=counter.most_common()[0][-1]
it=itertools.takewhile(lambda kv:kv[-1]==mode_v,counter.most_common())
m=(k for k,v in it)
[print(i) for i in m]

Submission status: Accepted

Solution code:
list=[]
while True:
    try:
        a=int(input())
        list.append(a)
    except:
        break
x=[0]*101
for i in list:
    x[i]+=1
m=max(x)
for j in range(100):
    if x[j]==m:
        print(j)

Submission status: Accepted

Solution code:
import collections
import itertools
t=[]
while True:
    try:
        k=int(input())
        t.append(k)
    except EOFError:
        break
counter = collections.Counter(t)
mode_v=counter.most_common()[0][-1]
it=itertools.takewhile(lambda kv:kv[-1]==mode_v,counter.most_common())
m=(k for k,v in it)
[print(i) for i in m]

Submission status: Accepted

Solution code:
lst=[0]*101
while True:
    try:
        x=int(input())
        lst[x]+=1
    except:
        break
ans=max(lst)
for i in range(101):
    if lst[i] == ans:
        print(i)

Submission status: Accepted

Solution code:
a = [0 for i in range(101)]  #101個の0がリストに入ってる
while True:
  try:
    n = int(input())
    a[n] += 1
  except EOFError:
    break
m = 0
for i in range(1, 101):    #最頻値の最頻回数ｍを求めている
  m = max(m, a[i])
for i in range(1, 101): 
    if a[i] == m:          #最頻回数と一致するものをみつけて最頻値を出力
        print(i)

Submission status: Accepted

Solution code:
a=[]
c=[]
while True:
    try:
        a.append(int(input()))
    except:
        break
x=len(a)
for i in range(x):
    b=a.count(i)
    c.append(b)
r=max(c)
e=len([i for i,x in enumerate(c) if x==r])
d=[i for i,x in enumerate(c) if x==r]
for i in range(e):
    print(d[i])

Submission status: Accepted

Solution code:
a = [0]*101

while True:
    try:
        a[int(input())] += 1

    except EOFError:
        break

k = max(a)
for i in range(100):
    if a[i] == k:
        print(i)

Submission status: Accepted

Solution code:
from collections import Counter
a=Counter()
while True:
    try:
        a[int(input())]+=1
    except EOFError:
        break
b=a.most_common()
c=b[0][1]
d=[i[0] for i in b if i[1] == c]
d.sort()
for j in d:
    print(j)

Submission status: Accepted

Solution code:
a = [0]*100
while True:
    try:
        a[int(input())-1]+=1
    except:
        break
[print(i+1) for i in range(100) if a[i] == max(a)]

Submission status: Accepted

Solution code:
x=[0]*100
while True:
    try:
        y=int(input())
        x[y-1]+=1
    except:
        break
z=max(x)
for i in range(100):
   if x[i] == z:
      print(i+1)

Submission status: Accepted

Solution code:
a={}
maxnum = 1
while True:
    try:
        ai = int(input())
        if ai not in a:
            a[ai] = 1
        else:
            a[ai] += 1
            if maxnum < a[ai]:
                maxnum = a[ai]
    except:
        break
b = sorted(a.items())
for key, value in b:
    if maxnum==value:
        print(key)

Submission status: Accepted

Solution code:
x = [0]*101
while True:
 try:
  n = int(input())
  x[n] += 1
 except:
  for i in range(101):
    if x[i] == max(x):
     print(i)
  break

Submission status: Accepted

Solution code:
l = list([0] * 101)
while True:
    try:
        a = int(input())
    except EOFError:
        break
    l[a] += 1
x = max(l)
for i in range(1,101):
    if l[i] ==x:
        print(i)

Submission status: Accepted

Solution code:
import sys
from collections import Counter
list=[]
while True:
    try:
        s = int(input())
        list.append(s)
    except:
        break
c=Counter(list)
mode=c.most_common()
print(mode[0][0])
max=mode[0][1]
i=1
while True:
    if max==mode[i][1]:
        max=mode[i][1]
        print(mode[i][0])
        i+=1
    else:
        break

Submission status: Accepted

Solution code:
import collections

S = []
while True:
    try:
        s = int(input())
        S.append(s)
    except EOFError:
        break

c = collections.Counter(S)
k = 0
a = []

if len(S) == 0:
    pass
else:
    for i in range(len(c)):
        if c.most_common()[i][1] == c.most_common()[i+1][1]:
            k += 1
        else:
            break
    for i in range(k+1):
        a.append(c.most_common()[i][0])
        a.sort()

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

Submission status: Accepted

Solution code:
from collections import Counter
l = []
while True:
    try:
        a=int(input())
    except EOFError:
        break
    l.append(a)
L = sorted(l)
def calculate_mode(L):
    c = Counter(L)
    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)

if __name__ == '__main__':
    data = L
    modes = calculate_mode(L)

    for mode in modes:
        print(mode)

Submission status: Accepted

Solution code:
def get_input():
    while True:
        try:
            yield ''.join(input())
        except EOFError:
            break

n = list(get_input())
maxi = 0
nums = [0 for i in range(101)]

for j in range(len(n)):
    k = int(n[j])
    nums[int(n[j])] += 1
    maxi = max(maxi, nums[k])

for i in range(101):
    if nums[i] == maxi:
        print(i)

Submission status: Accepted

Solution code:
a=[]
while True:
    try:
        a.append(input())
    except:
        break
n=len(a)
m=[0 for i in range(101)]
l=0
for j in range(n):
    k=int(a[j])
    m[k]+=1
    l=max(l,m[k])
    
for i in range(101):
    if m[i]==l:
        print(i)

Submission status: Accepted

Solution code:
l = [0] * 101
while True:
    try:
        n = int(input())
        l[n] += 1
    except EOFError:
        break

max = max(l)
for i in range(101):
    if l[i] == max:
        print(i)

Submission status: Accepted

Solution code:
import collections as co
a = []
while True:
    try:
        n = int(input())
    except:
        break
    a.append(n)
b = co.Counter(a)
c = b.most_common()
N = c[0][1]
maxs =[]
for c2 in c:
    if c2[1] == N:
        maxs.append(c2[0])
    maxs.sort()
d = len(maxs)
for j in range(d):
    print(maxs[j])

Submission status: Accepted

Solution code:
ans = [0]*101
while True:
    try:
        ans[int(input())] += 1
    except EOFError:
        break
printqueue = []
maxi = max(ans)
for i in range(1,101):
    if ans[i] == maxi : printqueue.append(i)
for i in printqueue:
    print(i)

Submission status: Accepted

Solution code:
x=[]
y=[]
z=[]
while True:
    try:
        n=int(input())
        x.append(n)
    except EOFError:
        break
    
Counter = [0] * 101

for n in x:
    Counter[n] += 1
    y.append(Counter[n])
#    print(n)
    
#print(y)
#print(x)

y_len=len(y)
for i in range(y_len):
#    print(i,x[i],y[i])
    if y[i]==max(y):
#        print(x[i])
        z.append(x[i])
#print(z)
z.sort()
z_len=len(z)
for i in range(z_len):
    print(z[i])

Submission status: Accepted

Solution code:
import collections
a = []
while True:
    try:
        n = int(input())
    except EOFError:
        break
    a.append(n)
    
if len(a) != 0:
    b = collections.Counter(a)
    c = b.most_common()
    x = c[0][1]
    d = []
    for elem in c:
        if elem[1] == x:
            d.append(elem[0])
        else:
            break
    d.sort()
    [print(k) for k in d]

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

a = list([0] * 100)

while True :
    try :
        a[int(input())-1] += 1
    except EOFError :
        break
    
x = max(a)
for i in range(100) :
    if a[i] == x :
        print(i+1)

Submission status: Accepted

Solution code:
#50 最頻値

import collections
collections.Counter

x = [0]*101     
while True:
        try:
                x[int(input())] += 1
        except EOFError:
                break           #EOFErrorになったらbreakする
        
max = max(x)
for i in range(101):
        if x[i] == max:
                print(i)

Submission status: Accepted

Solution code:
l=[0]*101
while True:
    try:
        i=int(input())
        l[i]+=1
    except:
        break
M=max(l)
for j in range(1,101):
    if l[j]==M:
        print(j)
    else:
        pass

Submission status: Accepted

Solution code:
lst = [0 for i in range(1,101)]
while True:
    try:
        lst[int(input())]+=1
    except:
        break

m=max(lst)
for i in range(100):
    if m==lst[i]:
        print(i)

Submission status: Accepted

Solution code:
import collections
import itertools
t = []
while True:
    try:
        k=int(input())
        t.append(k)
    except EOFError:
        break
counter = collections.Counter(t)
mode_v=counter.most_common()[0][-1]
it = itertools.takewhile(lambda kv:kv[-1]==mode_v,counter.most_common())
m=(k for k,v in it)
[print(i) for i in m]

Submission status: Accepted

Solution code:
a = [0] * 101
while True:
    try:
        a[int(input())] += 1
    except:
        break
for i in range(101):
    if a[i] == max(a):
        print(i)

Submission status: Accepted

Solution code:
import sys

c = [0]*101
while True:
	try:
		c[int(input())] += 1
	except EOFError:
		break
    	
max = max(c)
for i in range(101):
	if c[i] == max:
		print(i)

Submission status: Accepted

Solution code:
#数字の数を求めるためのリストを作成する
num_list = [0 for i in range(101)]

#"EOFError"がくるまで入力を繰り返し、入力の番号のインデックスを1ふやす
try:
    while True:
        num_list[int(input())] += 1
except EOFError:
    
    #最瀕値の数が出てきた数を変数に代入し最瀕値であれば出力する
    i = max(num_list)
    for j in range(1,101):
        if num_list[j] == i:print(j)

Submission status: Accepted

Solution code:
from collections import Counter
l=[0]*100

while True:
    try:
        x=int(input())
        l[x+1]+=1
    except:
        break
    
for i in range(100):
    if l[i]==max(l):
        print(i-1)
    else:
        pass

Submission status: Accepted

Solution code:
a=[]
while True:
    try:
        x=int(input())
        a.append(x)
    except:
        break
b=[]
for i in range(1,101):
    y=a.count(i)
    b.append(y)
c=[j for j, v in enumerate(b) if v == max(b)]
e=len(c)
for h in range(e):
    print(c[h]+1)

Submission status: Accepted

Solution code:
l=[0]*101
while True:
    try:
        x=int(input())
        l[x]+=1
    
    except:
        max_va=max(l)
        for i in range(101):
            if l[i]==max_va:
                print(i)
        
        break

Submission status: Accepted

Solution code:
a = []
while True:
    try:
        a.append(int(input()))
    except:
        break
b=[0]*101
for i in a:
    b[i] += 1
c = max(b)
for i in range(100):
    if b[i] == c:
        print(i)

Submission status: Accepted

Solution code:
c=[0]*101
while True :
    try : 
        a=int(input())
        c[a]=c[a]+1
    except EOFError :
        break
max=max(c)
for i in range(101):
    if c[i]==max:
        print(i)

Submission status: Accepted

Solution code:
c=[0]*101
while True:
    try :
        a=int(input())
        c[a]+=1
    except EOFError :
        break
    
max=max(c)
for i in range(101):
    if c[i]==max:
        print(i)

Submission status: Accepted

Solution code:
a = []
for i in range(100):
    try:       
        n = int(input())
        a.append(n)
    except:    
        pass

M = 0
b = []
for i in range(100):
    bi = a.count(i)
    #print(bi)
    if bi == M:
        b.append(i)
        M = bi
    elif bi > M:
        b.clear()
        b.append(i)
        M = bi
for i in range(len(b)):
    print(b[i])

Submission status: Accepted

Solution code:
import sys

A = [i+1 for i in range(100)]
B = [0 for i in range(100)]

a = [0 for i in range(100)]

for l in sys.stdin:
    a.append(int(l))

# for i in range(4):
#     a[i] = int(input())

for x in a:
    if x in A:
        B[x-1] += 1

max = max(B)

for i in range(100):
    if  B[i] == max:
        print(i+1)

Submission status: Accepted

Solution code:
x=[]
while True:
    try:
        n=int(input())
        x.append(n)
    except:
        break

c=[0]*101
for i in x:
    c[i]+=1
b=max(c)

for j in range(100):
    if c[j]==b:
        print(j)

Submission status: Accepted

Solution code:
x = []
while True:
    try:
        n=int(input())
        x.append(n)
    except:
        break
c=[0]*101
for i in x:
    c[i] += 1
b=max(c)
for j in range(100):
    if c[j]==b:
        print(j)

Submission status: Accepted

Solution code:
a = [0] * 100

while True :
    try :
        a[int(input())] += 1
    except :
        break
    
x = max(a)


for i in range(100) :
    if a[i] == x :
        print(i)

Submission status: Accepted

Solution code:
# coding: utf-8
# 50
import collections

S = list()
for i in range(100):
    try:
        S.append(int(input()))
    except:
        break

A = list()

for j in range(len(collections.Counter(S).most_common())):
    if collections.Counter(S).most_common()[0][1] == collections.Counter(S).most_common()[j][1]:
        A.append(collections.Counter(S).most_common()[j][0])
A.sort()       
for z in range(len(A)):
    print(A[z])

Submission status: Accepted

Solution code:
#0028
import collections
a = list()
for i in range(100):
    try:
        a.append(int(input()))
    except:
        break
x = collections.Counter(a).most_common()[0][1]
z = collections.Counter(a).most_common()[0][0]

l = []

for j in range(len(collections.Counter(a).most_common())):
    y = collections.Counter(a).most_common()[j][1]
    v = collections.Counter(a).most_common()[j][0]
    if x == y:
        l.append(v)
    else:
        break
l.sort()
for k in range(len(l)):
    print(l[k])

Submission status: Accepted

Solution code:

a = [0]*101

while True:
    try:
        n = int(input())
        a[n] += 1
    except:
        break
    
for i in range(1,101):
    if a[i] == max(a):
        print(i)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

l = [0] * 110

while True:
   try:
      n = int(input())
      l[n] += 1
   except EOFError:
      break

m = max(l)
for i in range(1, 101):
   if l[i] == m:
      print(i)

Submission status: Accepted

Solution code:
while True:
    try:
        alist = []
        while True:
            try:
                a = int(input())
                alist.append(a)
                
            except:
                break
    
        m = min(alist)
        M = max(alist)
        
        if m<1:
            break

        clist = [0]
        saihin = [0]
        for i in range(m,M+1,1):
            c = alist.count(i)
            if c>clist[0]:
                del(clist[0])
                clist.append(c)
                del(saihin[0])
            if c==clist[0]:
                saihin.append(i)

        l = len(saihin)
        for i in range(l):
            if saihin==[]:
                break
            print(saihin[0])
            del(saihin[0])
    
    except:
        break

Submission status: Accepted

Solution code:
a = [0] * 101
while 1:
    try:
        a[int(input())] += 1
    except:
        break
m = max(a)
for i, v in enumerate(a):
    if m == v:
        print(i)

Submission status: Accepted

Solution code:
y=[0]*100
while True:
    try:
        y[int(input())-1]+=1
    except:
        break
    
flag=False
for i in range(100)[::-1]:
    if flag:
        exit()
    for j in range(100):
        if y[j]==i:
            flag=True
            print(j+1)

Submission status: Accepted

Solution code:
mode = []
count = [0 for i in range(100)]
while(1):
	try:
		n = int(input())
		count[n-1] = count[n-1] + 1
	except EOFError:
		max_ = max(count)
		for i in range(100):
			if count[i] == max_:
				mode.append(i+1)
		for i in mode:
			print(i)
		break

Submission status: Accepted

Solution code:
N = []
A = [0 for i in range(100)]

while True :
    try :
        n = int(input())
        N.append(n)
        A[n - 1] += 1
        
    except :
        break
    
m = max(A)

M = [i for i, x in enumerate(A) if x == m]
l = len(M)

for i in range(l) :
    print(M[i] + 1)

Submission status: Accepted

Solution code:
a=[0]*100
while 1:
  try:
    a[int(input())-1]+=1
  except:
    break
[print(i+1)for i in range(100)if a[i]==max(a)]

Submission status: Accepted

Solution code:
# 100まで
cnt = [0] * 101
while True:
    try:
        index = int(input())
        cnt[index] += 1
    except EOFError:
        break
    	
max = max(cnt)
for i in range(100):
	if cnt[i] == max:
		print(i)

Submission status: Accepted

Solution code:
num = [[0,i+1] for i in range(100)]
while True:
    try:
        num[int(input())-1][0] += 1
    except:
        num.sort(reverse = True)
        ans = []
        for i in range(100):
            if num[i][0] == num[0][0]:
                ans.append(num[i][1])
            else:
                ans.sort()
                for z in ans:
                    print(z)
                break
        break

Submission status: Accepted

Solution code:

L = [0] * 101
while True:
    try:
        k = int(input())
        L[k] += 1
    except EOFError:
        break

max = max(L)
for i in range(101):
    if L[i] == max:
        print(i)

Submission status: Accepted

Solution code:
list=[]
while True:
    try:
        x=int(input())
    except:
        break
    list.append(x)

tmp=1
ans=[]
for i in range(100):
    num=0
    for l in range(len(list)):
        if i==list[l]:
            num+=1
    if num>tmp:
        tmp=num
        ans=[i]
    elif num==tmp:
        ans.append(i)
for n in range(len(ans)):
    print(ans[n])

Submission status: Accepted

Solution code:
import sys

arr = []
for i in range(101):
    arr.append(0)
    
maxi = 0

for e in sys.stdin:
    arr[int(e)] += 1
    maxi = max(maxi, arr[int(e)])
    
for i in range(101):
    if arr[i] == maxi:
        print(i)

Submission status: Accepted

Solution code:
a = [0] * 100
while 1:
  try: a[int(input()) - 1] += 1
  except: break
[print(i+1) for i in range(100) if a[i] == max(a)]

Submission status: Accepted

Solution code:
list=[0]*100
while(True):
    try:
        list[int(input())-1]+=1
    except:
        for i in range(100):
            if list[i]==max(list):
                print(i+1)
        break

Submission status: Accepted

Solution code:
import sys
cnt = [0]*101
while True:
    try:
        cnt[int(input())] += 1
    except EOFError:
        break
max = max(cnt)
for i in range(101):
    if cnt[i] == max:
        print(i)

Submission status: Accepted

Solution code:
a=[0]*100
while 1:
    try: a[int(input())-1]+=1
    except: break
[print(i+1) for i in range(100) if a[i]==max(a)]

Submission status: Accepted

Solution code:
import sys
cnt = [0]*101
while True:
  try:
    cnt[int(input())] +=1
  except EOFError:
    break
m = max(cnt)

for i in range(101):
  if cnt[i] == m:
    print(i)

Submission status: Accepted

Solution code:
import sys
cnt = [0] * 101
while True:
    try:
        cnt[int(input())] += 1
    except EOFError:
        break
max = max(cnt)
for i in range(101):
    if cnt[i] == max:
        print(i)

Submission status: Accepted

Solution code:
A=[]
B=[]
C=[]
while True:
  try:
    A.append(int(input()))
  except EOFError:
    break
    
for i in range(len(A)):
  count=0
  for j in range(len(A)):
    if A[i]==A[j]:
      count+=1
  B.append(count)
maxb=max(B)
for i in range(len(A)):
  if B[i]==maxb:
    if A[i] in C:
      pass
    else:
      C.append(A[i])
C.sort()
for i in range(len(C)):
  print(C[i])

Submission status: Accepted

Solution code:
# coding=utf-8

###
### for atcorder program
###

import sys
import math

# math class
class mymath:
    ### pi
    pi = 3.14159265358979323846264338

    ### Prime Number
    def pnum_eratosthenes(self, n):
        ptable = [0 for i in range(n+1)]
        plist = []

        for i in range(2, n+1):
            if ptable[i]==0:
                plist.append(i)
                for j in range(i+i, n+1, i):
                    ptable[j] = 1
        return plist

    ### GCD
    def gcd(self, a, b):
        if b == 0:
            return a
        return self.gcd(b, a%b)

    ### LCM
    def lcm(self, a, b):
        return (a*b)//self.gcd(a,b)

    ### Mat Multiplication
    def mul(self, A, B):
        ans = []
        for a in A:
            c = 0
            for j, row in enumerate(a):
                c += row*B[j]
            ans.append(c)
        return ans

mymath = mymath()

### output class
class output:
    ### list
    def list(self, l):
        l = list(l)
        #print(" ", end="")
        for i, num in enumerate(l):
            print(num, end="")
            if i != len(l)-1:
                print(" ", end="")
        print()

output = output()

### input sample
#i = input()
#N = int(input())
#A, B, C = [x for x in input().split()]
#N, K = [int(x) for x in input().split()]
#inlist = [int(w) for w in input().split()]

#R = float(input())
#A.append(list(map(int,input().split())))

#for line in sys.stdin.readlines():
#    x, y = [int(temp) for temp in line.split()]

#abc list
#abc = [chr(ord('a') + i) for i in range(26)]

### output sample
#print("{0} {1} {2:.5f}".format(A//B, A%B, A/B))
#print("{0:.6f} {1:.6f}".format(R*R*math.pi,R*2*math.pi))
#print(" {}".format(i), end="")

def get_input():
    N = []
    while True:
        try:
            #N.append(input())
            N.append(int(input()))
        except EOFError:
            break
    return N

A = get_input()

N = []
maxnum = -1

for i in A:
    count = 0
    for j in A:
        if i == j:
            count += 1
    if maxnum < count:
        maxnum = count
        N = [i]
    elif maxnum == count:
        N.append(i)

N = set(N)
N = sorted(N)

for i in N:
    print(i)

Submission status: Accepted

Solution code:
if __name__ == '__main__':

	ans = dict()
	while True:
		try:
			n = int(input())

			if n not in ans:
				ans[n] = 1
			else:
				ans[n] += 1

		except EOFError:
			break


	a = max(ans.values())

	A = []
	for d in ans:
		if ans[d] == a:
			A.append(d)

	B = sorted(A)
	for i in B:
		print(i)

Submission status: Accepted

Solution code:
a = [0 for i in range(101)]
while True:
  try:
    n = int(input())
    a[n] += 1
  except EOFError:
    break

m = 0
for i in range(1, 101):
  m = max(m, a[i])
for i in range(1, 101):
  if a[i] == m:
    print(i)

Submission status: Accepted

Solution code:
data = [0 for _ in range(100)]

while True:
  try:
    input_data = int(input())
  except EOFError:
    break
  data[input_data-1] += 1

max_piv = max(data)
for i in range(100):
  if data[i] == max_piv:
    print(i+1)

Submission status: Accepted

Solution code:
import sys

counter = []
for i in range(0, 101):
	counter.append(0)

for line in sys.stdin:
	counter[int(line)] += 1

max = 0
for i in range(0, 101):
	if max < counter[i]: max = counter[i]
for i in range(0, 101):
	if max == counter[i]: print i

Submission status: Accepted

Solution code:

a = [0] * 100
while True:
    try:
        a[int(input()) - 1] += 1
    except:
        break

flag = False
for i in range(100)[::-1]:
    if flag:
        exit()
    for j in range(100):
        if a[j] == i:
            flag = True
            print(j + 1)

Submission status: Accepted

Solution code:
import sys
  
freq = {}

for s in sys.stdin:
    n = int(s.strip())
    if n not in freq:
        freq[n] = 1
    else:
        freq[n] += 1

sortedfreq = sorted(freq.items(), key=lambda x:-x[1])
modes = sorted(filter(lambda x: x[1] == sortedfreq[0][1], sortedfreq), key=lambda x:x[0])
for i in modes:
    print(i[0])

Submission status: Accepted

Solution code:
count_map = {}
while True:
    try:
        i = int(input())
        if i in count_map:
            count_map[i] += 1
        else:
            count_map[i] = 1
    except EOFError:
        break
max_count = max(count_map.values())
mode_values = []
for item in count_map.items():
    if item[1] == max_count:
        mode_values.append(item[0])
for mode in sorted(mode_values):
    print(mode)

Submission status: Accepted

Solution code:
import collections

alist = []

while(1):
    try:
        a = int(input())
    except:
        break
    alist.append(a)

ac = collections.Counter(alist)

cnt = 0
while(1):
    print(ac.most_common()[cnt][0])
    if cnt == len(alist):
        break

    if ac.most_common()[cnt][1] == ac.most_common()[cnt+1][1]:
        cnt += 1
    else:
        break

Submission status: Accepted

Solution code:
import sys
 
count = [0 for _ in range(101)]
mode = 0
 
for s in sys.stdin:
    x = int(s)
    count[x] += 1
    mode = max(mode, count[x])
 
for i in range(101):
    if count[i] == mode:
        print(i)

Submission status: Accepted

Solution code:
import sys
i_f = {}
for line in sys.stdin:
  v = int(line)
  if i_f.get(v) is None:
    i_f[v] = 0
  i_f[v] += 1

ans = {}
for i, f in i_f.items():
  if ans.get(f) is None:
    ans[f] = []
  ans[f].append(i)
ans = [ (a,vs) for a, vs in ans.items() ]
ans = max(ans, key=lambda x:x[0])
#print(ans)

for i in sorted(ans[1]):
  print(i)

Submission status: Accepted

Solution code:
from collections import Counter
a = []
while(True):
    try:
        a.append(int(input()))
    except:
        c = Counter(a)
        d = c.most_common()
        print("\n".join(str(e[0]) for e in d if e[1] == d[0][1]))
        break

Submission status: Accepted

Solution code:
import sys

def solve():
    A = [0 for _ in range(101)]
    for i in sys.stdin:
        a = int(i)
        A[a] += 1
    
    M = max(A)
    for i, a in enumerate(A):
        if a == M:
            print(i)

if __name__ == "__main__":
    solve()

Submission status: Runtime Error

Solution code:

hist = [0 for i in range(100)]

l = []
while True:
  try:
    hist[input() - 1] += 1
  except:
    break;

for k in filter(lambda x: max(hist) == x[1], enumlate(hist)):
  print k[0] + 1

Submission status: Runtime Error

Solution code:
import sys

count = [0 for _ in range(100)]
mode = [0]

for s in sys.stdin:
    x = int(s)
    count[x-1] += 1

for i in range(len(count)):
    if count[i] > mode[0]:
        mode.clear()
        mode.append(i+1)
    elif count[i] == mode[0]:
        mode.append(i+1)

for i in mode:
    print(i)

Submission status: Runtime Error

Solution code:
import sys

count = [0 for _ in range(101)]
mode = [0]

for s in sys.stdin:
    x = int(s)
    count[x] += 1

for i in range(len(count)):
    if count[i] > mode[0]:
        mode.clear()
        mode.append(i)
    elif count[i] == mode[0]:
        mode.append(i)

for i in mode:
    print(i)

Submission status: Runtime Error

Solution code:

import sys
def max(count):
   m = count[0]
   for i in range(1,len(count)):
       if count[i] > m:
           m = count[i]
   return m
list = []
count = []
mode = 0
for i in range(10):
   count.append(0)
   list.append('m')
for line in sys.stdin.readlines():
   num = int(line)
   if num not in list:
       list[num] = num
       count[num] = count[num] + 1
   else:
       count[num] = count[num] + 1
m = max(count)
print("max is",m)
for i in range(len(count)):
   if m == count[i]:
       print(list[i])