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;

#define iota(i,n,b,s) for(int i=int(b);i!=int((b)+(s)*(n));i+=(s))
#define range(i,n,m) iota(i,(((n)>(m))?((n)-(m)):((m)-(n))),(n),((n)>(m)?-1:1))
#define rep(i,n) iota(i,(n),0,1)
#define loop for(;;)

#define INF (1e9)
#define EPS (1e-9)
#define cons(a,b) (make_pair(a,b))
#define car(a) (a.first)
#define cdr(a) (a.second)
#define cadr(a) (car(cdr(a)))
#define cddr(a) (cdr(cdr(a)))
#define all(a) a.begin(), a.end()
#define trace(var) cerr<<">>> "<<#var<<" = "<<var<<endl;

typedef long long Integer;
typedef double Real;
typedef vector<int> vi;
typedef vector<string> vs;
typedef map<string,int> Dictionary;
const Real PI = acos(-1);

template<class S, class T>
ostream& operator<<(ostream& os, pair<S,T> p) {
  os << '(' << car(p) << ", " << cdr(p) << ')';
  return os;
}

template<class T>
ostream& operator<<(ostream& os, vector<T> v) {
  if (v.size() == 0) {
    os << "(empty)";
    return os;
  }
  os << v[0];
  for (int i=1, len=v.size(); i<len; ++i) os << ' ' << v[i];
  return os;
}

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

int main() {

  int a[101] = {0};
  int ac = 0;

  for (int x; cin >> x, cin;) {
    a[x]++;
    ac = max(ac, a[x]);
  }

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

  return 0;
}

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

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

C++: //#define _GRIBCXX_DEBUG
#include <algorithm>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iostream>
#include <iomanip>
#include <list>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;


// ?????¬???????????¬??????
#pragma region MACRO
#define P(x) cout << (x) << endl
#define p(x) cout << (x)
#define PED cout << "\n"
#define rep(i,n) for(int i=0; i<(int)n; ++i)
#define REP(i,x,n) for(int i=x; i<(int)n; ++i)
#define repi(i,n) for(int i=0; i<=(int)n; ++i)
#define REPI(i,x,n) for(int i=x; i<=(int)n; ++i)
#define ILP while(true)
#define FOR(i,c) for(__typeof((c).begin())!=(c).begin(); i!=(c).end(); ++i)
#define ALL(c) (c).begin(), (c).end()
#define mp make_pair
#pragma endregion

// ???
#pragma region TYPE_DEF
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<string, string> pss;
typedef pair<string, int> psi;
typedef pair<int, string> pis;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<long> vl;
typedef vector<long long> vll;
typedef vector<string> vs;
#pragma endregion

// Effective std
#pragma region ESTD
template<typename C, typename T>
constexpr int count(C& c, T t) { return count(ALL(c), t); }
template<typename C, typename F>
constexpr int count_if(C& c, F f) { return count_if(ALL(c), f); }
template<typename C, typename T>
void erase(C& c, T t) { remove(ALL(c), t), c.end(); }
template<typename C>
void remove(vector<C>& c, unsigned int index) { c.erase(c.begin()+index); }
template<typename C, typename T, typename U>
constexpr void replace(C& c, T t, U u) { replace(ALL(c), t, u); }
template<typename C, typename F, typename U>
constexpr void replace_if(C& c, F f, U u) { (ALL(c), f, u); }
template<typename C>
constexpr void reverse(C& c) { reverse(ALL(c)); }
template<typename C>
constexpr void sort(C& c) { sort(ALL(c)); }
template<typename C, typename Pred>
constexpr void sort(C& c, Pred p) { sort(ALL(c), p); }
#pragma endregion

// ?????°
#pragma region CONST_VAL
#define PI (2*acos(0.0))
#define EPS (1e-9)
#define MOD (int)(1e9+7)
#pragma endregion


int main()
{
    vi v(101,0);
    int a;
    while(cin>>a) {
        v[a]++;
    }
    vi v2 = v;
    sort(v);

    rep(i,v2.size()) {
        if(v2[i]==v[100]) P(i);
    }
    return 0;
}

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

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

  for(i=0;i<=100;i++){
    data[i]=0;
  }
  
  while(scanf("%d",&n)!=EOF){
    data[n]++;
  }
  
  for(i=1;i<=100;i++){
    if(max<data[i]){
      max=data[i];
    }
  }

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

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

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

C++: #include <iostream>

using namespace std;

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

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 <vector>

using namespace std;

int main()
{
	int num[101] = {0};
	int data, max = -1;
	vector<int> mode;

	while (cin >> data)
	{
		if(cin.eof())	break;

		num[data]++;
	}

	for (int i=1; i<101; i++)
	{
		if(num[i] > max){
			max = num[i];
			mode.clear();
			mode.push_back(i);
		}
		else if(num[i] == max){
			mode.push_back(i);
		}
	}

	vector<int>::iterator numit = mode.begin();
	for (;numit != mode.end(); numit++)
	{
		cout << *numit << endl;
	}

	return 0;
}

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

int map[101];

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

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

int main() {
	int n,max=0,map[101]={0};
	while (scanf("%d",&n) != EOF)
	{
		map[n]++;
		if (max < map[n])max=map[n];
	}
	for (int i=1; i<101; i++)
	{
		if (map[i]==max)cout << i << endl;
	}
	return 0;
}

C++: #include <iostream>
#define NUM 10000


using namespace std;

int main(void){
	int times[NUM];
	int i, n;
	int max;

	for(i=0;i<NUM;i++){
		times[i] = 0;
	}

	while(cin >> n){
		times[n]++;
	}

	max = 0;
	for(i=0;i<NUM;i++){
		if(max < times[i]){
			max = times[i];
		}
	}

	for(i=0;i<NUM;i++){
		if(max == times[i]){
			cout << i << endl;
		}
	}
	return 0;
}