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 <iostream>
using namespace std ;

int main()
{
	int ary[101] ;
	int get ;
	int tmp = 0 ;

	for( int i = 1 ; i < 101 ; i ++ )
	{
		ary[i] = 0 ;
	}

	while( cin >> get )
	{
		ary[get] ++ ;

		if( ary[get] > tmp )
		{
			tmp = ary[get] ;
		}
	}

	for( int i = 1 ; i < 101 ; i ++ )
	{
		if( ary[i] == tmp )
		{
			cout << i << endl ;
		}
	}
	return 0 ;
}

C++: #include <cstdio>
#include <cstdlib>
#include <iostream>

using namespace std;

const int N = 100;

int n[N];
struct number {
	int cs;
	int value;
}num[N];

int cmp(const void *a, const void *b) {
	return *(int *)a - *(int *)b;
}

int cmp1(const void *a, const void *b) {
	number *c = (number *)a;
	number *d = (number *)b;
	if (c->cs != d->cs) return d->cs - c->cs;
	return c->value - d->value;
}

int main() {
	int k = 0, i = 0, maxs = -1;
	while (scanf("%d", &n[i++]) != EOF);//注意，i&#20540;比&#36755;入的整数个数大1 
	qsort(n, --i, sizeof(int), cmp);//i&#20540;要&#20943;一 
	num[k].cs = 1;
	num[k].value = n[0];
	for (int j=1; j<i; ++j) {//&#32479;&#35745;&#27599;个数出&#29616;的个数，并保存&#35813;数及其个数 
		if (num[k].value == n[j]) ++num[k].cs;
		else {
			if (num[k].cs > maxs) maxs = num[k].cs;
			++k;
			num[k].cs = 1;
			num[k].value = n[j];
		}
	}
	if (num[k].cs > maxs) maxs = num[k].cs;
	qsort(num, k+1, sizeof(number), cmp1);
	for (int j=0; j<=k; ++j) {//&#36755;出答案 
		if (num[j].cs == maxs) printf ("%d\n", num[j].value);
		else break;
	}
	return 0;
}

C++: /*****include*****/
#include <iostream>
#include <fstream>
#include <string>

/*****デバッグ定義*****/
//#define DEBUG
/*****マクロ定義*****/

/*****名前空間*****/
using namespace std;

/*****グローバル変数置き場*****/

/*****その他関数置き場*****/

/*****main関数*****/
int main(){
	/*****ファイルオープン*****/
#ifdef DEBUG
	ofstream fout("output.txt");
	ifstream fin("input.txt");
	if(!fout || !fin){
		cout << "Can't open the file.\n";
		return 0;
	}
#endif
	/*****変数置き場*****/
	int i=0;
	int num;
	int appear[100];
	int max;
	/*****処理部*****/
	max = 0;
	for(int i=0;i<100;i++)	appear[i] = 0;
	while(!cin.eof()){
		cin >> num;
		//cin >> num;
		appear[num] += 1;
	}
	for(int i=0;i<100;i++)
		if(appear[i] > max)	max = appear[i];
	for(int i=0;i<100;i++)
		if(appear[i] == max)
			cout << i << endl;
	/*****処理終了後*****/
#ifdef DEBUG
	fout.close();
	fin.close();
#endif
	return 0;
}

C++: #include<iostream>
int main()
{
	int appear[100];
	for (int i = 0; i < 100; i++)
	{
		appear[i] = 0;
	}
	int max = 0;
	for (int num; std::cin >> num;)
	{
		appear[num - 1]++;
		if (max < appear[num - 1])
		{
			max = appear[num - 1];
		}
	}
	for (int i = 0; i < 100; i++)
	{
		if (appear[i] == max)
		{
			std::cout << i + 1 << std::endl;
		}
	}
	return 0;
}

C++: #include<stdio.h>
int a[100];
int main(){
	int now;
	int max=0;
	while(~scanf("%d",&now)){
		a[now-1]++;
		if(a[now-1]>max)max=a[now-1];
	}
	for(int i=0;i<100;i++){
		if(a[i]==max)printf("%d\n",1+i);
	}
}

