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>
#include <algorithm>
#include <bitset>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <complex>
#include <string.h>
#include <numeric>
using namespace std;

//#define int long long
#define reps(i,s,n) for(int (i)=(s);(i)<(n);++(i))
#define rep(i,n) reps(i,0,n)
#define rept(i,n) rep(i,(n)+1)
#define repst(i,s,n) reps(i,s,(n)+1)
#define reprt(i,n,t) for(int (i)=(n);(i)>=(t);--(i))
#define repr(i,n) reprt(i,n,0)
#define each(itr,v) for(auto &(itr):(v))
#define all(c) (c).begin(),(c).end()
#define rall(c) (c).rbegin(),(c).rend()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define tmax(x,y,z) max(x,max(y,z))
#define tmin(x,y,z) min(x,min(y,z))
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
#define ln '\n'
#define bln(i,n) (((i)==(n)-1)?'\n':' ')
#define dbg(x) cout<<#x" = "<<(x)<<ln<<flush
#define dbga(x,n) {cout<<#x" : ";for(int (i)=0;i<(n);++i){cout<<((x)[i])<<(i==((n)-1)?'\n':' ')<<flush;}}
#define zero(a) memset(a,0,sizeof(a))
#define unq(a) sort(all(a)),a.erase(unique(all(a)),a.end())

//typedef complex<double> P;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<string> vst;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
typedef vector<vector<int> > mat;

const ll inf = (ll)1e9+10;
const ll linf = (ll)1e18+10;
const ll mod = (ll)(1e9+7);
const int dx[] = {0, 1, 0, -1};
const int dy[] = {1, 0, -1, 0};
const int ddx[] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[] = {1, 1, 0, -1, -1, -1, 0, 1};
const double eps = 1e-10;

ll mop(ll a,ll b,ll m=mod) {ll r=1;a%=m;for(;b;b>>=1){if(b&1)r=r*a%m;a=a*a%m;}return r;}
ll gcd(ll a,ll b) {return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b) {return a*b/gcd(a,b);}
bool ool(int x,int y,int h,int w) {return((x<0)||(h<=x)||(y<0)||(w<=y));}
bool deq(double a,double b) {return abs(a-b)<eps;}

struct oreno_initializer {
	oreno_initializer() {
		cin.tie(0);
		ios::sync_with_stdio(0);
	}
} oreno_initializer;



map<int,int> c;
int a, m;

signed main() {
	while (scanf("%d",&a)!=EOF) c[a]++;
	each(i,c) chmax(m,i.second);
	each(i,c) if (i.second==m) cout << i.first << endl;
}

C++: #include <iostream>
#include <cstdlib>
#include <map>
#include <utility>
#include <algorithm>
using namespace std;

int main()
{
    map<int, int> iData;
    int iBuff, maxCount = 0, maxElement[100];
    pair<map<int, int>::iterator, bool> flag;
    while(cin >> iBuff)
    {
        flag = iData.insert(map<int, int>::value_type(iBuff, 1));
        if(flag.second == false)
        {
            iData[iBuff]++;
            maxCount = max(maxCount, iData[iBuff]);
        }
    }
    for(map<int, int>::iterator it = iData.begin(); it != iData.end(); it++)
    {
        if(it->second == maxCount )
            cout << it->first << endl;
    }
    return EXIT_SUCCESS;
}

C++: #include <iostream>
#include <algorithm>
#include <set>
#include <map>
using namespace std;
int main() {
  int x, count[101]={}, max=0; 
  set<int> a; 
  multimap<int, int> b; 
  while(cin >> x) { 
    count[x]++;  
    a.insert(x);
  } 
  for(set<int>::iterator it=a.begin(); it!=a.end(); it++) { 
    b.insert(make_pair(count[*it], *it));   
    if(count[*it]>max) max=count[*it]; 
  } 
  for(multimap<int, int>::iterator it=b.begin(); it!=b.end(); it++) {  
    if(it->first==max) cout << it->second << endl; 
  } 
  return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <math.h>

//#define PI 3.141592653589

using namespace std;



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

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

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

C++: #define _USE_MATH_DEFINES
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<cmath>
#include<list>
#include<stack>
#include<queue>
#include<cctype>
#include<iomanip>
#include<functional>
#include<numeric>
#define EPS 1e-10
using namespace std;
typedef long long llong;
int main() {
	int n;
	int a[101] = {};
	int max = 0;
	while (cin >> n) {
		a[n]++;
		if (max < a[n])max = a[n];
	}
	for (int i = 0; i < 102; i++)if(max==a[i])cout << i << endl;
	return 0;
}

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

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

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

int main(){
  int n[101]={0},a,max;
  queue<int> q;
  while(cin>>a)n[a]++;
  max=1;
  while(q.size())q.pop();
  for(int i=1;i<=100;i++){
    if(n[i]>max){
      while(q.size())q.pop();
      q.push(i);
      max=n[i];
    }else if(n[i]==max){
      q.push(i);
    }
  }
  while(q.size()){
    cout<<q.front()<<endl;
    q.pop();
  }
  return 0;
}

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

int main(){
	int n;
	map<int,int> dic;
	int mx = 0;
	while( cin >> n ) dic[n]++,mx = max(dic[n],mx);
	for( auto x : dic ){
		if( x.second == mx ) cout << x.first << endl;
	}
}

C++: #include<bits/stdc++.h>
using namespace std;
static const int MAX_N = 100;

int a[MAX_N];

int main(void){
	for(int i = 0; i <= MAX_N; i++){
		a[i] = 0;
	}

	int input;
	while(scanf("%d", &input) != EOF){
		a[input]++;
	}

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

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

int main()
{	
	int n, m = 0;
	int a[101];

	memset(a, 0, sizeof(a));

	while (cin >> n)
		a[n]++;			

	for (int i = 1; i <= 100; i++)
		m = max(m, a[i]);

	for (int i = 1; i <= 100; i++)
		if (a[i] == m)
			cout << i << endl;

	return 0;
}