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: Wrong Answer

Solution code:
dic={}
while True:
    try:
        n = int(raw_input())
        if n not in dic:
            dic[n] = 1
        else:
            dic[n] += 1
    except:
        break
        
mode = []
m = 0 
for k,v in sorted(dic.items(),key = lambda x:x[1],reverse=True): 
    if m==0:
        mode.append(k)
        m +=1
    if v == dic[mode[-1]] and k!=mode[-1]:
        mode.append(k)
    else:
        break
        
for i in range(len(mode)):
    print mode[i]

Submission status: Wrong Answer

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

num=[]
for i in range(10):
	num.append((A.count(i),i))

num.sort(reverse=True)
mode_value=num[0][0]
B=[]
for i in num:
	if i[0]==mode_value:
		B.append(i[1])
		
B.reverse()
for i in B:
	print(i)

Submission status: Wrong Answer

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

num=[]
for i in range(10):
	num.append((A.count(i),i))

num.sort(reverse=True)
mode_value=num[0][0]
B=[]
for i in num:
	if i[0]==mode_value:
		B.append(i[1])
		
B.sort()
for i in B:
	print(i)

Submission status: Wrong Answer

Solution code:
a, md = [], []
c, mx = 1, 1
while True:
    try:
        a.append(int(input()))
    except EOFError:
        break
a = sorted(a)
print(a)
for i in range(0, len(a) - 1):
    if a[i] == a[i + 1]:
        c += 1
    else:
        c = 1
    if mx < c:
        mx = c
        md = [a[i]]
    elif mx == c:
        md.append(a[i])
print('\n'.join(map(str, md)))

Submission status: Wrong Answer

Solution code:
a, md = [], []
c, mx = 1, 1
while True:
    try:
        a.append(int(input()))
    except EOFError:
        break
a = sorted(a)
print(a)
for i in range(0, len(a) - 1):
    if a[i] == a[i + 1]:
        c += 1
    else:
        c = 1
    if mx < c:
        mx = c
        md = [a[i]]
    elif mx == c:
        md.append(a[i])
print('\n'.join(map(str, sorted(md))))

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

DICT = {k: 0 for k in range(0, 10)}

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

tmp = None
for k, v in DICT.items():
    if v != tmp:
        break

    print(k)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

DICT = {k: 0 for k in range(0, 10)}


def solve(d):
    _max = max(d.values())
    for k, v in d.items():
        if _max == v:
            print(k)

if __name__ == '__main__':
    while True:
        try:
            n = int(input())
            DICT[n] += 1
        except:
            break

    solve(DICT)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

DICT = {k: 0 for k in range(0, 10)}


def solve(d):
    l = []
    _max = max(d.values())
    for k, v in d.items():
        if _max == v:
            l.append(k)
    print('\n'.join(str(e) for e in l), end='')

if __name__ == '__main__':
    while True:
        try:
            n = int(input())
            DICT[n] += 1
        except:
            break

    solve(DICT)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

DICT = {k: 0 for k in range(1, 10)}


def solve(d):
    l = []
    _max = max(d.values())
    for k, v in sorted(d.items()):
        if _max == v:
            l.append(k)
    print('\n'.join(str(e) for e in l), end='')

if __name__ == '__main__':
    while True:
        try:
            n = int(input())
            DICT[n] += 1
        except:
            break

    solve(DICT)

Submission status: Wrong Answer

Solution code:
numdict = dict()
while True:
	try:
		num = input()
		if num not in numdict:
			numdict[num] = 0
		else:
			numdict[num] += 1
	except EOFError:
		break
most = max(numdict.values())
for key in numdict:
	if most == numdict[key]:
		print(key)

Submission status: Wrong Answer

Solution code:
numdict = dict()
while True:
	try:
		num = input()
		if num not in numdict:
			numdict[num] = 0
		else:
			numdict[num] += 1
	except EOFError:
		break
most = max(numdict.values())
mostlist = list()
for key in numdict:
	if most == numdict[key]:
		mostlist.append(key)
mostlist.sort()
for item in mostlist:
	print(item)

Submission status: Wrong Answer

Solution code:
import sys
from collections import Counter


