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>
#include <stdio.h>
#include <numeric>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define repone(i,n) for(int i=1;i<(int)(n);++i)
#define repo(i,o,n) for(int i=o;i<(int)(n);++i)
#define Rep(j,n) for(int j=0;j<(int)(n);++j)
#define Repo(j,o,n) for(int j=o;j<(int)(n);++j)
#define Repone(j,n) for(int j=1;j<(int)(n);++j)
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
#define int long long
#define pb(a) push_back(a)
#define pbpair(a,b) push_back(make_pair(a,b))
#define MOD 1000000007
#define INF 9223372036854775807
#define pairint pair<int,int>
typedef pair< int , int> P;
int gcd( int x, int y ){
   return y ? gcd(y, x%y) : x;
 }
bool pairCompare(const P& firstElof, const P& secondElof)
{
  if(firstElof.second!= secondElof.second)    return firstElof.second> secondElof.second;
  else return firstElof.first< secondElof.first;
}
signed main() {
int x=0,y=0,z=0,w=0,n=0,m=0;
std::vector< pairint > v(101);
string k;
while(std::cin >> x){
v[x].first=x;
v[x].second++;
}
sort(all(v),pairCompare);
std::cout << v[0].first << '\n';
repone(i,101){
  if(v[0].second==v[i].second){
    std::cout << v[i].first << '\n';
  }else {
    return 0;
  }
}
}

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

int main() {
    int x[1000] = {};
    int a;
    while(cin >> a) {
        x[a]++;
    }

    int mx = -1, mx_count = 0;
    for (int i = 0; i < 101; i++) {
        if (mx_count < x[i]) {
            mx = i;
            mx_count = x[i];
        }
    }
    for (int i = 0; i < 101; i++) {
        if (mx_count == x[i])
            cout << i << endl;
    }
}

C++: #include<iostream>
using namespace std;
int main()
{
	int a[100]={0};
	int b[100][2]={0};
	int B1,B2;
	int i=0;
	for(int h=0;h<100;h++)
	{
		b[h][1]=h+1;
	}
while (cin>>a[i])
{
	b[a[i]-1][0]++;
	i++;
}
for(int j=0;j<i;j++)
{
	for(int k=i-1;k>=j+1;k--)
	{
		if(b[k][0]>b[j][0])
		{
			B1=b[k][0];
			b[k][0]=b[j][0];
			b[j][0]=B1;
			B2=b[k][1];
			b[k][1]=b[j][1];
			b[j][1]=B2;
		}
	}
}
int l=0;
while(b[l][0]==b[0][0])
{
	cout<<b[l][1]<<endl;
	l++;
}
return 0;
}

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

using namespace std;
#define LENGTH 100

int main(){
  
  vector<int> Digit(LENGTH, 0);
  
  
  int tmp;
  int cnt=0;
  while(cin >> tmp){
    cnt++;
    Digit[tmp]++;
  }
  int max = 0;
  vector<int> maxDigits;
  for(int i=0;i<cnt;i++){
    if(Digit[i]>max){
      //      vector<int>().swap(maxDigits); //
      maxDigits.clear();
      maxDigits.push_back(i);
      max = Digit[i];
      //      cout << i << ">:" << endl; 
    }else{
      if(Digit[i]==max){
	maxDigits.push_back(i);
	//	cout << i << "==:" << endl;
      }
    }
  }

  sort(maxDigits.begin(), maxDigits.end());

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

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

int main()
{
	map<int, int> d;
	int n;

	while (cin >> n)
	{
		if (d.find(n) == d.end())
			d[n] = 1;
		else
			d[n]++;
	}

	map<int, int>::iterator it;
	int Max = 0;
	for (it=d.begin(); it!=d.end(); it++)
		if (Max < it->second)
			Max = it->second;

	for (it=d.begin(); it!=d.end(); it++)
		if (it->second == Max)
			cout << it->first << endl;
}

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;
	}
	return 0;
}

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

#define REP(i, a, b) for (int i = (int)(a); i < (int)(b); ++i)
#define rep(i, n) REP (i, 0, n)
#define mset(a, n) memset(a, n, sizeof(a))

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef vector<pair<int, int> > vpii;

int main() {
	int data[100];
	rep (i, 100) data[i] = 0;
	int num, cnt = 0;
	while (cin >> num) {
		data[num]++;
	}
	rep(i, 100) {
		cnt = max(cnt, data[i]);
	}
	rep(i, 100) {
		if (data[i] == cnt) {
			cout << i << endl;
		}
	}
}

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

int main()
{
  int num[101] = {0};
  int n;

  while (~scanf("%d", &n)){
    num[n]++;
  }
  
  int n_max = 0;
  for (int i = 1; i <= 100; i++){
    n_max = max(n_max, num[i]);
  }

  for (int i = 1; i <= 100; i++){
    if (num[i] == n_max){
      printf("%d\n", i);
    }
  }

  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;
}

C++: #include <algorithm>
#include <cmath>
#include <climits>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <cassert>
#include <functional>

using namespace std;

#define LOG(...) printf(__VA_ARGS__)
//#define LOG(...)
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define REP(i,n) for(int i=0;i<(int)(n);++i)
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define RSORT(c) sort((c).rbegin(),(c).rend())
#define CLR(a) memset((a), 0 ,sizeof(a))

typedef long long ll;
typedef unsigned long long ull;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vb> vvb;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

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

int main() {
int a[100]={0};
int n;
while(cin>>n){
a[n-1]++;
}
int ma=0;
REP(i,100){
ma=max(ma,a[i]);
}
REP(i,100){
if(a[i]==ma)
cout<<(a[i]+1)<<endl;
}
}

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

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

using namespace std;

int main(){
	int a[101] = {0};
	int b;
	int MAX = 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;
 		}
	}
}