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++: #define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES

#include "bits/stdc++.h"
#define REP(i,a,b) for(int i=a;i<b;++i)
#define rep(i,n) REP(i,0,n)
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define ALL(a) begin(a),end(a)
#define ifnot(a) if(not (a))
#define dump(x)  cerr << #x << " = " << (x) << endl
using namespace std;

// #define int ll
#ifdef _MSC_VER
const bool test = true;
#else 
const bool test = false;
#endif

int dx[] = { 0,1,0,-1 };
int dy[] = { 1,0,-1,0 };
#define INF (1 << 28)
ull mod = (int)1e9 + 7;
//.....................
const int MAX = (int)2e5 + 5;

int main() {
	map<int, int> m;
	int v;
	while (cin >> v) {
		m[v]++;
	}
	vector<pair<int,int>> vec;
	for (auto p : m) {
		vec.push_back({ p.second, p.first });
	}
	sort(ALL(vec));
	rep(i,vec.size()) {
		if (vec[i].first == vec.back().first) {
			cout << vec[i].second << 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,0);
    int n;
    while(cin >> n){
        vec[n]++;
        int tmp = 0;
        rep(i,vec.size()){
            tmp = max(tmp,vec[i]);
        }
        rep(i,vec.size()){
            if(tmp == vec[i]) cout << i << endl;
        }
    }
    return 0;
}

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

int main()
{
  int n,m=0;
  int c[MAX]={};

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

C++: #include <cstdio>
#include <algorithm>
using namespace std;
int m[101];
int main() {
  int a, mv = 0;
  while (~scanf("%d", &a)) {
    m[a]++;
    mv = max(m[a], mv);
  }
  for (int i = 1; i < 101; ++i) {
    if (m[i] == mv) printf("%d\n", i);
  }
}

C++: #include <stdio.h>

struct freqency {
  
  int num;
  int freq;

}f[1000];

int main(void) {

  int n;

  int size=0;
  int max_freq=0;

  int mode[1000];
  int s=0;

  int i;
  int flag;
  int j;

  while(scanf("%d",&n)!=EOF) {
  //for(j=0;j<10;j++) {
    scanf("%d",&n);
    flag=0;

    for(i=0;i<size;i++) {

      if(f[i].num==n) {
	flag=1;
	f[i].freq++;
      }

    }

    if(flag==0) {
	f[size].num=n;
	f[size].freq=1;
	size++;
    }

  }
  
  //for(j=0;j<10;j++) printf("%d %d\n",f[j].num,f[j].freq);

  for(i=0;i<size;i++) {

    if(max_freq<=f[i].freq) {
      max_freq=f[i].freq;
      mode[s]=f[i].num;
      s++;
    }

  }

  for(i=0;i<s;i++) {
    printf("%d\n",mode[i]);
  }

  return 0;

}

C++: #include <iostream>
#include <cmath>
#include <vector>
#include <cstdio>
#include <algorithm>
using namespace std;
int main ()
{
	int a[110]={};
	int x;
	while(scanf("%d",&x)!=EOF)a[x]++;
	int m=-1;
	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;
}

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

C++: #include "bits/stdc++.h"

#define REP(i,num) for(int i=0;i<(num);++i)
#define ALL(c) c.begin(),c.end()
#define PRINTALL(c) for(auto& x:c){cout<<x<<' ';}cout<<endl;
#define PAIRCOMP(c,comp) [](const pair<ll,ll>& lhs,const pair<ll,ll>& rhs){return lhs.c comp rhs.c;}

using namespace std;
using ll = long long;

constexpr ll atcoder_mod = 1e9+7;

template<typename T=int>
T in(){T x; cin >> x; return (x);}
template<typename T=int,typename C=vector<T>>
C vecin(int N){C x(N);REP(i,N){x[i]=in<T>();}return move(x);}

void vout(){cout << endl;}
template<typename Head,typename... Tail>
void vout(Head&& h,Tail&&... t){cout << ' ' << h;vout(forward<Tail>(t)...);}
void out(){cout << endl;}
template<typename Head,typename... Tail>
void out(Head&& h,Tail&&... t){cout << h;vout(forward<Tail>(t)...);}

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);

	vector<pair<int,int>> A(100);
	REP(i,100){
		A[i].first = i+1;
		A[i].second = 0;
	}
	int v;
	while(cin>>v){
		A[v-1].second++;
	}
	sort(ALL(A),[](pair<int,int>& l,pair<int,int>& r){return l.second==r.second ? l.first<r.first : l.second>r.second;});
	int M=A[0].second;
	for(int i=0;i<100;i++){
		if(A[i].second!=M) break;
		out(A[i].first);
	}
	return 0;
}

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

using namespace std;

/*-------------------------------*/
#define FOR(i, a, b) for(int i = (a); i < (b); i++)  //a~(b - 1)?????§
#define print(i) cout << i << endl //?°??????????Python?????????
#define all(i) (i).begin(),(i).end() //??¨??????(sort??¨???)
#define mp make_pair //mp(OO, OO)??¨???:::pint??¨???

typedef long long ll;
typedef pair<int, int> pint;
typedef vector<int> vi;
typedef vector<vector<int> > vii;
typedef vector<long long> llv;
typedef vector<pint> vpint;
/*-------------------------------*/

int main(void)
{
  int a[101] = {};
  int mx = 0;
  int x;

  while (scanf("%d", &x) != EOF){
    a[x]++;
    if (mx < a[x]) mx = a[x];
  }
  FOR(i, 1, 101){
    if (a[i] == mx){
      cout << i << endl;
    }
  }
  return 0; 
}

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

C++: #include<iostream>
int main(){int l[999],i,f;for(i=0;i<999;i++)l[i]=0;while(std::cin>>i)l[i-1]++;for(i=0,f=0;i<999;i++)if(f<l[i])f=l[i];for(i=0;i<999;i++)if(l[i]==f)std::cout<<i+1<<"\n";}

C++: #include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <queue>
using namespace std;
typedef long long int ll;

int main(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	map<int,int> mp;
	int a;
	while(cin >> a){
		mp[a]++;
	}
	int ma=0;
	for(auto p:mp){
		ma=max(p.second,ma);
	}
	for(auto p:mp){
		if(ma==p.second){
			cout << p.first << endl;
		}
	}
}

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

int main(void){
	int n;
	int x[101];
	for(int i=0; i<101; i++)
		x[i] = 0;

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

	vector<int> res;
	int max = 0;

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

	for(int i=0; i<res.size(); i++){
		cout << res[i] << endl;
	}

	return 0;
}

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

using namespace std;

int main(){
	
	int A[100] = {};
	int B[100] = {};
	int a, count = 0;
	
	while( cin >> a) {
		
		A[a-1] ++;
		B[a-1] ++;
		count++;
	}
	sort(B, B+count);
	
	for(int i=0;i<100;i++)
	if( A[i] == B[count-1])
	cout << i+1 << "\n";
	
    return 0;
}

C++: #include <iostream>

using namespace std;

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