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 a i (1 ≤ a i ≤ 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.

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

Solution (Python):

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

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

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

Solution (Python):



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

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

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

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

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

Solution (Python):

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

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

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

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

Solution (Python):


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

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

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

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

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

Solution (Python):


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

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

Solution (Python):


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

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

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

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

Solution (Python):

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)

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

Solution (Python):


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)

Solution (Python):
h = {}
while True:
	try:
		a = int(input())
		if a in h:
			h[a] += 1
		else:
			h[a] = 1
	except EOFError:
		break

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)

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

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

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

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

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

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

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

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

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

Solution (Python):
import sys
from collections import Counter


if __name__ == '__main__':
    
    
    data = []
    for line in sys.stdin:
        data.append(int(line.strip()))
    

    
    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)

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

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

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

Solution (Python):

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])

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

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

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

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

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

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

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

Solution (Python):

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)

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

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

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

Solution (Python):


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)

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

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

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

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

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

Solution (Python):


import sys, math, os


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)

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

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

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

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

Solution (Python):

import collections
array = [0]*100
i = 0
while True:
    try:
        a = input()
        array[i] = int(a)
        i += 1
    except EOFError:
        break
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)

Solution (Python):

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(filter(lambda a: array.count(a) == max(count), set(array)))
print(*modes, sep = '\n')

Solution (Python):

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

Solution (Python):

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), set(array))))
for a in sorted(s):
    if array.count(a) == mx:
        print(a)

Solution (Python):

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)))
for a in sorted(s):
    if array.count(a) == mx:
        print(a)

Solution (Python):

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)))
for a in sorted(s):
    if array.count(a) == mx:
        print(a)

Solution (Python):

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)))
for a in sorted(s):
    if array.count(a) == mx:
        print(a)

Solution (Python):

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')

Solution (Python):

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')

Solution (Python):

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(list(s)[i] for i, x in enumerate(count) if x == mx)
print(*sorted(modes), sep = '\n')

Solution (Python):

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(list(s)[i] for i, x in enumerate(count) if x == mx)
print(*sorted(modes), sep = '\n')

Solution (Python):

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(list(s)[i] for i, x in enumerate(count) if x == mx)
print(*modes, sep = '\n')

Solution (Python):

array = []
while True:
    try:
        a = input()
        array.append(int(a))
    except EOFError:
        break
s = set(array)
mx = array.count(max(array, key = array.count))
for a in sorted(s):
    if array.count(a) == mx:
        print(a)

Solution (Python):

array = []
while True:
    try:
        a = input()
        array.append(int(a))
    except EOFError:
        break
s = set(array)
mx = array.count(max(array, key = array.count))
for a in sorted(s):
    if array.count(a) == mx:
        print(a)

Solution (Python):

array = []
while True:
    try:
        a = input()
        array.append(int(a))
    except EOFError:
        break
s = set(array)
mx = array.count(max(s, key = array.count))
for a in sorted(s):
    if array.count(a) == mx:
        print(a)

Solution (Python):

array = []
while True:
    try:
        a = input()
        array.append(int(a))
    except EOFError:
        break
s = set(array)
mx = array.count(max(s, key = array.count))
for a in sorted(s):
    if array.count(a) == mx:
        print(a)

Solution (Python):

array = []
while True:
    try:
        a = input()
        array.append(int(a))
    except EOFError:
        break
s = set(array)
mx = array.count(max(s, key = array.count))
for a in sorted(s):
    if array.count(a) == mx:
        print(a)

Solution (Python):

array = []
while True:
    try:
        a = input()
        array.append(int(a))
    except EOFError:
        break
s = set(array)
mx = array.count(max(s, key = array.count))
for a in sorted(s):
    if array.count(a) == mx:
        print(a)

Solution (Python):

array = []
while True:
    try:
        a = input()
        array.append(int(a))
    except EOFError: break
s = set(array)
mx = max(sorted(s, reverse=True), key = array.count)
for a in sorted(s, key = array.count, reverse=True):
    print(a)
    if a == mx: break

Solution (Python):

array = []
while True:
    try:
        a = input()
        array.append(int(a))
    except EOFError: break
