Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
	"strconv"
)

var scanner = bufio.NewScanner(os.Stdin)

func nextString() string {
	scanner.Scan()
	return scanner.Text()
}

func nextInt() (int, error) {
	return strconv.Atoi(nextString())
}

type Pair struct {
	key   int
	value int
}

func main() {
	scanner.Split(bufio.ScanWords)

	counts := map[int]int{}
	for {
		n, err := nextInt()
		if err != nil {
			break
		}

		counts[n]++
	}

	pairs := []Pair{}
	for k, v := range counts {
		pairs = append(pairs, Pair{k, v})
	}
	sort.Slice(pairs, func(i, j int) bool {
		if pairs[i].value == pairs[j].value {
			return pairs[i].key < pairs[j].key
		}
		return pairs[i].value > pairs[j].value
	})

	vMax := 0
	for _, pair := range pairs {
		if vMax != 0 && vMax != pair.value {
			break
		}
		if pair.value > vMax {
			vMax = pair.value
		}
		fmt.Println(pair.key)
	}
}

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 < i:
            ma = a[i]
            m.clear()
        m.append(i)
m = sorted(m)
for k in m:
    print(k)

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

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

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

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

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

Python: # 0028
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)

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

Python: import sys
readlines = sys.stdin.readlines
write = sys.stdout.write
def solve():
    mp = {}
    for line in readlines():
        v = int(line)
        mp[v] = mp.get(v, 0) + 1
    ma = max(mp.values())
    ans = [k for k, v in mp.items() if v == ma]
    ans.sort()
    write("\n".join(map(str, ans)))
    write("\n")
solve()

Python: a = [0] * 100

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

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

Python: # AOJ 0028 Mode Value
# Python3 2018.6.13 bal4u

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)

Python: # 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')

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)

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

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

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

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

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

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

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

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

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)

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

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

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

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

Python: 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]

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

Python: n=[0]*101
while 1:
    try:n[int(input())]+=1
    except:break
m_n=max(n)
for i in range(n.count(m_n)):
    print(n.index(m_n)+i)
    n.remove(m_n)