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

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

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

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

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

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: from collections import Counter
l=[0]*100

while True:
    try:
        x=int(input())
        l[x+1]+=1
    except:
        break
    
for i in range(100):
    if l[i]==max(l):
        print(i-1)
    else:
        pass

Python: from collections import Counter
l = []
while True:
    try:
        a=int(input())
    except EOFError:
        break
    l.append(a)
L = sorted(l)
def calculate_mode(L):
    c = Counter(L)
    freq_scores = c.most_common()
    max_count = freq_scores[0][1]

    modes = []
#出現回数と最大出現回数が等しいかを確認します。
    for num in freq_scores:
        if num[1] == max_count:
            modes.append(num[0])
    return(modes)

if __name__ == '__main__':
    data = L
    modes = calculate_mode(L)

    for mode in modes:
        print(mode)

Python: a={}
maxnum = 1
while True:
    try:
        ai = int(input())
        if ai not in a:
            a[ai] = 1
        else:
            a[ai] += 1
            if maxnum < a[ai]:
                maxnum = a[ai]
    except:
        break
b = sorted(a.items())
for key, value in b:
    if maxnum==value:
        print(key)

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

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

Python: A=[]
B=[]
C=[]
while True:
  try:
    A.append(int(input()))
  except EOFError:
    break
    
for i in range(len(A)):
  count=0
  for j in range(len(A)):
    if A[i]==A[j]:
      count+=1
  B.append(count)
maxb=max(B)
for i in range(len(A)):
  if B[i]==maxb:
    if A[i] in C:
      pass
    else:
      C.append(A[i])
C.sort()
for i in range(len(C)):
  print(C[i])

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

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)

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

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
# Your code here!
a=[]
try:
    while True:
        a.append(int(input()))
except EOFError:
    pass
b=[0]*101

for i in a:
    b[i]+=1
c=max(b)

for i in range(100):
    if b[i]==c:
        print(i)

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)

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

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

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(key)
mostlist.sort()
for item in mostlist:
	print(item)

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

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


counts =[0] *101


for n in a: #nの中にaを入れる
    counts[n] +=1


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

Python: num_list = [0 for i in range(101)]


try:
    while True:
        num_list[int(input())] += 1
except EOFError:
    

    i = max(num_list)
    for j in range(1,101):
        if num_list[j] == i:print(j)

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