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 <cstdio>
#include <cstring>
#include <algorithm>
#include <string>
#include <cmath>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <iostream>


using namespace std;

int main()
{
	int n;
	int nums[101];
	memset(nums, 0, sizeof(nums));
	int m = 0;
	while (scanf("%d", &n) != EOF)
		m = max(m, ++nums[n]);
	for (int i = 1; i < 101; ++i)
	{
		if (nums[i] == m)
			printf("%d\n", i);
	}

	return 0;
}

C++: #include <iostream>
#include <map>
#include <algorithm>
using namespace std;
int main( void )
{
  int d,n=0;
  map<int,int> m;
  while( 1 ){
    cin>>d;
    if( cin.eof() ) break;
    if( m.find( d ) == m.end() ) m[d]=0;
    m[d]++;
  }
  for( map<int,int>::iterator it = m.begin(); it != m.end(); ++it )
    if( it->second > n ) n = it->second;
  for( map<int,int>::iterator it = m.begin(); it != m.end(); ++it )
    if( it->second == n ) cout << it->first << endl;
  return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <utility>
#define INF 1000000000
#define mod 1000000007
#define rep(i,n) for(int i=0;i<(n);i++)
#define REP(i,a,b) for(int i=(a);i<(b);i++)
#define all(x) (x).begin(),x.end()
using namespace std;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
bool debug=false;

int main(){
  int x[101];
  int n;
  while(cin>>n) x[n]++;
  int maxi=-INF;
  rep(i,101)if(maxi<x[i])maxi=x[i];
  rep(i,101)if(maxi==x[i])cout<<x[i]<<endl;
  return 0;
}

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

int last[101];

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

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

using namespace std;

int main(){
	int num, max;
	int list[100] = {0};
	
	max = 0;

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

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

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

C++: #include <stdio.h>
#include <string.h>

int i, n, max;
int m[101];

int main(void)
{
  memset(m,0,sizeof(m));
  while(scanf("%d",&n) == 1)
    m[n]++;

  max = 0;
  for(i = 1; i <= 100; i++)
     if (m[i] > max) max = m[i];

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

C++: #include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace std;
 
int main()
{
    vector<int> num(101, 0);
    int maxNum = 0;
 
    for(;;){
        int a;
        if(!(cin >> a))
            break;
        maxNum = max(maxNum, ++num[a]);
    }
 
    for(int i=1; i<=100; ++i){
        if(num[i] == maxNum)
            cout << i << endl;
    }
}

C++: #define _USE_MATH_DEFINES

#include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
#include <cmath>
#include <algorithm>
#include <utility>
#include <vector>
#include <numeric>

using namespace std;

int main()
{
	vector<int> a(100);

	int n;
	for (; cin >> n;)
	{
		a.at(n - 1)++;
	}

	vector<int> b = a;
	sort(b.begin(), b.end());

	for (int i = 0; i < a.size(); i++)
	{
		if (a.at(i) == b.back())
		{
			cout << i + 1 << endl;
		}
	}
}

C++: #include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
#define loop(i,x,n) for(int i=(x);i<(n);i++)
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define mp make_pair
#define fir first
#define sec second
#define ub upper_bound
#define lb lower_bound
#define int long long
using namespace std;
const int MOD=1000000007;
const int INF=1000000009;

signed main(){
  vector<int> v(101);
  int n;
  while(cin>>n)v[n]++;
  auto p= *max_element(v.begin(),v.end());
  rep(i,101)if(v[i]==p)cout<<i<<endl;
  return 0;
}

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

#define ALL(a) (a).begin(),(a).end()
#define SORT(c) sort((c).begin(),(c).end())
#define DESCSORT(c) sort(c.begin(), c.end(), greater<int>())

using namespace std;

using LL = long long int;
using LD = long double;

using pii = pair<int, int>;
using pll = pair<LL, LL>;
using pdd = pair<double, double>;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vl = vector<LL>;
using vvl = vector<vl>;
using vvvl = vector<vvl>;
using vd = vector<double>;
using vvd = vector<vd>;
using vs = vector<string>;
using vb = vector<bool>;
using vvb = vector<vb>;

const int INF = (1 << 30) - 1;
const LL INF64 = ((LL)1 << 62) - 1;
const double PI = 3.1415926535897932384626433832795;

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

int gcd(int x, int y) { return y ? gcd(y, x % y) : x; }
LL gcd(LL x, LL y) { return y ? gcd(y, x % y) : x; }

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

	vi cnt(101);

	int n, ma = 0;
	while (cin >> n) {
		if (n == 0) break;
		cnt[n]++;
		ma = max(ma, cnt[n]);
	}

	for (int i = 0; i < 101; i++) {
		if (cnt[i] == ma) {
			cout << i << endl;
		}
	}
	return 0;
}

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

int main(void)
{
	int a, maxim=-1, num[100] = { 0 };

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

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

int num[10];
int big = 0;
int input;
int main(){
	for(int i=0; i < 10; i++) num[i]=0;
	while(scanf("%d", &input) != EOF) num[input]++;
	for(int i=0; i < 10; i++) big = max(big, num[i]);
	for(int i=0; i < 10; i++){
		if(num[i] == big){
			cout << i << endl;
		}
	}
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
	int a[101]={},b;
	while(cin>>b){
		if(b==0)break;
		a[b]++;
	}
	b=0;
	for(int i=1;i<=100;i++){
		if(b<a[i]){
			b=a[i];
		}
	}
	for(int i=1;i<=100;i++){
		if(b==a[i]){
			cout<<i<<endl;
		}
	}
	return 0;
}

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

using namespace std;

int main(){
	int a[101] = {0};
	int b;
	int MAX = 0;
	int i=0;

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