if __name__ == '__main__':
    # ??????????????\???
    # data = [5, 6, 3, 5, 8, 7, 5, 3, 9, 7, 3, 4]
    data = []
    for line in sys.stdin:
        data.append(int(line.strip()))
    print(data)

    # ?????????????¢????
    c = Counter(data)
    max_freq = c.most_common(1)[0][1]  # ???????????????????????°????¨???¶
    modes = []
    for val, freq in c.most_common():
        if freq != max_freq:
            break
        modes.append(val)

    # ???????????¨???
    modes.sort()
    for i in modes:
        print(i)

Submission status: Wrong Answer

Solution code:
import sys
from itertools import dropwhile
a = []
try:
    for v in sys.stdin:
        a.append(int(v))

except:
    m = max([a.count(v) for v in set(a)])
    next(dropwhile(lambda x: True, (print(v) for v in set(a) if a.count(v) == m)))

Submission status: Wrong Answer

Solution code:
import sys
array = []
array2 = []
num = 0
for i in sys.stdin.readlines():
    array.append(int(i))
for i in range(len(array)):
    if i == 0:
        a = 0
    elif array.count(array[i]) > a:
        num = array.count(array[i])
        a = array.count(array[i])
for i in range(len(array)):
    if array.count(array[i]) == num:
        array2.append(array[i])
array2 = list(set(array2))
for i in range(len(array2)):
    print(array2[i])

Submission status: Wrong Answer

Solution code:
import sys
from collections import defaultdict
d = defaultdict(int)
for i in sys.stdin:
    d[i] +=1
l = sorted([(k, v) for k, v in d.items()], key=lambda x:x[1], reverse=True)
print(l[0][0])
print(l[1][0])

Submission status: Wrong Answer

Solution code:
import sys
from collections import defaultdict
d = defaultdict(int)
for i in sys.stdin:
    d[i] +=1
m = max(v for v in d.values())
for _ in sorted([k for k, v in d.items() if v == m]):
    print(_)

Submission status: Wrong Answer

Solution code:
memo, max_value = {}, 0
while True :
    try :
        temp = input()
        if temp in memo : memo[temp] = memo[temp] + 1
        else : memo[temp] = 1
        if max_value < memo[temp] : max_value = memo[temp]
    except : break
for result, value in memo.items() :
    if max_value == value : print(result)

Submission status: Wrong Answer

Solution code:
memo, max_value = {}, 0
while True :
    try :
        temp = input()
        if temp in memo : memo[temp] = memo[temp] + 1
        else : memo[temp] = 1
        if max_value < memo[temp] : max_value = memo[temp]
    except : break
temp = []
for result, value in memo.items() :
    if max_value == value : temp.append(result)
temp.sort()
for _ in temp : print(_)

Submission status: Wrong Answer

Solution code:
import sys
a = {}
ma = 0
m = []
for u in sys.stdin:
    i = int(u)
    if not (i in a):
        a[i] = 1
    else:
        a[i] += 1
    if ma <= a[i]:
        if ma < i:
            ma = a[i]
            m.clear()
        m.append(i)
m = sorted(m)
for k in m:
    print(k)

Submission status: Wrong Answer

Solution code:
import sys

def ModeValue():
    mode=[0 for i in range(0,101)]

    try:
        for n in sys.stdin:
            mode[int(n)]+=1
    except EOFError:
            a=1  
    maxN=max(mode)

    for i in mode:
        if mode[i]>maxN:
            print(i)
            
ModeValue()

Submission status: Wrong Answer

Solution code:
import sys
 
def ModeValue():
    mode=[0 for i in range(0,101)]
    
    for n in sys.stdin:
        mode[int(n)]+=1

    maxN=max(mode)

    for i in mode:
        if mode[i]>maxN:
            print(i)
            
ModeValue()

Submission status: Wrong Answer

Solution code:
import sys
 
def ModeValue():
    mode=[0 for i in range(0,101)]
    
    for n in sys.stdin:
        mode[int(n)]+=1

    maxN=max(mode)

    for i in mode:
        if mode[i]==maxN:
            print(i)
            
ModeValue()

Submission status: Wrong Answer

Solution code:
# 0028
import collections
array = []
i = 0
while True:
    try:
        array.append(int(input()))
        i += 1
    except EOFError:
        break
