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
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef unsigned long long ULL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);

//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

int main() {
  int n, max = 0;
  int cnt[100] = {0};

  while(cin >> n) cnt[n-1]++;
  for(int i = 0; i < 100; i++) {
    if(cnt[i] > max) max = cnt[i];
  }

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

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,0);
    int n;
    while(cin >> n){
        vec[n]++;
        int tmp = 0;
        rep(i,vec.size()){
            tmp = max(tmp,vec[i]);
        }
        vector<int> ans;
        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>

using namespace std;

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

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

int main(){
    int d[100];
    int maximize[100];

    int buf;
    while( scanf( "%d",&buf ) != EOF  ) d[buf-1]++;

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

    for( int i = 0;i < 100;i++ ){
        if( d[i] >= buff ) printf( "%d\n",i+1 );
    }
    return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
while(scanf("%d",&n)!=EOF)
{
int num[1000]={0};
for(int i=1;i<=n;i++)
{
int a;
cin>>a;
num[a]++;
}
int ans=0,now=0;
for(int i=1;i<=105;i++)
{
if(num[i]>ans)
{
ans=num[i];
now=i；
}
}
cout<<now<<endl;
}
}

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

using namespace std;

int main(){
    vector<int>Times(101,0);
    int x;
    while(cin >> x){
      cin>>x;
      Times[x]+=1;
    }
    
    int ma =-1
    for(int x=1; x<=100; x++){
        if(ma<Times[x]) ma=Times[x]
    }
     
    for(int x=1; x<=100; x++){
        if(Times[x] == ma) cout << x << endl;
    } 
    return 0;
}

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

int main(){

  int a, cnt[101]={}, maxn=0;

  while(cin>>a){
    cnt[a]++;
    if(maxn<cnt[a]) maxn=cnt[a];
  }

  for(int i=1;i<=100;i++){
    if(maxn==cnt[i]) cout<<i<<endl;
  }

  return 0;
}

C++: #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int y[100000000], n, maxv; vector<int>a;
int main() {
	while (cin >> n) {
		y[n]++;
	}
	for (int i = 0; i < 100000000; i++) {
		maxv = max(maxv, y[i]);
	}
	for (int i = 0; i < 100000000; i++) {
		if (y[i] == maxv) { cout << i << endl; }
	}
}

C++: #include<iostream>
#include<string.h>
#include<vector>
#include<algorithm>
using namespace std;
int main()
{
    int a[101];
    memset(a,0,sizeof(a));
    vector<int>vec;
    int in;
    while(cin>>in){
        a[in]++;
    }
    int m=0;
    for(int i=0;i<101;i++){
        if(a[i]>m){
            m=a[i];
            vec.clear();
            vec.push_back(i);
        }
        else if(a[i]==m){
            vec.push_back(i);
        }
    }
    sort(vec.begin(),vec.end());
    for(int i=0;i<vec.size();i++){
        cout<<vec[i]<<endl;
    }
    return 0;
}

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

int main(){
  int n;
  int max=0;
  int seq[101];
  int i;

  for(i=0; i<=100; i++) seq[i]=0;
  while(cin>>n){
    seq[n]++;
    if(max<seq[n]) max=seq[n];
  }
  for(i=0; i<=100; i++)
    if(seq[i]==max) printf("%d\n", i);

  return 0;
}

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

class Mode_Value{
	int mode[100];
	int max;
public:
	Mode_Value();
	void setMode(int);
	void getMaxValue();
};

Mode_Value::Mode_Value(){
	max = 0;
	for(int i = 0; i < 100; i ++)
		mode[i] = 0;
}

void Mode_Value::setMode(int n){
	if(++mode[n - 1] > max)
		max = mode[n - 1];
}

void Mode_Value::getMaxValue(){
	for(int i = 0; i < 100; i ++){
		if(mode[i] == max)
			cout << i + 1 << endl;
	}
}

int main(){
	int a;
	Mode_Value m;
	while(scanf("%d",&a) != EOF)
		m.setMode(a);
	m.getMaxValue();
	return 0;
}

C++: #include<cstdio>

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

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

using namespace std;

int main()
{
	int number[101] = { 0 };
	int tmp, max_num = 0;

	while ( cin >> tmp )
	{
		number[tmp] = number[tmp] + 1;
		max_num = max( number[tmp], max_num );
	}

	tmp = 0;
	while ( tmp < 101 )
	{
		if ( max_num == number[tmp] )
		{
			cout << tmp << endl;
		}
		tmp = tmp + 1;
	}

	return 0;
}

C++: #include <iostream>
#include <queue>
#include <stack>
#include <vector>
#include <stdio.h>
#include <algorithm>
#include <string.h>
#include <string>
using namespace std;

#define rep(i,n) for(int i=0;i<int(n);++i)

int a[120]={0};
int x;
int MAX=0;

int main(){
	while(cin>>x){
		a[x]++;
	}
	rep(i,101){
		MAX = max(MAX,a[i]);
	}
	rep(i,101){
		if(a[i] == MAX){
			cout<<i<<endl;
		}
	}
	return 0;
}