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

C++: #include <stdio.h> // C++???????????????
#include <string.h> // c++???????????????
#include <math.h> // c++???????????????
#include <iostream>
#include <string>
#include <stack>
#include <queue>
#include <map>
#include <algorithm>
using namespace std;

typedef long long int lli;
#define PI 3.1415926535897932
#define N 100
#define MAX(a,b) ((a>b)?(a):(b)) // ?????§????????????
#define MIN(a,b) ((a<b)?(a):(b)) // ????°?????????????
#define INRANGE(a,b,c) ((a<=b&&b<=c)?(1):(0)) // a<=b<=c??????????????????????????????


void swap(int &a, int &b) { // c??????*
	int w = a;
	a = b;
	b = w;
}

int getdigit(int num) { // ??´??°????????°?????????
	int i, j;
	if (num<0) num *= -1; // ?????°???????????¢
	if (num == 0)return 1;
	for (i = 10, j = 1;; i *= 10, j++) {
		if (INRANGE(i / 10, num, i - 1))return j;
	}
	return 0; // ????????¨??????
}

int getN(int num, int digit) {
	int i = 1, j;
	for (j = 1; j<digit; i *= 10, j++);
	return (num / i) % 10;
}

int zeller(int y, int m, int d) { // 0????????\????????§??????
	if (m<3) { y--; m += 12; }
	return (y + y / 4 - y / 100 + y / 400 + (13 * m + 8) / 5 + d) % 7;
}

int gcd(int a, int b) {	// ?????§??¬?´???°
	if (b == 0) return a;
	return gcd(b, a%b);
}

int lcm(int a, int b) {	// ????°???¬?????°
	return a*b / gcd(a, b);
}

int stoi(const string str) { // ?????????????????´??°
	int i = 0, j;
	int len = str.length();
	int w = 0;
	for (i = 1, j = 1; i <= len && INRANGE('0', str[len - i], '9'); i++, j *= 10) {
		w += (str[len - i] - '0')*j;
	}
	if (str[0] == '-')w *= -1;
	return w;
}

string itos(int a) { // ??´??°???????????????
	int i;
	string str = "";
	int keta;
	if (a<0) { str += '-'; a *= -1; } // ?????°??????????????????
	for (keta = 10; a / keta != 0; keta *= 10);
	for (i = keta / 10; i != 0; i /= 10) {
		str += ((a / i) % 10) + '0';
	}
	return str;
}