count = list(map(lambda a: array.count(a), array))
modes = list(set(filter(lambda a: array.count(a) == max(count), array)))
print(*modes, sep = '\n')

Submission status: Wrong Answer

Solution code:
# 0028
import collections
array = []
i = 0
while True:
    try:
        a = input()
        array.append(int(a))
        i += 1
    except EOFError:
        break
count = list(map(lambda a: array.count(a), array))
modes = list(set(filter(lambda a: array.count(a) == max(count), array)))
print(*modes, sep = '\n')

Submission status: Wrong Answer

Solution code:
# 0028
import collections
array = []
while True:
    try:
        a = input()
        array.append(int(a))
    except EOFError:
        break
count = list(map(lambda a: array.count(a), array))
modes = list(set(filter(lambda a: array.count(a) == max(count), array)))
print(*modes, sep = '\n')

Submission status: Wrong Answer

Solution code:
# 0028
import collections
array = []
while True:
    try:
        a = input()
        if a == '': break
        array.append(int(a))
    except EOFError:
        break
count = list(map(lambda a: array.count(a), array))
modes = list(set(filter(lambda a: array.count(a) == max(count), array)))
print(*modes, sep = '\n')

Submission status: Wrong Answer

Solution code:
# 0028
array = []
while True:
    try:
        a = input()
        if a == '': break
        array.append(int(a))
    except EOFError:
        break
count = list(map(lambda a: array.count(a), set(array)))
modes = [array[i] for i, x in enumerate(count) if x == max(count)]
print(*sorted(modes), sep = '\n')

Submission status: Wrong Answer

Solution code:
# 0028
array = []
while True:
    try:
        a = input()
        array.append(int(a))
    except EOFError:
        break
count = list(map(lambda a: array.count(a), set(array)))
modes = [array[i] for i, x in enumerate(count) if x == max(count)]
print(*sorted(modes), sep = '\n')

Submission status: Wrong Answer

Solution code:
# 0028
array = []
while True:
    try:
        a = input()
        if a == '': break
        array.append(int(a))
    except EOFError:
        break
count = list(map(lambda a: array.count(a), set(array)))
modes = list(array[i] for i, x in enumerate(count) if x == max(count))
print(*sorted(modes), sep = '\n')

Submission status: Wrong Answer

Solution code:
# 0028
array = []
while True:
    try:
        a = input()
        array.append(int(a))
    except EOFError:
        break
s = set(array)
count= list(map(lambda a: array.count(a), s))
mx = max(count)
modes = list(array[i] for i, x in enumerate(count) if x == mx)
print(*sorted(modes), sep = '\n')

Submission status: Wrong Answer

Solution code:
array = [0 for x in range(100)]
while True:
    try:
        n = input()
        array[n-1] +=1
        for i in range(len(array)):
            if array[i] == max(array):
                print i+1
    except EOFError:break

Submission status: Wrong Answer

Solution code:
import sys
l = []
c = list([0] * 100)
for i in sys.stdin.readlines():
    c[int(i) - 1] += 1
m = max(c)
for i in xrange(c.count(m)):
    i = c.index(m)
    print i + 1
    c.pop(i)

Submission status: Wrong Answer

Solution code:
import sys
m={}
for line in sys.stdin.readlines():
    p=int(line.rstrip())
    m.setdefault(p,0)
    m[p]+=1

x=sorted(m.items(),key=lambda x:x[1],reverse=True)
print x[0][0]

n=0
for i in range(len(x)-1):
    n=i
    now=x[i][1]
    next=x[i+1][1]
    if now!=next: break
print x[n][0]

Submission status: Wrong Answer

Solution code:
import sys
m={}
for line in sys.stdin.readlines():
    p=int(line.rstrip())
    m.setdefault(p,0)
    m[p]+=1

x=sorted(m.items(),key=lambda x:x[1],reverse=True)
tmp=x[0][0]
x=[v for v,k in x if tmp == k]
x.sort()
for l in x:
    print l

Submission status: Accepted

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

Submission status: Accepted

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], enumerate(hist)):
  print k[0] + 1

Submission status: Accepted

Solution code:
count = [0] * 101
while(True):
    try:
        s = input()
        count[s] += 1
    except Exception:
        break   
maxCount = 0
for i in range(len(count)):
    if(maxCount < count[i]):
        maxCount = count[i]
