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 <sstream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
using namespace std;

typedef long long ll;
typedef pair<int, int> P;

#define all(c) (c).begin(), (c).end()
#define pb push_back
#define mp make_pair
#define EXIST(v,i) (find(all(v), i) != (v).end())
#define ERASE(v,i) (v).erase(remove(all(v), i), (v).end())
#define INDEX(v,i) (find(all(v), i) - (v).begin())
#define rep(i,n) for(int i = 0; i < (int)n; ++i)
#define debug(x) cerr << #x << " = " << (x) << endl;

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

const int INF = 100000000;
const double PI = 3.14159265358979323846;
const double EPS = 1e-10;

int main() {
	vector<int> arr(101);
	for(int p; cin >> p;) arr[p]++;
	int most = *max_element(all(arr));
	rep(i, 101) {
		if(arr[i] == most)
			cout << i << endl;
	}
	return 0;
}

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

C++: //https://onlinejudge.u-aizu.ac.jp/challenges/sources/PCK/Prelim/0028?year=2004

#include <bits/stdc++.h>

using namespace std;

int main() {
    int a;
    map<int, int> mp;

    int mx = 0;
    while (cin >> a) {
        mp[a]++;
        mx = max(mx, mp[a]);
    }

    for (auto m : mp) {
        if (m.second == mx) {
            cout << m.first << endl;
        }
    }
    return 0;
}

/*
 *
 */

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

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

C++: #include <stdio.h>

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

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

C++: #include <algorithm>
#include <cmath>
#include <climits>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <cassert>
#include <functional>

using namespace std;

#define LOG(...) printf(__VA_ARGS__)
//#define LOG(...)
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define REP(i,n) for(int i=0;i<(int)(n);++i)
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define RSORT(c) sort((c).rbegin(),(c).rend())
#define CLR(a) memset((a), 0 ,sizeof(a))

typedef long long ll;
typedef unsigned long long ull;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vb> vvb;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

const int dx[] = { -1, 0, 1, 0 }; const int dy[] = { 0, 1, 0, -1 };

int main() {
	int a[100] = { 0 };
	int n;
	while (cin >> n)
		a[n - 1]++;

	int ma = 0;
	REP(i, 100){
		ma = max(ma, a[i]);
	}
	REP(i, 100){
		if (a[i] == ma)
			cout << (a[i] + 1) << endl;
	}
	return 0;
}

C++: #include <bits/stdc++.h>

#define SIZE 300005
#define MOD 1000000007LL
#define INF INT_MAX / 3
#define LLINF 1LL << 60
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,a,b) for(int i=a;i<=b;i++)
#define DOWN(i,b,a) for(int i=b;i>=a;i--)
#define SET(a,c) memset(a,c,sizeof a)
#define FORALL(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define FOREACH(i,c) for(auto (i) : (c))
#define BIT(i,j) ((i)>>(j))&1
#define ALL(o) (o).begin(), (o).end()
#define ERASE(o) (o).erase(unique((o).begin(),(o).end()), (o).end())
#define SQ(x) ((x)*(x))
using namespace std;
typedef long long ll;
typedef valarray<int> Array;
typedef pair<ll,ll> Pll;
typedef pair<int, int> Pii;
typedef pair<double, double> Pdd;
template<typename T> inline void priv(vector<T>a){REP(i,a.size()){cout<<a[i];if(i==a.size()-1)cout<<endl;else cout<<" ";}}
int gcd(int a,int b){int c=max(a,b);int d=min(a,b);return c==0||d==0?c:gcd(c%d,d);}
int lcm(int a,int b){return a==0||b==0?0:a*b/gcd(a,b);}

int main()
{
  vector<int> a(101,0);
  int x, tmp=0;
  while(~scanf("%d",&x)) a[x]++;
  vector<int> ans;
  FOR(i,1,100)
  {
    if(a[i] > a[tmp])
    {
      tmp = i;
      ans.clear();
      ans.push_back(tmp);
    }
    else if(a[i] == tmp)
      ans.push_back(i);
  }
  for(auto v : ans) printf("%d\n",v);
  return 0;
}

C++: #include <iostream>

using namespace std;

int main()
{
    int a[101] = {};

    int n;
    while (cin >> n) {
        a[n-1] += 1;
    }

    int ma = 0;

    for (int i = 0; i < 100; ++i) if (ma < a[i]) ma = a[i];

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

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

int main(){

  int memo[111]={0};

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

  
  for(int i=0;i<101;i++){
    if(ans==memo[i]) printf("%d\n",i);
  }

  return 0;
}

C++: #include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip> 
#include <complex> 
#include <string>
#include <vector> 
#include <list>
#include <deque> 
#include <stack> 
#include <queue> 
#include <set>
#include <map>
#include <bitset>
#include <functional>
#include <utility>
#include <algorithm> 
#include <numeric> 
#include <typeinfo> 
#include <cstdio>
#include <cstdlib> 
#include <cstring>
#include <cmath>
#include <climits> 
#include <ctime> 

using namespace std;

int main(void){
	int a;
	int maxa=0;
	vector<int> ans;
	map<int,int> f;
	for(a=0;a<=100;a++){
		f.insert( map<int,int>::value_type(a,0));
	}
	while(~scanf("%d",&a)){
		f[a]++;
	}
	for(a=0;a<=100;a++){
		maxa=max(maxa,f[a]);
	}
	for(a=0;a<=100;a++){
		if(maxa==f[a])ans.push_back(a);
	}
	sort(ans.begin(), ans.end());

	while(!ans.empty()){
		cout << ans[a] << endl;
	}
	return 0;
}