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() {
	ios_base::sync_with_stdio( false );

	vector<int> v( 101 );
	int x = 0;

	int a;
	while( cin >> a ) {
		v[a] += 1;

		if( v[a] > x ) {
			x = v[a];
		}
	}

	for( int i = 1; i < v.size(); ++i ) {
		if( v[i] == x ) {
			cout << i << '\n';
		}
	}
}

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

int main(){
	int n;
	vector<pair<int,int> > rank(101);
	for(int i=0; i<101; i++ ) rank[i] = make_pair(0,i);
	while( cin >> n ){
		rank[n].first++;
	}
	sort(rank.begin(), rank.end(),greater<pair<int,int> >());
	cout << rank[0].second << endl;
	for(int i=1; rank[i-1].second>rank[i].second; i++) cout << rank[i].second << endl;
}

C++: #include <iostream>
using namespace std;
int main(){
	int n,max=0,h[101]={0};
	while(cin>>n){
		h[n]++;
		if(h[n]>max)max=h[n];
	}
	for(int i=1;i<=100;++i)if(h[i]==max)cout<<i<<"\n";
	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 <bits/stdc++.h>
using namespace std;

int main() {
	int a,max=INT_MIN;
	vector<int> A;
	map<int, int> mp;
	while (cin >> a) {
		A.push_back(a);
		mp[a] = 0;
	}
	for (auto itr = mp.begin(); itr != mp.end(); itr++) {
		for (int i = 0; i < A.size(); i++) {
			if (itr->first == A[i])itr->second++;
		}
	}
	for (auto itr = mp.begin(); itr != mp.end(); itr++) {
		if (max < itr->second)max = itr->second;
	}
	for (auto itr = mp.begin(); itr != mp.end(); itr++) {
		if (itr->second == max)cout << itr->first << endl;
	}
	return 0;
}

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

using namespace std;

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

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

using namespace std;

int main(void){


    vector<int> array(101,0);
    int n,maxi = 0;

    while(cin >> n){

        array[n]++;

    }

    for(int i = 1;i < 101;i++){
        if(array[i] > maxi){
            maxi = array[i];
        }
    }

    for(int i = 1;i < 101;i++){
        if(array[i] == maxi){
            cout << i << endl;
        }
    }
    return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <deque>
using namespace std;
int main(){
	int data[150]={0},cp[150]={0},t,cnt=1,max,i=0;
	while(cin>>t){
		data[t]++;
		cnt++;
	}
	for(i=0;i<cnt;i++){
		cp[i]=data[i];
	}
	sort(data,data+150);
	for(int j=0;j<cnt;j++){
		if(data[0]==cp[i]){
			cout<<i<<endl;
		}
	}
return 0;
}

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

#ifdef _MSC_VER
#define __typeof__ decltype
#endif

#define ITER(c)         __typeof__((c).begin())
#define FOREACH(it, c)  for (ITER(c) it=(c).begin(); it != (c).end(); ++it)
#define MAX(p1,p2)      (((p1)>(p2))?(p1):(p2))

map<int,int> m;

int main(){
    int n, max = 0;
    while(cin >> n) m[n]++;
    FOREACH(it,m) max = MAX(max, it->second);
    FOREACH(it,m) if(it->second == max) cout << it->first << endl;
    return 0;
}

C++: #include <cstdio>

using namespace std;

int a[100],mp[101] = {0};

signed main()
{
    int key, j = 0;
    while ( scanf("%d\n", &key ) != EOF)
    {
        a[j] = key;
        mp[ key ]++;
        j++;
    }
    int mode_value = 0;
    for( int i = 1; i <= 100; i++ )
    {
        if( mode_value < mp[i] )
        {
            mode_value = mp[i];
        }
    }
    
    for( int i = 1; i <= 100; i++ )
    {
        if( mp[i] == mode_value )
        {
            printf( "%d\n", i );
        }
    }
    return 0;
}

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

using namespace std;

int main()
{
	vector<int> a(101, 0);
	int n, max = 0;
	
	while (cin >> n)
	{
		a[n]++;
		if (a[n] > max) max = a[n];
	}

	for (int i = 1; i < a.size(); ++i)
		if (a[i] == max) cout << i << endl;

	return 0;
}

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

using namespace std;

int main()
{
	vector<int> a(101, 0);
	int n, max = 0;
	
	while (cin >> n, n != 4)
	{
		a[n]++;
		if (a[n] > max) max = a[n];
	}

	for (int i = 1; i < a.size(); ++i)
		if (a[i] == max) cout << i << endl;

	return 0;
}

C++: #include<iostream>
#include<iomanip>
#include<algorithm>
#include<cctype>
#include<cmath>
#include<cstdio>
#include<set>
#include<stack>
#include<string>
#include<sstream>
#include<map>
#include<queue>
#include<vector>
using namespace std;

int main() {
	vector<int> a(101),A(101);
	for (int b; cin >> b;) a[b]++;
	A = a;
	sort(A.rbegin(),A.rend());
	for (int i = 0; i < 101; i++) 
		if (a[i] == A[0])cout << i << endl;

	return 0;
}

C++: # include <iostream>
# include <algorithm>
# include <stdio.h> 
using namespace std;
int a[101];
int c[101];

int main(){
    int num = 0;
    int max = 0;
    int b;
   while((scanf("%d",&b)) != EOF){
        a[b]++;
    }
    for(int i = 1; i < 101 ; i++){
        if (a[i] > max) max=a[i];
    }
    for(int i = 1; i < 101 ; i++){
        if (a[i] == max){
            c[num] = i;
            num++;
        }
    }
    sort(c,c+num);
    for(int i = 0; i < num; i++){
        cout<<c[i]<<endl;
    }
}

C++: #include <iostream>

using namespace std;

int main(){

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

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

int main(){
    int n, m=0;
    int a[101];
    vector<int> ans;

    for(int i=1 ; i <= 100 ; i++){
        a[i] = 0;
    }
    while( cin >> n ){
        a[n]++;
    }
    for(int i=1 ; i <= 100 ; i++){
        m = max( a[i] , m );
    }
    for(int i=1 ; i <= 100 ; i++){
        if( m == a[i] ) ans.push_back(i);
    }
    sort( ans.begin() , ans.end() );
    for(int i=0 ; i < ans.size() ; i++ ){
        cout << ans[i] << endl;
    }
}

C++: #include <stdio.h>
//using namespace std;

#define N 100
#define MYSCAN scanf

int main(void){

	int i;
	int input, max = 0;
	int bucket[N + 1];

	// テゥツ?催・ツ按療」ツ?ョテ・ツ按敕ヲツ慊淌・ツ個?
	for (int i = 0; i < N + 1; i++){
		bucket[i] = 0;
	}

	// テ・ツ?・テ・ツ環崚」ツ?ォテ」ツ?療」ツ?淌」ツ?古」ツ?」テ」ツ?ヲテゥツ??ヲツャツ。テゥツ?催・ツ按療」ツつ津」ツつォテ」ツつヲテ」ツδウテ」ツδ暗」ツつ「テ」ツδε」ツδ?
	while (MYSCAN("%d", &input) != EOF){
		bucket[input]++;
	}

	// テ」ツつづ」ツ?」テ」ツ?ィテ」ツつづ・ツ、ツ堙」ツ?湘・ツ?コテ」ツ?淌・ツ崢榲ヲツ閉ーテ」ツつ津ヲツアツづ」ツつ?」ツつ?
	for (int i = 0; i < N + 1; i++){
		if (max < bucket[i]){
			max = bucket[i];
		}
	}

	// テ」ツ?敕」ツ?ョテ・ツ崢榲ヲツ閉ーテ」ツ??」ツ?妥・ツ?・テ・ツ環崚」ツ?陛」ツつ古」ツ?淌ヲツ閉ーテ・ツ?、テ」ツつ津・ツ?コテ・ツ環?
	for (int i = 0; i < N + 1; i++){
		if (max == bucket[i]){
			printf("%d\n", i);
		}
	}

	return 0;
}