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>
using namespace std;

int main(){
	vector<int> cnt(101,0);
	for(int i; cin>>i;){
		cnt[i]++;
	}
	int max = 0;
	vector<int> ans;
	for(int i=1; i<101; i++){
		if(cnt[i] > max){
			max = cnt[i];
			ans.clear();
			ans.push_back(i);
		}else if(cnt[i] == max){
			ans.push_back(i);
		}
	}
	for(int i=0; i<ans.size(); i++){
		cout<<ans[i]<<endl;
	}
}

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

using namespace std;

void solve()
{
	vector<int> Vec(100);
	int n;
	while(cin >> n)
	{
		++Vec[n];
	}
	int max = 0;
	for(int i = 0; i < Vec.size(); ++i)
	{
		if(max < Vec[i])
		{
			max = Vec[i];
		}
	}
	for(int i = 0; i < Vec.size(); ++i)
	{
		if(max == Vec[i])
		{
			cout << i << endl;
		}
	}
}

int main()
{
	solve();
	return(0);
}

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

C++: #include <stdio.h>
int main(){
char ch;
int num,max;
int p[10]={0};
int q[2][10]={0};
while(1)
{
	scanf("%c",&ch);
		if(ch=='\n')break;
num=ch-'0';
p[num]++;
}
max=0;
for(int i=0;i<10;i++){
if(max<p[i])max=p[i];
}
for(int i=0;i<10;i++){
if(max==p[i])printf("%d\n",i);
}

return 0;
}

C++: #include <iostream>

using namespace std;
#define rep2(x,from,to) for(int x=(from); x<(to); (x)++)
#define rep(x,to) rep2(x,0,to)
int main() {
	int n, a[101];
	rep2(i,1,100) {
		a[i] = 0;
	}
	while(cin >> n) {
		a[n]++;
	}
	int max = 0;
	rep2(i,1,100) {
		if(max < a[i]) max = a[i];
	}
	rep2(i,1,100) {
		if(a[i] == max) {
			cout << i << endl;
		}
	}
	return 0;
}

C++: #include <iostream>
using namespace std;
int main(){
    int a[100];
    for(int i=0;i<100;i++)
        a[i]=0;
    int x;
    while(cin >> x){
        a[x-1]+=1;
    }
    int max=0;
    for(int i=0;i<100;i++){
        if(max<a[i])
            max=a[i];
    }
    for(int i=0;i<100;i++){
        if(max==a[i])
            cout << i+1 << endl;
    }

}

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

int main() {
  int n;
  vector<int> a_list;
  map<int, int> a;
  while (cin >> n) {
    a[n]++;
    a_list.push_back(n);
  }
  sort(a_list.begin(), a_list.end());
  a_list.erase(unique(a_list.begin(), a_list.end()), a_list.end());
  int max_n = 0;
  int i;
  for (i = 0; i < a_list.size(); i++) {
    max_n = max(max_n, a[a_list[i]]);
  }
  for (i = 0; i < a_list.size(); i++) {
    if (a[a_list[i]] == max_n) {
      cout << a_list[i] << endl;
    }
  }
  return 0;
}

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

int main(){

  int a[101];
  int n,M;

  for(int i = 1; i <= 100;i++ )a[i] = 0;
  M = 0;
  while(~scanf("%d",&n)){
    a[n]++;
    M=max(M,a[n]);
    cout << M << endl;
  }
  for(int i = 1;i <= 100 ; i++ ){
    if(a[i] == M)cout << i << endl;
}
  return 0;
}

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

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

int main() {
  vector<int> arr(MAX,0);
  int num;
  while(cin >> num) {
    arr[num]++;
  }
  int mode_max = 0;
  for(int i=0;i<MAX;i++) {
    mode_max = max(mode_max,arr[i]);
  }
  for(int i=0;i<MAX;i++) {
    if(arr[i] == mode_max) {
      cout << i << endl;
    }
  }
}

C++: #include <bits/stdc++.h>
using namespace std;
int main()
{
    int i,j,ara[1000],n=0,ara2[1000],k=0,c=1,max=0,mode,m;

    while (scanf ("%d",&m)!=EOF)
    {
        ara[n]=m;
        n++;
    }
    for (i=0;i<n-1;i++)
    {
        mode=0;
        for (j=i+1;j<n;j++)
        {
            if (ara[i]==ara[j])
            {
                mode++;
            }
        }
        if ((mode>max) && (mode!=0))
        {
            k=0;
            max=mode;
            ara2[k]=ara[i];
            k++;
        }
        else if (mode==max)
        {
            ara2[k]=ara[i];
            k++;
        }
    }
        sort(ara2,ara2+k);
        for (i=0;i<k;i++)
        {
            printf("%d\n",ara2[i]);
        }
        return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<vector>
#include<string>
#include<sstream>
#include<cmath>
#include<numeric>
using namespace std;

int main(){

  vector<int> a(101);
  int tmp;
  while(cin >> tmp){
    a[tmp]++;
  }
  int ans = *max_element(a.begin(), a.end());
  for(int i=0; i<101; i++){
    if( a[i] == ans ) cout << i << endl;
  }

  return 0;
}