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>

#define rep(i, n) for (int i = 0; i < int(n); i++)
#define rrep(i, n) for (int i = int(n) - 1; i >= 0; i--)
#define reps(i, n) for (int i = 1; i <= int(n); i++)
#define rreps(i, n) for (int i = int(n); i >= 1; i--)
#define repc(i, n) for (int i = 0; i <= int(n); i++)
#define rrepc(i, n) for (int i = int(n); i >= 0; i--)
#define repi(i, a, b) for (int i = int(a); i < int(b); i++)
#define repic(i, a, b) for (int i = int(a); i <= int(b); i++)
#define each(x, y) for (auto &x : y)
#define all(a) (a).begin(), (a).end()
#define bit(b) (1ll << (b))

using namespace std;

using i32 = int;
using i64 = long long;
using u64 = unsigned long long;
using f80 = long double;
using vi32 = vector<i32>;
using vi64 = vector<i64>;
using vu64 = vector<u64>;
using vf80 = vector<f80>;
using vstr = vector<string>;

inline void yes() { cout << "Yes" << '\n'; exit(0); }
inline void no() { cout << "No" << '\n'; exit(0); }
inline i64 gcd(i64 a, i64 b) { if (min(a, b) == 0) return max(a, b); if (a % b == 0) return b; return gcd(b, a % b); }
inline i64 lcm(i64 a, i64 b) { return a / gcd(a, b) * b; }
inline u64 xorshift() { static u64 x = 88172645463325252ull; x = x ^ (x << 7); return x = x ^ (x >> 9); }
void solve(); int main() { ios::sync_with_stdio(0); cin.tie(0); cout << fixed << setprecision(16); solve(); return 0; }
template <typename T> class pqasc : public priority_queue<T, vector<T>, greater<T>> {};
template <typename T> class pqdesc : public priority_queue<T, vector<T>, less<T>> {};
template <typename T> inline void amax(T &x, T y) { if (x < y) x = y; }
template <typename T> inline void amin(T &x, T y) { if (x > y) x = y; }
template <typename T> inline T power(T x, i64 n, T e = 1) { T r = e; while (n > 0) { if (n & 1) r *= x; x *= x; n >>= 1; } return r; }
template <typename T> istream& operator>>(istream &is, vector<T> &v) { each(x, v) is >> x; return is; }
template <typename T> ostream& operator<<(ostream &os, vector<T> &v) { rep(i, v.size()) { if (i) os << ' '; os << v[i]; } return os; }
template <typename T, typename S> istream& operator>>(istream &is, pair<T, S> &p) { is >> p.first >> p.second; return is; }
template <typename T, typename S> ostream& operator<<(ostream &os, pair<T, S> &p) { os << p.first << ' ' << p.second; return os; }

void solve() {
  vi32 cnt(101);
  int n;
  while (cin >> n) {
    cnt[n]++;
  }
  int ma = 0;
  reps(i, 100) amax(ma, cnt[i]);
  reps(i, 100) {
    if (cnt[i] == ma) cout << i << '\n';
  }
}

C++: #include<stdio.h>

int table[101];

int main(void) {
  int target;

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

C++: #include<iostream>
#include<cstdio>
#include<vector>
using namespace std;
int main()
{
int a[100];
for(int i=0;i<100;i++)a[i]=0;
int n;
while(cin >> n){
a[n-1]++;
}
int ans=0;
for(int i=1;i<100;i++){
if(a[ans]<a[i])ans=i;
}
cout << i+1 << "\n";
return 0;
}

C++: #include<cstdio>
#include<algorithm>
#include<vector>
#include<string>
#include<iostream>
#include<queue>
#include<map>
#include<set>
#include<complex>
#include<stack>
#include<cmath>

using namespace std;

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


#define X real()
#define Y imag()
typedef complex<double> P;

int main(){
	
	map<int,int> m;
	int a;
	while(scanf("%d",&a)!=EOF){
		m[a]++;
	}
	
	typedef pair<int,int> pii;
	vector<pii> b;
	
	map<int,int>::iterator it = m.begin();
	while(it!=m.end()){
		b.push_back(pii(-it->second, it->first));
		it++;
	}
	
	sort(b.begin(),b.end());
	
	for(int i=0;i<b.size();i++){
		if(i!=0 && b[i].first!=b[i-1].first){
			break;
		}
		printf("%d\n",b[i].second);
	}
	
	
}

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

int main(){

  int i, m, a[N] = {};
  while(cin >> i)
    a[i]++;

  for(int j = 1; j < N; j++) 
    m = max(m,a[j]);

  for(int k = 1; k < N; k++)
    if(a[k] == m) 
      cout << k << "\n";
  
}

C++: #include <iostream>
#include <algorithm>
#include <stdio.h>

using namespace std;

int main(){
	int ary[100];
	int hikaku[100];
	int n;
	int a = 0;
	
	for(int i = 1; i <= 100; i++){
		ary[i] = i;
		hikaku[i] = 0;
	}

	while(scanf("%d",&n) != EOF){

		for(int i = 1; i <= 100; i++){

			if(ary[i] == n){
				hikaku[i]++;
				a = max(a,hikaku[i]);
			}
		}

	}

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

	return 0;
}

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

int main() {
	map<int,int> data;
	int n,max;
	while (cin >> n) {
		data[n]++;
	}
	max = 0;
	for (int i = 0; i < data.size();i++)
		if( data[i] > max )
			max = data[i];
	
	map<int,int>::iterator it = data.begin();
	while (it != data.end()) {
		if ( (*it).second == max )
			cout << (*it).first << endl;
		it++;
	}
	return 0;
}

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

int main(){
	int n, a[101], m = 0;
	fill(a, a+101, 0);
	for(int i = 0;cin >> n;i++){
		if(!n)break;
		a[n]++;
		if(a[n] > m)m = a[n];
	}
	for(int i = 0;i < 101;i++)if(a[i] == m)cout << i << endl;
	return 0; 
}

C++: #include <iostream>
#include <stdlib.h>

using namespace std;

int main(int argc, char **argv)
{
	int tmp;
	int *array = (int *)calloc(1000, sizeof(int));
	
	while(cin >> tmp){
		array[tmp]++;
	}
	
	tmp = 0;
	for(int i = 0; i < 1000; i++){
		if(tmp < array[i]){
			tmp = array[i];
		}
	}
	
	for(int i = 0; i < 1000; i++){
		if(array[i] == tmp){
			cout << i << endl;
		}
	}
	
	free(array);
	return 0;
}

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

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

C++: #include<cstdio>
#include<iostream>
int main(void){
  
  int a[100];
  int i;
 
  for(i=0;i<100;i++)
    a[i]=i+1;
  
  int j;
  int n;
  int count[100]={0};
  int max=0;
  
  for(j=0;j<100;j++){
    scanf("%d",&n);
    if(n==0)
      break;
    
    for(i=0;i<100;i++){
      if(a[i]==n){
	count[i]++;
      }
      if(count[i]>max){
	max=count[i];
      }
    }
  }

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

C++: #include <iostream>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <string>
#include <cmath>

#define rep(x,to) for(int x=0;x<to;x++)
#define rep2(x,from,to) for(x=from;x<to;x++)

using namespace std;


int main(void){

int shk[102]={0}, su;
	while(cin >> su ){
		shk[su]++;
	}
	int j, mx = -999;
	rep2(j,1,101) mx = max(mx,shk[j]);
	rep2(j,1,101) if(mx==shk[j]) cout << j << endl;
	
	
	return 0;
}