C++: #include<iostream>
using namespace std;
int main()
{
	int a[100+1]={0};
	int t;
	while(~scanf("%d",&t))
	a[t]++;
	int max=0;
	for(int i=0;i<101;i++)
	if(a[i]>max) max=a[i];
	for(int i=0;i<101;i++)
	if(a[i]==max) cout<<i<<endl;
}

C++: #include <cstdio>
#include <cstdlib>
#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>

using namespace std;

int main(){
    int n,k[101]={0},max_k=0;
    
    while(scanf("%d",&n)!=EOF){
        k[n]++;
    }
    
    for(int i=1;i<=100;i++){
        if(max_k<k[i]) max_k=k[i];
    }
    
    for(int i=1;i<=100;i++){
        if(max_k==k[i]) printf("%d\n",i);
    }
    
    return 0;
}

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

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

C++: #include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>
#include<bitset>
#include<limits.h>
#include<cassert>
#include<iterator>
#include<complex>
#include<stack>
#include<sstream>
#include<iterator>
#include<list>

using namespace std;

typedef  long long int lint;

#define rep(i, n) for (lint i = 0; i < n; i++)
#define sort(v) sort((v).begin(), (v).end())
#define reverse(v) reverse((v).begin(), (v).end())
#define upper(v,hoge) upper_bound(v.begin(),v.end(),hoge)
#define lower(v,hoge) lower_bound(v.begin(),v.end(),hoge)
#define llower(v,hoge) *lower_bound(v.begin(), v.end(), hoge)
#define lupper(v,hoge) *upper_bound(v.begin(), v.end(), hoge)
#define mp make_pair
#define IP pair<int,int>
#define enld endl

int main() {
	vector<int>A(100);
	int a;
	while (cin >> a) {
		A[a - 1]++;
	}
	int M = -1;
	rep(i, 100) {
		M = max(M, A[i]);
	}
	rep(i, 100) {
		if (M == A[i]) {
			cout << i + 1 << endl;
		}
	}
}

C++: #include<string>
#include<cstdio>
#include<iostream>

using namespace std;
 
int main(){
	int a[101]={0};
	int i, max=0;

	while(scanf("%d",&i)!=EOF)
		if(max<++a[i]) max=a[i];

	for(int j=0; j<101; j++){
		if(max==a[j]) printf("%d\n",j);
	}

    return 0;
}

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

using namespace std;

void solve()
{
	multiset<int> ms;
	int n;
	while(cin >> n)
	{
		ms.insert(n);
	}
	int max = 0;
	for(int i = 1; i < 101; ++i)
	{
		if(max < ms.count(i))
		{
			max = ms.count(i);
		}
	}
	for(int i = 1; i < 101; ++i)
	{
		if(max == ms.count(i))
		{
			cout << i << endl;
		}
	}
}

int main()
{
	solve();
	return(0);
}

C++: #include<iostream>

using namespace std;

int main(){
	int n,max=0;
	int in[10]={0};
	while(cin>>n){
		in[n]++;
		if(max<in[n])max=in[n];
	}
	
	for(int j=0;j<10;j++){
		if(max==in[j])cout<<j<<endl;
	}
	return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
	int times[10]={0};
	char num[5];
	while(cin >> num){
		times[num[0] - '0']++;
	}
	int maxtimes = 0;
	for(int i = 0;i < 10;i++){
		if(times[i] > maxtimes) maxtimes = times[i];
	}
	int maxnum[10]={0};
	int ptr=0;
	for(int i = 0; i < 10; i++){
		if(times[i]==maxtimes){
			maxnum[ptr++] = i;
		}
	}
	for(int i=0; i< ptr; i++){
		cout << maxnum[i] << endl;
	}
	return 0;
}

C++: #include<iostream>
#include<map>
using namespace std;
map<int,int>mp;
int main()
{	
	int a,b[100]={0},i=0,maxn=0;
	while(cin>>a)
	{
	    mp[a]++;
		if(mp[a]==1)
		{
			b[i]=a;
			
			i++;		
		}        	
		if(mp[a]>maxn)maxn=mp[a];
		
	}
	for(int j=0;j<i;j++)
	{
		if(mp[b[j]]==maxn)cout<<b[j]<<endl;
	}
	return 0;
}