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>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
int main(void){
	int n;
	int a[101]={0};

	while(cin>>n){
        a[n]++;

	}
	int b=0;
    for(int i=0;i<100;i++){
        b=max(a[i],b);

    }
    for(int i=0;i<100;i++){
        if(a[i]==b)cout<<i<<endl;

    }

	return 0;
}

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

#define all(c) (c).begin(), (c).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define pb(e) push_back(e)
#define mp(a, b) make_pair(a, b)
#define fr first
#define sc second

const int INF=100000000;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
using namespace std;
typedef pair<int ,int > P;
typedef long long ll;

int ary[105];
int main() {
    int a;
    while(cin>>a) {
        ary[a]++;
    }
    int maxi = *max_element(ary,ary+105);
    rep(i,105) {
        if(maxi==ary[i]) {
            cout<<i<<endl;
        }
    }
    return 0;
}

C++: #include <iostream>

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 (max == list[j]){
			cout << j + 1 << endl;
		}
	}
	return 0;
}

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

int main()
{
	std::vector<int> hist(100, 0);

	int index = 0;
	int max = 0;
	while (std::cin >> index)
	{
		hist[index - 1]++;
		if (max < hist[index - 1])
		{
			max = hist[index - 1];
		}
	}

	int i = 1;
	for (const auto& h : hist)
	{
		if (h == max)
		{
			std::cout << i << std::endl;
		}
		++i;
	}

	return 0;
}

C++: #include<iostream>
#include<cstdio>
using namespace std;
int main()
{
    int date[100],scan,maxe=1;
    for(int i=0;i<100;i++)date[i]=0;

    while(scanf("%d",scan)!=EOF){
        date[scan]++;
        if(maxe<date[scan])maxe++;

    }
    for(int i=0;i<100;i++){
        if(maxe==date[i])cout<<i<<endl;
    }

}

C++: #include<iostream>
#include<string.h>
#include<vector>
using namespace std;
int main()
{
    int a[101];
    memset(a,0,sizeof(a));
    vector<int>vec;
    int in;
    while(cin>>in){
        a[in]++;
    }
    int m=0;
    for(int i=0;i<101;i++){
        if(a[i]>m){
            vec.clear();
            vec.push_back(i);
        }
        if(a[i]==m){
            vec.push_back(i);
        }
    }
    sort(vec.begin(),vec.end());
    for(int i=0;i<vec.size();i++){
        cout<<vec[i]<<endl;
    }
    return 0;
}

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

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

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

using namespace std;

int main(int argc, char **argv)
{
	int tmp;
	int *array = (int *)calloc(10, sizeof(int));
	
	while(cin >> tmp){
		array[tmp]++;
	}
	
	tmp = 0;
	for(int i = 0; i < 10; i++){
		if(tmp < array[i]){
			tmp = array[i];
		}
	}
	
	for(int i = 0; i < 10; i++){
		if(array[i] == tmp){
			cout << i << endl;
		}
	}
	
	free(array);
	return 0;
}

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

int main()
{
	int a[101] = {};
	int in, maxa=0;
	while (cin >> in, !cin.eof()){
		a[in]++;
	}
	for (int i = 0; i < 101; i++){
		maxa = max(maxa, a[i]);
	}
	for (int i = 0; i < 101; i++){
		if (a[i] == maxa){
			cout << i << endl;
		}
	}

	return 0;
}

C++: #include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <deque>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <bitset>
#include <algorithm>
#include <numeric>
#include <complex>
#include <functional>
#include <utility>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>

using namespace std;

#define debug(n) cout<<"# "<<#n<<": "<<(n)<<endl
#define repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define rep(i,n) repi(i,0,n)
#define iter(c) __typeof((c).begin())
#define tr(c,i) for(iter(c) i=(c).begin();i!=(c).end();i++)
#define allof(c) (c).begin(),(c).end()
#define mp make_pair

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

int main()
{
	vi a;
	for(int n;cin>>n;)
		a.push_back(n);
	
	vi hist(101);
	rep(i,a.size())
		hist[a[i]]++;
	
	int mode_count=*max_element(allof(hist));
	rep(i,hist.size())
		if(hist[i]==mode_count)
			cout<<i<<endl;
	
	return 0;
}

C++: #include <iostream>

using namespace std;

int main()
{
	int count[101] = {0};
	int a;
	
	while ( cin >> a ) count[a]++;
	
	int max_freq = 0;
	for (int i=1; i<=100; i++) {
		if (max_freq < count[i]) max_freq = count[i];
	}
	for (int i=1; i<=100; i++) {
		if (count[i] == max_freq) cout << count[i] << endl;
	}
	
	return 0;
}

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

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

    int n, max_cnt = -1;
    std::array<int, 101> arr{{}};
    
    while (std::cin >> n) {
        max_cnt = (max_cnt > ++arr[n]
                   ? max_cnt : arr[n]);
    }

    for (int i = 1; i < 101; ++i) {
        if (arr[i] == max_cnt) {
            std::cout << i << std::endl;
        }
    }

    return 0;
}

C++: #include<iostream>
using namespace std;
 
int main(){

int numbers[100] , x ,y, i;

while ( cin >> x ){
numbers[x - 1]++;
}

y = 0;
for( i = 0 ; i < 100 ; i++ ){
??????if (numbers[i] > y){
      y = numbers[i];
    }
}

for ( i = 0 ; i < 100 ; i++ ) {
     if ( y == numbers[i] ){
       cout << i + 1 << endl;
      }
}

return 0;
}

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

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

C++: #include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstring>
#include<cstdio>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define rp(a) while(a--)
#define pb push_back
#define mp make_pair
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double EPS=1e-10;
using namespace std;
typedef long long ll;
typedef vector<int> vi;
int main(){
	int out[101]={0};
	int n;
	while(cin>>n)out[n]++;
	int ma=0;
	rep(i,100)ma=max(ma,out[i]);
	rep(i,100)if(ma==out[i])cout<<i<<endl;
}