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 <iostream>
#include <string>
using namespace std;
int main(){
	int a[100],b[100],c;
	for(int i=0;i<100;i++){
		a[i]=0;
		b[i]=0;
	}
	while(cin>>c){
		int i=0;
		while(true){
			if(a[i]==c||a[i]==0){
				b[i]++;
				break;
			}
			i++;
		}
	}
	for(int i=0;i<99;i++){
      for(int j=99;j>i;j--){
	    if(a[j]>a[j-1]){
	      int t=a[j];
	      a[j]=a[j-1];
	      a[j-1]=t;
		  t=b[j];
	      b[j]=b[j-1];
	      b[j-1]=t;
	    }
      }
    }
	int k=0;
	while(true){
		if(b[k]!=b[0])
			break;
	}
	for(int i=0;i<k-1;i++){
      for(int j=k-1;j>i;j--){
	    if(a[j]<a[j-1]){
	      int t=a[j];
	      a[j]=a[j-1];
	      a[j-1]=t;
	    }
      }
    }
	for(int i=0;i<k;i++)
		cout<<a[i]<<endl;
	return 0;
}

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

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

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

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

int main() {
	long long COUNT[100] = {}, A;
	while (cin >> A) {
		A--, COUNT[A]++;
	}
	long long MAX = 0;
	for (int i = 0; i < 100; i++) MAX = max(MAX, COUNT[i]);
	for (int i = 0; i < 100; i++) {
		if (MAX == COUNT[i]) cout << i + 1 << endl;
	}
}

C++: #include <iostream>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <string>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)

int main(void)
{
    int n, a[100], mode = 0;
    rep(i, 100) {
        a[i] = 0;
    }
    while (cin >> n)
        a[n]++;
    
    rep(i,100) {
        if (mode < a[n]) {
            mode = a[n];
        }
    }
    
    rep(i,100) {
        if (a[i] == mode) {
            cout << i << endl;
        }
    }
    
    return 0;
}

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

using namespace std;

int main()
{
	int number[101] = { 0 };
	int tmp, max_num = 0;

	while ( cin >> tmp )
	{
		number[tmp] = number[tmp] + 1;
		max_num = max( number[tmp], max_num );
	}

	tmp = 0;
	while ( tmp < 101 )
	{
		if ( max_num == number[tmp] )
		{
			cout << tmp << endl;
		}
		tmp = tmp + 1;
	}

	return 0;
}

C++: 
#include<iostream>
#include<algorithm>
using namespace std;
int main(){
int a[10000]={0};
int s,sai,ans=0,c=0,i;
while(c!=12){
a[s]++;
c++;
}
for(i=0;i<c;i++){
if(a[i]>ans){
ans=a[i];
sai=i;
}
}
cout<<sai<<endl<<ans<<endl;
return 0;
}

C++: #include <algorithm>
#include <functional>
#include <vector>
#include <map>
using namespace std;

int main(){
  int n,x;
  map<int,int>m;
  for(;cin>>x;m[x]++);
  vector<pair<int,int> >v;
  for(map<int,int>::iterator it=m.begin();it!=m.end();it++)v.push_back(make_pair((*it).second,(*it).first));
  sort(v.begin(),v.end(),greater<pair<int,int> >());
  vector<int>w;
  for(n=v[0].first,x=0;v[x].first==n;x++)w.push_back(v[x].second);
  sort(w.begin(),w.end());
  for(n=0;n<w.size();n++)cout<<w[n]<<endl;
}

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

int main(void){
	int check[101]={0};
	int n,MAX=0;
	while(cin >> n, !cin.eof()){
		check[n]++;
	}
	for(int i=1;i<=100;i++)
		MAX=max(MAX,check[i]);
	for(int i=1;i<=100;i++)
		if(check[i]==MAX)
			cout << i << endl;
	return 0;
}

C++: #include<stdio.h>

#define MAX 100

int main(void){

  int array[MAX] = {0};
  int i;
  int count = 0;

  while(scanf("%d",&i) != EOF){
    array[i]++;

    if(array[i] > count)
      count = array[i];
  }

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

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

using namespace std;

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

C++: //↓template↓

#include "bits/stdc++.h"
using namespace std;
#define Would
#define you
#define all(n)  n.begin(),n.end()
const long long INF = 1e18;
const long long MOD = 1e9 + 7;
const double pi = acos(-1);
const int SIZE = 1 << 17;
int dx[] = { 1,0,-1,0 }, dy[] = { 0,1,0,-1 }, alp[30];
long long fac[200005], finv[200005], inv[200005];
vector<long long>dij;
struct edge { long long to, cost; };
vector<vector<edge> >G;

long long mod_pow(long long a, long long b) {
	long long res = 1, mul = a;
	for (int i = 0; i < 31; ++i) {
		if (b >> i & 1) {
			res *= mul;
			res %= MOD;
		}
		mul = (mul * mul) % MOD;
	}

	return res;
}

void addedge(int from, int to, int cost) {
	G[from].push_back({ to,cost });
	G[to].push_back({ from,cost });
}

//↑template↑


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

C++: #include <bits/stdc++.h>
using namespace std;
int cnt[101];

int main() {
  int v;
  while (cin >> v) {
    cnt[v]++;
  }
  int maxv = 0;
  for (int i = 1; i <= 100; i++) {
    maxv = max(maxv, cnt[i]);
  }
  for (int i = 1; i <= 100; i++) {
    if (cnt[i] == maxv) {
      cout << i << "\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;
	}
//scanf("%d",&n) != EOF

	while(cin >> n){

		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>

using namespace std;

int main(){
  #define MMM 100
  int num_count[MMM] = {0};
  int num;
  int mode_value=0;

  while(cin >> num){
    num_count[num]++;
    if(num_count[num] > mode_value){
      mode_value++;
    }
  }
  
  for(int i=0;i<MMM;i++){
    if(num_count[i] == mode_value){
      cout << i << endl;
    }
  }
}

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

int main() {
  vector<int> v;
  int temp;
  
  while(cin>>temp) v.push_back(temp);
  int mx=0, cnt[101] = {};
  for(int i = 0; i < v.size(); i++) mx = max(mx, ++cnt[v[i]]);
  for(int i = 0; i < 101; i++) if(mx == cnt[i]) cout << i << endl;
  return 0;
}