for i in range(len(count)):
    if(maxCount == count[i]):
        print(i)

Submission status: Accepted

Solution code:
count = [0] * 101
maxCount = 0
while(True):
    try:
        s = input()
        count[s] += 1
        if(maxCount < count[s]):
            maxCount = count[s]
    except Exception:
        break   
for i in range(len(count)):
    if(maxCount == count[i]):
        print(i)

Submission status: Accepted

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

import sys
from datetime import date

n = [0]*101
for s in sys.stdin:
  d = int(s)
  n[d] += 1
m = max(n)
for i in [ j for j in range(len(n)) if n[j] == m ]:
  print i

Submission status: Accepted

Solution code:
import sys
num_max = 0
frequency = [0] * 101
for line in sys.stdin:
    num = int(line)
    frequency[num] += 1
    num_max = max(num_max, frequency[num])
for i in range(len(frequency)):
    if num_max == frequency[i]:
        print(i)

Submission status: Accepted

Solution code:
dic={}
while True:
    try:
        n = int(raw_input())
        if n not in dic:
            dic[n] = 1
        else:
            dic[n] += 1
    except:
        break
        
mode = []
m = 0 
for k,v in sorted(dic.items(),key = lambda x:x[1],reverse=True): 
    if m==0:
        mode.append(k)
        m +=1
    if v == dic[mode[-1]] and k!=mode[-1]:
        mode.append(k)
        
for i in range(len(mode)):
    print mode[i]

Submission status: Accepted

Solution code:
list=[0]*100
while True:
    try:
        n=int(input())
    except:
        break
    list[n-1]+=1

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

Submission status: Accepted

Solution code:
import sys
integer=[0]*101
for dataset in sys.stdin:
    integer[int(dataset)]+=1

max=list(integer)
max.sort()
smax=max.pop()
solve=[i for i in range(101) if integer[i]==smax]
while len(solve)!=0:
    print solve.pop(0)

Submission status: Accepted

Solution code:

import sys
import math

l=[]
for i in range(101):
    l.append(0)
while 1:
    try:
        a = int(raw_input())
        l[a] += 1
    except:
        flag = 0
        for i in range(101):
            flag = max(flag, l[i])
        for i in range(101):
            if l[i] == flag:
                print i
        break

Submission status: Accepted

Solution code:
dic = {}
while True:
    try:
        num = int(raw_input())
        if not num in dic:
            dic[num] = 1
        else:
            dic[num] = dic[num] + 1
          
    except EOFError:
        max_num = 0
        index = 0
        for k, v in sorted(dic.items(), key=lambda x: x[1], reverse=True):
            if index == 0:
                max_num = v
            if max_num != v:
                break
            print k
            index += 1
        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:
l=[0]*101
while 1:
    try:
        n=int(raw_input())
        l[n]+=1
    except:
        break
chk=max(l)
for i,j in enumerate(l):
    if j==chk:
         print i

Submission status: Accepted

Solution code:
# -*- coding:utf-8 -*-

def main():
    LIST=[]

    while True:
        try:
            N=int(input())
            flag=True
            for item in LIST:
                if item[0]==N:
                    index=LIST.index(item)
                    flag=False

            if flag:
                LIST.append([N,1])
            else:
                LIST[index][1]+=1


        except:
            break
    m=0
    for i in LIST:
        m=max(m,i[1])
    ans=sorted([x for x in LIST if x[1]==m],key=lambda x:x[0])
    for i in ans:
        print(i[0])

    
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
l = []
max_c = 0
n = []
for i in sys.stdin.readlines():
  l.append(int(i))
  if l.count(int(i)) == max_c:
    n.append(int(i))
  elif l.count(int(i)) > max_c:
    n = [int(i)]
    max_c = l.count(int(i))
n.sort()
for i in n:
  print(i)

Submission status: Accepted

Solution code:
from math import *
PI = 3.1415926535898
res = [0]*111
arr = []
ans = 0
while True:
	try:
		n = input()
		res[n] += 1
		arr.append(n)
	except EOFError:
		break
ma = max(res)
for i in range(101):
	if arr.count(i) == ma:
		print i

Submission status: Accepted

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

num=[]
for i in range(101):
	num.append((A.count(i),i))

