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: 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)
for i in range(len(count)):
   if m == count[i]:
       print(list[i])

Submission status: Runtime Error

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: Runtime Error

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: Runtime Error

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(l))

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

    solve(DICT)

Submission status: Runtime Error

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)

Submission status: Runtime Error

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)])
next(dropwhile(lambda x: True, (print(v) for v in set(a) if a.count(v) == m)))

Submission status: Runtime Error

Solution code:
# -*- coding:utf-8 -*-
import sys
array = []
for i in sys.stdin:
    array.append(int(i))

data = [0]*100
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: Runtime Error

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

Submission status: Runtime Error

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

max = max(arr)
for i in for(0,101):
    if arr[i]==max:
        print(i)

Submission status: Runtime Error

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.value())
for key, value in d:
    if value == m:
        a.append(key)
a.sort()
for i in a:
    print(i)

Submission status: Runtime Error

Solution code:
# 0028
import collections
array = [0]*100
i = 0
while True:
    a = input()
    if a == '': break
    array[i] = int(a)
    i += 1
array = filter(lambda a: a != 0, array)
counter = collections.Counter(array).most_common()
for a, count in counter:
    if count < counter[0][1]: break
    print(a)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
# 0028
import collections
array = []
i = 0
while True:
    try:
        array.append(int(input()))
        i += 1
    except ValueError:
        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: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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: Runtime Error

Solution code:
d=[0]*101

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

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

Submission status: Runtime Error

Solution code:
nums = []
val = []

while True:
	try:
		nums.append(int(raw_input()))
	except EOFError:
		num_list = sorted(list(set(nums)))
		for n in num_list:
			val.append(nums.count(n))
		ans.append(num_list[val.index(max(val))])
		tmp = max(val)
		val.remove(max(val))
		while max(val) == tmp:
			ans.append(num_list[val.index(max(val))])
			val.remove(max(val))
		for s in ans:
			print s
		break

Submission status: Runtime Error

Solution code:
nums = []
val = []
ans = []

while True:
	try:
		nums.append(int(raw_input()))
	break:
		num_list = sorted(list(set(nums)))
		for n in num_list:
			val.append(nums.count(n))
		ans.append(num_list[val.index(max(val))])
		tmp = max(val)
		val.remove(max(val))
		num_list.pop(val.index(tmp))
		while max(val) == tmp:
			ans.append(num_list[val.index(max(val))])
			num_list.pop(val.index(tmp))
			val.remove(max(val))
		for s in ans:
			print s

Submission status: WA: Presentation Error

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

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


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)