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 <stdio.h>

int main(void)
{
  int i;

  int freq[100];
  for (i=0; i<100; ++i) {
    freq[i] = 0;
  }

  int n;
  int mode = 0;
  while (scanf("%d", &n) != EOF) {
    ++freq[n-1];
    mode = (mode > freq[n-1]) ? mode : freq[n-1];
  }

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

  return 0;
}

C++: #include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <string>
#define REP(i, n) for(int i = 0;i < n;i++)
#define ll long long
#define INF 114514
using namespace std;




int main(){
	int a[100000] = { 0 }, n, max = 0, f = 0;
	vector<int>v(10000);
	while (cin >> n) {
		a[n]++;
	}
	for (int i = 1; i <= 100; i++) {
		if (a[n] < max) max = a[n];
	}
	for (int i = 1; i <= 100; i++) {
		if (a[i] == max) {
			v[f] = i;
			f++;
		}
	}
	for (int i = 0; i < f; i++) {
		cout << v[f] << endl;
	}
	return 0;
}

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

int main(){
    int d[100];

    int buf;
    while( scanf( "%d",&buf ) != EOF  ) d[buf-1]++;

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

C++: #include<iostream>
#include<string>
#include<vector>
#include<cstdio>
#include<sstream>
#include<algorithm>
#include<cmath>
#include<map>
using namespace std;
int stoi(string x){stringstream ss;ss<<x;int tmp;ss>>tmp;return tmp;}
string itos(int x){stringstream ss;ss<<x;return ss.str();}
int main(){
	int ta[300]={0};
	int n;
	while(cin>>n)ta[n]++;
	int ma=0;
	for(int i=1;i<=100;i++)if(ma<ta[i])ma=ta[i];
	for(int i=1;i<=100;i++)if(ma==ta[i])cout<<i<<endl;
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <stack>
#include <queue>
#include <set>
#include <bitset>
#include <map>
#include <unordered_map>
#include <ctime>
#include <list>
#include <numeric>
#include <utility>
#include <ctime>
#define INF 1000000000
#define LINF 9000000000000000000
#define mod 1000000007

#define rep(i,n) for(int i=0;i<int(n);i++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define REP(i,a,b) for(int i=(a);i<int(b);i++)
#define all(x) (x).begin(),x.end()
#define pb push_back
#define mp make_pair
#define MOD(x) (x%(mod))

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int,int> pi;

int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
int ddx[8]={-1,-1,0,1,1,1,0,-1};
int ddy[8]={0,1,1,1,0,-1,-1,-1};
bool debug=false;

/*---------------------------------------------------*/

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

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

int main()
{
	int data[101] = {0};
	int n, max = 0;
	
	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\n", i);
		}
	}
	
	return (0);
}

C++: #include<iostream>

using namespace std;

int main(){
	int n,max=0;
	int in[10]={0};
	while(cin>>n){
		in[n]++;
		if(max<in[n])max=in[n];
	}
	
	for(int i=0;i<10;i++){
		if(max==in[i])cout<<i<<endl;
	}

}

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

using namespace std;
int main(){
	int a[101]={0},n=0,saidai[100]={0},m=0;
	while(cin>>n){
		a[n]++;
	}
	for(int i=1;i<101;i++){
		if(saidai[m]<a[i]){
			for(int x=0;x<=m;x++){
				saidai[x]=0;
				m=0;
			}
			saidai[m]=i;
		}
		else if(saidai[m]==a[i]){
			saidai[m+1]=saidai[m];
			saidai[m]=i;
			m++;
		}
	}
	sort(saidai,saidai+100);
	for(int i=0;i<=100;i++){
		if(saidai[i]!=0){
			cout<<saidai[i]<<endl;
		}
	}
	return 0;
}

C++: #include<iostream>
using namespace std;
int main() {
	int l[100] = { 0 };
	int n = 0;
	while (!cin.eof()){
		int g;
		cin >> g;
		g--;
		l[g]++;
		if (l[g] >= n) n = l[g];
		cout << n << endl;
	}
	for (int i = 0; i < 100; i++){
		if (l[i] == n) {
			cout << i + 1 << endl;
		}
	}
	char c;
	cin >> c;
}

C++: #include <sstream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
#include <utility>
#include <set>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
using namespace std;
#define INF 100000000
#define MAXN 110
typedef long long ll;

int a[MAXN];

int main(void) {
    int n;
    while (cin >> n) a[n]++;
    int ma = 0;
    for (int i = 0; i <= 100; i++) ma = max(ma, a[i]);
    vector<int> ans;
    for (int i = 0; i <= 100; i++) {
        if (a[i] == ma) ans.push_back(i);
    }
    for (int i = 0; i < ans.size(); i++) {
        cout << ans[i] << endl;
    }
    return 0;
}

C++: #include "bits/stdc++.h"
using namespace std;

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

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

using namespace std;

int main()
{
	int num[100] = {0};
	int n;
	int M = 0, ct = 0;
	
	while (cin >> n){
		num[n]++;
		ct++;
		M = max(M, num[n]);
	}
	
	for (int i = 0; i < ct; i++){
		if (M == num[i]){
			cout << i << "\n";
		}
	}
	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 (cin >> x){
    a[x]++;
    if (mx < a[x]) mx = a[x];
  }
  FOR(i, 1, 101){
    if (a[i] == mx){
      cout << i << endl;
    }
  }
  return 0; 
}

C++: #include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <string>
#define REP(i, n) for(int i = 0;i < n;i++)
#define ll long long
#define INF 114514
using namespace std;




int main(){
	int a[100000] = { 0 }, n, max = 0, f = 0;
	//vector<int>v(10000);
	while (cin >> n) {
		a[n]++;
	}
	for (int i = 1; i <= 100; i++) {
		if (a[n] < max) max = a[n];
	}
	for (int i = 1; i <= 100; i++) {
		if (a[i] == max) {
			cout << i << endl;
		}
	}
	return 0;
}