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

Python: import sys
a=[]
for i in sys.stdin:
    a.append(int(i))

import collections
counted = collections.Counter(a)

m = max(counted.values())

chars = [key for key, value in counted.items()
             if value == m]

x=sorted(chars)
[print(i) for i in x]

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

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

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)

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

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 mode:
        if mode[i]>maxN:
            print(i)
            
ModeValue()

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

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

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

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

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

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

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

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

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

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

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

Python: import sys

group = {}

for line in sys.stdin:
    n = int(line)
    if n in group:
        group[n] += 1
    else:
        group[n] = 1

sorted_group = sorted(group.items(), key=lambda x: x[1])
sorted_group.reverse()

mx = 0
result = []
for k,v in sorted_group:
    if mx == 0:
        mx = v
    if v == mx:
        result.append(k)
    else:
        break

result.sort()

for i in result:
    print(i)

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

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)

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)

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