num.sort(reverse=True)
mode_value=num[0][0]
B=[]
for i in num:
	if i[0]==mode_value:
		B.append(i[1])
		
B.sort()
for i in B:
	print(i)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#encoding=utf-8

import sys

num, ans = [], []
for i in sys.stdin:
	num.append(int(i))
for i in xrange(1,101):
    ans.append(num.count(i))

for i in xrange(1,100):
    if max(ans) == ans[i]:
        print i + 1

Submission status: Accepted

Solution code:
import collections
import sys
cntr = collections.Counter()
for line in sys.stdin:
    cntr[int(line)] += 1
lst = []
for k,v in cntr.items():
    lst.append((v,k))
lst.sort()
t = len(lst)-1
while t>0 and lst[t][0] == lst[t-1][0]:
    t -= 1
for i in range(t,len(lst)):
    print(lst[i][1])

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

import sys

dic = {}
for line in sys.stdin:
    i = int(line)
    if i not in dic:
        dic[i] = 1
    else:
        dic[i] += 1
Max = 0
for i in dic:
    Max = max(Max, dic[i])
ans = []
for i in dic:
    if dic[i] == Max:
        ans.append(i)
ans.sort()
for i in ans:
    print i

Submission status: Accepted

Solution code:
import sys
S = sys.stdin.readlines()
cnt = [0] * 101
for s in S:
    n = int(s)
    cnt[n] += 1
m = max(cnt)
n = cnt.count(m)
p = 0
for i in range(n):
    p = cnt.index(m)
    print(p)
    cnt[p] = 0

Submission status: Accepted

Solution code:
m=[0]*100
while 1:
    try:
        n=input()
        m[n-1]+=1
    except:
        break
mmax=max(m)
for i in xrange(100):
    if m[i]==mmax:
        print(i+1)

Submission status: Accepted

Solution code:
import sys
d = {}
for l in sys.stdin.readlines():
    d[int(l)] = d.get(int(l), 0) + 1
l = sorted(d, key=d.get)
n = d[l[-1]]
for x in l:
    if d[x] == n:
        print(x)

Submission status: Accepted

Solution code:

import sys
arr = {}
for i in sys.stdin:
    if int(i) in arr:
        arr[int(i)] += 1
    else:
        arr[int(i)] = 1
max = 0
ans = []
for i in arr.keys():
    if arr[i] > max:
        ans = [i]
        max = arr[i]
    elif arr[i] == max:
        ans.append(i)
for i in ans:
    print(i)

Submission status: Accepted

Solution code:
from collections import Counter

c = Counter()

try:
    while 1:
        c[int(input())] += 1
except:
    pass

m = c.most_common(1)[0][1]
r = [n for n in c if c[n] == m]
r.sort()
for v in r:
    print(v)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

DICT = {k: 0 for k in range(1, 101)}


def solve(d):
    _max = max(d.values())
    for k, v in sorted(d.items()):
        if _max == v:
            print(k)

if __name__ == '__main__':
    while True:
        try:
            n = int(input())
            DICT[n] += 1
        except:
            break

    solve(DICT)

Submission status: Accepted

Solution code:
h = {}
while True:
	try:
		a = int(input())
		if a in h:
			h[a] += 1
		else:
			h[a] = 1
	except EOFError:
		break
#print(h)
l = [(mode, 10000 - num) for num, mode in h.items()]
l.sort(reverse=True)
max_mode, num = l[0]
print(10000 - num)
for i in range(1,1000):
	if l[i][0] != max_mode: break
	mode, num = l[i]
	print(10000-num)

Submission status: Accepted

Solution code:
l = [0] * 101

while True:

  try:
    n = int(raw_input())
    l[n] += 1

  except EOFError:
    break

max_num = max(l)

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

Submission status: Accepted

Solution code:
numdict = dict()
while True:
	try:
		num = input()
		if num not in numdict:
			numdict[num] = 0
		else:
			numdict[num] += 1
	except EOFError:
		break
most = max(numdict.values())
mostlist = list()
for key in numdict:
	if most == numdict[key]:
		mostlist.append(int(key))
mostlist.sort()
for item in mostlist:
	print(item)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
from collections import Counter

C = Counter(int(line.rstrip()) for line in sys.stdin)
m = max(C.values())
for k in sorted(C.keys()):
    if C[k] == m:
        print k

