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<bits/stdc++.h>
using namespace std;

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

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

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

int main(void){
	int n, m=0, d[101]={0};

	while (cin>>n) 	d[n]++;
	for (int i=0; i<101; i++) if (d[i]>m) m=d[i];
	for (int i=0; i<101; i++) if (d[i]==m) cout<<i<<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)
			{
				int s = 0;
				while (1)
				{
					maxnum[s++] = 0;
					if (s == 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]);
		j++;
	}
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;

int main(){
	int t[102]={},tmp,k = 0,i;
	while(cin>>tmp){
		t[tmp+1]++;
		if(t[tmp+1]>k){
			k = t[tmp+1];
		}
	}
	for(i = 1;i <= 102;i++){
		if(t[i] == k){
			cout<<i-1<<endl;
		}
	}
	return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <cmath>
#include <utility>

#define ll (long long)
#define REP(i,n) for(int i = 0;i<(int)n;i++)
#define FOR(i,a,b) for(int i = (a);i < (b);i++)
#define RFOR(i,a,b) for(int i = (a);i>(b);i--)

using namespace std;

/*thief??????*/

int main(void){
    
    int input[120] = {0};
    int c  = 1;
    int check[100] = {0};
    int asnwer[100] = {0};
    int max = 0;
    while(cin >> input[c++])
    {
        int temp = input[c-1];
        check[temp]++;
    }
    REP(i, c)
        if(max <= check[i])
            max = check[i];
    
    REP(i,c) if(check[i] == max) cout << i << endl;
    return 0;
        }

C++: #include<bits/stdc++.h>
#define rep(i,n) for(int i=0; i<n; i++)
#define INF 1000000
using namespace std;
int main(){
    vector<int> vec(101);
    rep(i,101) vec[i] = 0;
    int n,tmp=0;
    vector<int> ans;
    while(cin >> n){
        vec[n]++;
    }
    rep(i,vec.size()){
        if(tmp <= vec[i]) tmp = vec[i];
    }
    rep(i,vec.size()){
        if(tmp == vec[i]) ans.push_back(i);
    }
    sort(ans.begin(),ans.end());
    rep(i,ans.size()) cout << ans[i] << endl;
    return 0;
}

C++: #include<iostream>
#include<vector>
using namespace std;
int main()
{
	
		int n,a;
		vector<int>number;
		int c[101] = { 0 };
		for (int i = 0; i<100; i++){
			cin >> a;
			c[a]++;
		}
		int max = 1;
		for (int i = 1; i <= 100; i++){ 
			if (max == c[i]){
				number.push_back(i);
			}
			else if (max<c[i]){
				max = c[i];
				number.clear();
				number.push_back(i);
			}
			
		}
		for (int i = 0; i < number.size(); i++){
			cout << number[i] << endl;
		}
}

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

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

    while(cin >> n){
		if(cin.eof()){break;}
		count[n]++;  //count[n]の個数を数える
		if(max<count[n]){  //最頻値maxをcount[n]の個数が超えたときmaxを更新
			max=count[n];
		}
	}
	for(i=1;i<101;i++){  //count[i]の値がmaxのとき出力
		if(max==count[i]){
			cout << i << endl;
		}
	}
	return 0;
}

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

using namespace std;

int main() {
	int mode[100];
	int a, v = 0;

	memset(mode, 0, sizeof(mode));
	while (cin >> a) {
		mode[a-1] += 1;
	}
	for (int i = 0; i < 100; i++)
		v = max(v, mode[i]);
	for (int i = 0; i < 100; i++)
		if (mode[i] == v)
			cout << i+1 << endl;
	return 0;
}

C++: #include<iostream>
#include<string>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
int main(void){
	int n;
	int a[101]={0};

	while(cin>>n){
        a[n]++;
	}
	int b=0;
    for(int i=0;i<100;i++){
        b=max(a[i],b);
    }
    for(int i=0;i<100;i++){
        if(a[i]==b)cout<<i<<endl;
    }
	return 0;
}

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

using namespace std;

int main() {

	int n, max=0, s[100];

	for(int i=0; i<100; i++) {
		s[i]=0;
	}

	while(cin >> n) {
		s[n-1]++;
	}

	for(int i=0; i<100; i++) {
		if(s[i]>max)
			max=s[i];
	}

	for(int i=0; i<100; i++) {
		if(s[i]==max)
			cout << i+1 << endl;
	}

	return 0;

}

C++: #define _USE_MATH_DEFINES
#include <iostream>
#include <queue>
#include <vector>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <string>
#include <stack>
#include <cctype>
#include <cstdlib>
#include <map>
using namespace std;

#define INF (1 << 20)
#define EPS (1e-10)
#define EQ(a,b) (fabs((a)-(b)) < EPS)

int main(){
	int cnt[100] = {};
	int n;
	while (cin >> n) ++cnt[n];
	int M = 0;
	for (int i = 0; i < 100; ++i) M = max(M, cnt[i]);
	for (int i = 0; i < 100; ++i) if (cnt[i] == M) cout << i << endl;
	return 0;
}

C++: #include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>
#include <sstream>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <numeric>
#include <cmath>
#include <climits>
#include <limits>
#include <cfloat>
#include <fstream>
using namespace std;

int main()
{
//	cut here before submit 
//	freopen("testcase.mv", "r", stdin);
	string str = "";
	map <int, int> a;

	while ( getline (cin, str ) ){
		int n;
		stringstream ss(str);
		ss >> n;
		++a[n];
	} // end for
	multimap <int, int, greater<int> > order;
	map <int, int>::iterator it = a.begin();
	
	for (; it != a.end(); ++it){
		order.insert (make_pair ((*it).second, (*it).first ) );
	} // end for

	it = a.begin();
	multimap <int, int, greater<int> >::iterator ito = order.begin();
	int num = (int)order.count ((*it).second );
	for (int i = 0; i < num; ++i, ++ito){
		cout << (*ito).second << endl;
	} // end for
		
	return 0;
}

C++: //#pragma GCC optimize(2)
//#pragma GCC optimize(3)
#include<bits/stdc++.h>
#define fo(x,a,b) for(register int x=a;x<=b;x++)
#define dfo(x,a,b) for(register int x=a;x>b;x--)
using namespace std;
int a[1000],x,n,m;
char c;
int main ()
{
	//、、freopen("modeval.in","r",stdin);
	//freopen("modeval.out","w",stdout);
	do
	{
		scanf("%d",&x);
		if (getchar()!='\n') break;
		a[x]++;
		m=max(a[x],m);
	}while (true);
	fo(i,1,100)
	{
		if (a[i]==m)
		{
			printf("%d\n",i);
		}
	}

	return 0;
}