s = set(array)
mx = max(sorted(s, reverse=True), key = array.count)
for a in sorted(s, key = array.count, reverse=True):
    print(a)
    if a == mx: break

Solution (Python):

array = []
while True:
    try:
        a = input()
        array.append(int(a))
    except EOFError: break
s = set(array)
mx = max(sorted(s, reverse=True), key = array.count)
for a in sorted(s, key = array.count, reverse=True):
    print(a)
    if a == mx: break

Solution (Python):

array = []
while True:
    try:
        a = input()
        array.append(int(a))
    except EOFError: break
s = set(array)
mx = max(sorted(s, reverse=True), key = array.count)
for a in sorted(s, key = array.count, reverse=True):
    print(a)
    if a == mx: break

Solution (Python):
import sys
if __name__ == '__main__':
    a = [0]*101
    for tmp_line in sys.stdin:
        n = (int)(tmp_line)
        a[n-1] += 1
    b = [i+1 for i,x in enumerate(a) if x == max(a)]
    b.sort()
    for x in b:
        print(x)

Solution (Python):
num = [0] * 100
mode = 0
while True:
    try:
        a = int(input())
        num[a-1] += 1
        if num[a-1] > mode:
            mode = num[a-1]
    except:
        break
for i, n in enumerate(num):
    if n == mode:
        print(i+1)

Solution (Python):
seisuu = [0] * 100
try:
    while True:
        a = input()
        seisuu[a] += 1
except:
    b = max(seisuu)
    for i in range(100):
        if b == seisuu[i]:
            print i

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

Solution (Python):
from sys import stdin
from collections import Counter
data = Counter([i for i in range(1, 101)])
for line in stdin:
    data[int(line.replace('\n', ''))] += 1
mode = data.most_common(1)[0][1]

for po in range(1, 101):
    if data[po] == mode:
        print(po)
    else:
        pass

Solution (Python):
import sys

d = {i:0 for i in range(1,101)}
for i in map(int, sys.stdin):
    d[i] += 1
s = sorted(d.items(), key=lambda x: x[1], reverse=True)
m = s[0][1]
for i in s:
    if i[1] < m:
        break
    print(i[0])

Solution (Python):
import sys

data = [0] * 101

for line in sys.stdin:
  try:
    n = int(line)
    data[n] += 1
  except:
    break
m = max(data)
for i in range(len(data)):
  if data[i] == m:
    print(i)

Solution (Python):
def main():
    Array = [0]*100
    while True:
        try:
            Array[int(input())-1] += 1
        except EOFError:
            break
    [print(i+1) for i in range(100) if Array[i] == max(Array)] 
if __name__ == '__main__':
    main()

Solution (Python):
import sys

l = []
for input in sys.stdin:
    l.append(int(input))

l = sorted(l)
d = {}
for i in range(0,len(l)):
    d[l[i]] = l.count(l[i])
max = 0
for key,value in d.items():
    if(value > max):
        max = value
for key,value in d.items():
    if(value == max):
        print key

Solution (Python):
a = {}
while True:
    try:
        a_i = int(input())
        if a_i in a:
            a[a_i] += 1
        else:
            a[a_i] = 1
    except:
        break
mode_count = max(a.values())
b = []
for key, value in a.items():
    if value == mode_count:
        b.append(key)
print(*sorted(b),sep="\n")

Solution (Python):
a = {}

while True:
    try:
        a_i = int(input())
        if a_i in a:
            a[a_i] += 1
        else:
            a[a_i] = 1
    except:
        break

mode_count = max(a.values())

b = []
for key, value in a.items():
    if value == mode_count:
        b.append(key)

print(*sorted(b),sep="\n")

Solution (Python):
count = [0 for i in range(100)]
while True:
    try:
        count[int(input()) - 1] += 1
    except:
        break
max_e = 0
max_i = []
for i in range(100):
    temp = max_e
    max_e = max(count[i], max_e)
    if temp == max_e and count[i] == max_e:
        max_i.append(i + 1)
    elif temp != max_e:
        max_i = [i + 1]
for i in max_i:
    print(i)

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