Submission status: Accepted

Solution code:
import sys
import collections


l = []
for line in sys.stdin:
    l.append(int(line))
counted = collections.Counter(l).most_common()
maxv = counted[0][1]
for k, v in counted:
    if v == maxv:
        print(k)
    else:
        break

Submission status: Accepted

Solution code:
import sys
import collections


l = []
for line in sys.stdin:
    l.append(int(line))
counted = collections.Counter(l).most_common()
maxv = counted[0][1]
for k, v in counted:
    if v == maxv:
        print(k)

Submission status: Accepted

Solution code:
kosu = [0] * 100
k = 1
while True:
    try:
        n = int(input())
        kosu[n - 1] += 1
    except (EOFError,ValueError):
        ma = max(kosu)
        num = kosu.index(ma) + k
        print(num)
        
        
        kosu.remove(max(kosu))
        while True:
            if ma > max(kosu):
                break
            k += 1
            num = kosu.index(ma) + k
            kosu.remove(max(kosu))
            print(num)
        break

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
from collections import Counter


if __name__ == '__main__':
    # ??????????????\???
    # data = [5, 6, 3, 5, 8, 7, 5, 3, 9, 7, 3, 4]
    data = []
    for line in sys.stdin:
        data.append(int(line.strip()))
    # print(data)

    # ?????????????¢????
    c = Counter(data)
    max_freq = c.most_common(1)[0][1]  # ???????????????????????°????¨???¶
    modes = []
    for val, freq in c.most_common():
        if freq != max_freq:
            break
        modes.append(val)

    # ???????????¨???
    modes.sort()
    for i in modes:
        print(i)

Submission status: Accepted

Solution code:
import sys
from itertools import dropwhile
a = []
for v in sys.stdin:
    a.append(int(v))

m = max([a.count(v) for v in set(a)])
try:
    next(dropwhile(lambda x: True, (print(v) for v in set(a) if a.count(v) == m)))
except StopIteration:
    pass

Submission status: Accepted

Solution code:
from collections import defaultdict as dd
a=dd(int)
freq=0
while True:
    try:
        b=int(input())
    except:
        break
    a[b]+=1
    if freq<a[b]:
        freq=a[b]
ans=sorted([i for i,j in a.items() if j==freq])
for i in ans:
    print(i)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding:utf-8 -*-
array = []
while True:
    try:
        a = int(input())
        array.append(a)
    except EOFError:
        break

data = [0]*101
for i in range(len(array)):
    data[array[i]] += 1
    
m = [i for i,j in enumerate(data) if j == max(data)]
for i in range(len(m)):
    print(m[i])

Submission status: Accepted

Solution code:
import sys

d={}
mode=0

while True:
  n = sys.stdin.readline()
  if not n: break
  n = int(n)
  if d.has_key(n):
    d[n] = d[n]+1
  else:
    d[n] = 1
  if mode < d[n]:
    mode = d[n]

for k in d.keys():
  if d[k] == mode:
    print(k)

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 operator
h = {}   
while True:
    try:
        i = int(input())
        if i in h:
            h[i] += 1
        else:
            h[i] = 0
    except EOFError:
        break

h1=sorted(h.items(),key=operator.itemgetter(1),reverse=1)
val = h1[0][1]
h2 = sorted(filter(lambda x:x[1]==val, h1))
for i in h2:
    print(i[0])

Submission status: Accepted

Solution code:
import sys

counter = [0 for i in range(101)]

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

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

Submission status: Accepted

Solution code:
import sys
c=[0 for i in range(101)]
for n in sys.stdin:
	n=int(n)
	c[n]+=1
m=max(c)
for i in range(101):
	if c[i]==m:
		print i

Submission status: Accepted

Solution code:
import sys
c=[0]*101
for n in sys.stdin:
	n=int(n)
	c[n]+=1
m=max(c)
for i in range(101):
	if c[i]==m:
		print i

Submission status: Accepted

Solution code:
import sys
c=[0]*101
for n in sys.stdin:
	c[int(n)]+=1
m=max(c)
for i in range(101):
	if c[i]==m:
		print i

Submission status: Accepted

Solution code:

import sys