int main(void) {
	int max;
	map<int, int> m;
	map<int,int>::iterator it;
	int a;
	int n = 3;
	while (cin >> a,n--) {
		m[a]++;
	}
	max = 0;
	for (it = m.begin(); it != m.end(); it++) {
		max = MAX(max, it->second);
	}
	for (it = m.begin(); it != m.end(); it++) {
		if (max == it->second) cout << it->first<<endl;
	}
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;

int n, cnt[101];
vector<pair<int, int>> ans;

int main() {
  cin.tie(0); ios_base::sync_with_stdio(false);
  while(cin >> n) ++cnt[n];
  for(int i = 1; i <= 100; ++i) if(cnt[i]) ans.emplace_back(cnt[i], -i);
  sort(ans.rbegin(), ans.rend());

  for(int i = 0; ans[i].first == ans[0].first; ++i) cout << -ans[i].second << '\n';
  return 0;
}

C++: #include <iostream>
using namespace std;

int main()
{
	int count[101] = {0},value,max;

	while(cin >> value)
	{
		count[value]++;
	}
	max = count[0];
	for(int i=0;i<100;i++)
	{
		if(max < count[i]) max = count[i];
	}
	for(int i=0;i<100;i++)
	{
		if(max == count[i]) cout<<i<<endl;
	}
	return 0;
}

C++: 
#include <bits/stdc++.h>
using namespace std;
int main()
{
    int i,j,ara[1000],n=0,ara2[1000],k=0,c=1,max=0,mode,m;

    while (scanf ("%d",&m)!=EOF)
    {
        ara[n]=m;
        n++;
    }
    for (i=0;i<n-1;i++)
    {
        mode=0;
        for (j=i+1;j<n;j++)
        {
            if (ara[i]==ara[j])
            {
                mode++;
            }
        }
        if ((mode>max) && (mode!=0))
        {
            k=0;
            max=mode;
            ara2[k]=ara[i];
            k++;
        }
        else if (mode==max)
        {
            ara2[k]=ara[i];
            k++;
        }
    }
        sort(ara2,ara2+k);
        for (i=0;i<k;i++)
        {
            printf("%d\n",ara2[i]);
        }
        return 0;
}

C++: #include <iostream>
#include <cstdio>
using namespace std;
int main(){
	int a[100];
	for(int i=0;i<100;i++) a[i] = 0;
	int b;
	while(cin >> b) {a[b]++;}
	int max = 0;
	for(int i=0;i<100;i++) if(max<a[i]) max = a[i];
	for(int i=0;i<100;i++) if(a[i]==max) cout << i << endl;
}

C++: #include<iostream>
using namespace std;

int main(){
	int size = 0, n[101] = {0}, temp, max = -1;
	while(cin >>temp){
		n[temp]++;
		if(n[temp] > max) max = n[temp];
		size++;
	}
	for(int i = 1; i <= 100; i++){
		if(n[i] >= max) cout <<i <<endl;
	}
	return 0;
}

C++: #include <iostream>
#include <algorithm>

using namespace std;

int main() {
	int d[101] = { 0 }, a, m = 0;
	while (cin >> a){
		d[a]++;
		m = max(m, d[a]);
	}
	for (int i = 1; i <= 100; i++){
		if (m == d[i])cout << i << endl;
	}
	return 0;
}

C++: #include <bits/stdc++.h>
#define rep(i,l,n) for(int i=l;i<n;i++)
using namespace std;

int main(){
	int data[101]={},num,max=0;
	while(cin>>num){
		//if(num==0) break;
		data[num]++;
	}
	rep(i,1,101){
		if(data[i]>max) max=data[i];
	}
	rep(i,0,101){
		if(data[i]==max) cout<<i<<endl;
	}
}

C++: #include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int sum[101],n,mx,cou;
int main(){
    while(cin>>n){
        sum[n]++;
    }
    for(int i=0;i<100;i++)mx=max(mx,sum[i]);
    for(int i=0;i<100;i++){
        if(mx==sum[i]){
            cout<<i<<endl;
    }
    cout<<endl;
return 0;
}

C++: #include <stdio.h>
#include <math.h>
#include <iostream>

using namespace std;

int main() {

	int counter[101] = {0};
	int a;
	int MAX = 0;
	int i = 0;
	
	while (cin >> a) {
		counter[a]++;
	}

	for (int j = 1; j < 101; j++) {
		MAX = max(MAX, counter[j]);
	}

	for (int k = 1; k < 101; k++) {
		if (MAX == counter[k]) {
			cout << k << endl;
		}
	}

	return 0;
}

C++: #include<cstdio>
#define MAX(x,y) ((x>y)? x:y)

int date[100]={0};

int main()
{
	int n;
	while(scanf("%d",&n)!=EOF)
	{
		if(n==-1)break;
		date[n-1]++;
	}
	int max=0;
	for(int i=0;i<100;i++)
	{
		max=MAX(max,date[i]);
	}
	for(int i=0;i<100;i++)
	{
		if(max==date[i])printf("%d\n",i+1);
	}
	return 0;
}

C++: #include <algorithm>
#include <iostream>
#include <stdio.h>

using namespace std;

int main(void){
    int i,IMAX=0,num[100]={0},a,ans=0,max=0;
    while(cin >> a){
        num[a-1]++;
        IMAX++;
    }
    for(i=0;i<IMAX;i++){
        if(max<num[i]){
            max=num[i];
            ans=i+1;
        }
    }
    cout << ans << endl;
    for(i=ans;i<IMAX;i++){
        if(max==num[i]) cout << i+1 << endl;
    }

    return 0;
}

C++: #include<stdio.h>
#include<stdlib.h>

int compareq(const void*a, const void*b)
{
	return *(int*)a > *(int*)b ? 1 : *(int*)a == *(int*)b ? 0 : -1;
}

int main()
{
	int numbers[101], i = 0, maxnum[101];
	while (scanf("%d", &numbers[i]) != EOF)i++;
	qsort(numbers, i, sizeof(int), *compareq);
	int n, cnt = 0, max = 0, j = 0;
	for (n = 0; n < i; n++)
	{
		if (numbers[n] == numbers[n - 1])cnt++;
		else
		{
			if (cnt > max)
			{
				while (1)
				{
					maxnum[j++] = 0;
					if (j == 100)break;
				}
				maxnum[0] = n - 1;
				max = cnt;
				cnt = 0;
				j = 0;
			}
			else if (cnt == max)
			{
				maxnum[j++] = n - 1;
				cnt = 0;
			}
			else;
		}
	}
	j = 0;
	while (maxnum[j] != 0)
	{
		printf("%d\n", maxnum[j]);
	}
	return 0;
}