Solution (Python):
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 l in range(len(N)):
    k = int(N[l])
    nums[int(N[l])] += 1
    maxi = max(maxi, nums[k])

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

Solution (Python):
import sys
a={}
for i in sys.stdin:
 a.setdefault(i,0);a[i]+=1
for k in a:
 if a[k]==max(a.values()):print(k.strip())

Solution (Python):
import sys
a={}
for i in sys.stdin:a.setdefault(i,0);a[i]+=1
for k in a:
 if a[k]==max(a.values()):print(k.strip())

Solution (Python):
import sys
a={}
for i in sys.stdin:a.setdefault(i,0);a[i]+=1
[print(k.strip())for k in a if a[k]==max(a.values())]

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

Solution (Python):

import sys

d = {}
for line in sys.stdin:
    s = line.strip()
    if not s in d: 
        d[s] = 1
    else:
        d[s] += 1

max_num = max(d.values())

ans = [int(key) for key, value in d.items() if value == max_num]
for i in sorted(ans):
    print(i)

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

Solution (Python):
from collections import Counter
import sys

lines = []
for line in sys.stdin:
    lines.append(int(line.strip()))

c = Counter(lines)
m = c.most_common(1)[0][1]
for k in sorted(c.keys()):
    if c[k]==m:
        print(k)

Solution (Python):
import sys
s ,v = [], []
for e in sys.stdin:
    try:
        v[s.index(int(e))] += 1
    except:
        s.append(int(e))
        v.append(1)
c = list(zip(s, v))
c.sort()
c.sort(key = lambda x: x[1], reverse = True)
for i in c:
    if i[1] == c[0][1]:print(i[0])
    else:break

Solution (Python):
import sys,collections
l=[int(t) for t in sys.stdin]
m=sorted(collections.Counter(l).values())[-1]
[print(i[0]) for i in sorted(collections.Counter(l).items(),key=lambda x:x[0]) if i[1]==m]

Solution (Python):
from collections import Counter

dic = Counter()

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

  except EOFError:
    break

lst = dic.most_common()
max_value = lst[0][1]
mode_values = [t[0] for t in lst if t[1] == max_value]
mode_values.sort()

for v in mode_values:
  print(v)

Solution (Python):



import sys

cnt = [0 for i in range(101)]
max = 0
for _ in sys.stdin:
	i = int(_)
	cnt[i] += 1
	if cnt[i] > max:
		max = cnt[i]
for i in range(101):
	if cnt[i] == max:
		print(i)

Solution (Python):



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)

Solution (Python):
lst = [0]*100
while True:
    try:
        n = input()
    except EOFError:
        break
    lst[n-1] += 1
M = max(lst)
for i in range(0,100):
    if lst[i] == M:
        print i+1

Solution (Python):
import sys

dictionary = dict()

for line in sys.stdin.readlines():
    line = line.strip()
    num = int(line)
    if not dictionary.has_key(num):
        dictionary[num] = 0
    dictionary[num] += 1

lastValue = max(dictionary.values())
for key, value in sorted(dictionary.items(), key=lambda x: x[1], reverse=True):
    if value == lastValue:
        print key

Solution (Python):



import sys
import random


def main():
    lines = sys.stdin.readlines()
    nums = [int(line.replace("\n", "")) for line in lines if line != "\n"]
    num_set = [i for i in set(nums)]
    num_set.sort(lambda a, b: cmp(nums.count(a), nums.count(b)))
    maximum = nums.count(num_set[-1])
    for num in num_set:
        if nums.count(num) == maximum:
            print num

if __name__ == '__main__':
    main()

Solution (Python):
import sys
list=[0]*101
for line in sys.stdin.readlines():
    list[int(line.strip())]+=1
ma=max(list)
for i,v in enumerate(list):
    if v==ma:print i

Solution (Python):
l = []
c = list([0] * 100)
while True:
    try:
        c[int(raw_input()) - 1] += 1
    except:
        break
m = max(c)
for i in xrange(c.count(m)):
    j = c.index(m)
    print j + 1
    c[j] = 0

Solution (Python):
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][1]
ans=[v for v,k in x if tmp == k]
for l in ans:
    print l