if __name__ == '__main__':

    nums = []
    piles = [0 for i in range(0,101)]

    for n in sys.stdin:
        if n == "\n":
            break
        else :
            nums.append(int(n))

    for n in nums:
        piles[n] += 1


    maxnum = 0
    for p in piles:
        if maxnum < p:
            maxnum = p

    for i,p in enumerate(piles):
        if maxnum == p:
            print(i)

Submission status: Accepted

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

cnt = [0] * 101
for i in A:
    cnt [i] += 1

mx = max(cnt)

for i in range(1,101):
    if cnt [i] == mx:
        print(i)

Submission status: Accepted

Solution code:
import sys
from collections import defaultdict
d = defaultdict(int)
for i in sys.stdin:
    d[int(i)] +=1
m = max(v for v in d.values())
for i in sorted([k for k, v in d.items() if v == m]):
    print(i)

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 elm in printqueue:
    print(elm)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

import sys
import os
import datetime

d = {}
for s in sys.stdin:
    v = int(s)

    if v not in d:
        d[v] = 1
    else:
        d[v] += 1

max_value = max(d.values())

for key in d.keys():
    if d[key] == max_value:
        print(key)

Submission status: Accepted

Solution code:
cnt = []
for i in range(0, 101):
	cnt.append(0)

while True:
	try:
		n = int(raw_input())
		cnt[n] += 1
	except:
		break

tmp = 0
lst = []
for i in range(1, 101):
	if tmp < cnt[i]:
		tmp = cnt[i]
		lst = [i]
	elif tmp == cnt[i]:
		lst.append(i)

for i in range(0, len(lst)):
	print lst[i]

Submission status: Accepted

Solution code:
import sys
from collections import Counter
v = Counter([int(i) for i in sys.stdin.readlines()]).most_common()
j = [print(i) for i in sorted([k for k, l in v if l == v[0][1]])]

Submission status: Accepted

Solution code:
import sys
d = {i:0 for i in range(1, 101)}
for n in sys.stdin:
    if n == "\n":
        break
    else:
        d[int(n)] += 1
sort = sorted(d.items(), key=lambda x: x[1], reverse=True)
mode = sort[0]
for n in sort:
    if mode[1] == n[1]:
        print(n[0])

Submission status: Accepted

Solution code:
import sys
a = {}
ma = 0
m = []
for u in sys.stdin:
    i = int(u)
    if not (i in a):
        a[i] = 1
    else:
        a[i] += 1
    # ???????????§????????±???
    if ma <= a[i]:
        if ma < a[i]:
            ma = a[i]
            m.clear()
        m.append(i)
m = sorted(m)
for k in m:
    print(k)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# Aizu Problem 0028: Mode Value
#
import sys, math, os

# read input:
PYDEV = os.environ.get('PYDEV')
if PYDEV=="True":
    sys.stdin = open("sample-input.txt", "rt")


counts = {}
while True:
    try:
        a = int(input())
    except EOFError:
        break
    counts[a] = counts.get(a, 0) + 1

for a in sorted([a for a in counts if counts[a] == max(counts.values())]):
    print(a)

Submission status: Accepted

Solution code:
import sys
 
def ModeValue():
    mode=[0 for i in range(0,101)]
    
    for n in sys.stdin:
        mode[int(n)]+=1

    maxN=max(mode)

    for i in range(0,101):
        if mode[i]==maxN:
            print(i)
            
ModeValue()

Submission status: Accepted

Solution code:
d={}
try:
    while True:
        n=int(input())
        if n in d:
            d[n]+=1
        else:
            d[n]=1
except EOFError:
    pass
a=[]
m=max(d.values())
for key, value in d.items():
    if value == m:
        a.append(key)
a.sort()
for i in a:
    print(i)

Submission status: Accepted

Solution code:
d={}
try:
    while True:
        n=int(raw_input())
        if n in d:
            d[n]+=1
        else:
            d[n]=1
except EOFError:
    pass
a=[]
m=max(d.values())
for key, value in d.items():
    if value == m:
        a.append(key)
a.sort()
for i in a:
    print i

Submission status: Accepted

Solution code:
import sys
nums = map(int, sys.stdin)
counter = [0 for i in range(101)]
for n in nums:
	counter[n] += 1
m = max(counter)
for i in range(101):
	if m == counter[i]:
		print i