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<cstdio>
#include<cmath>
#include<iostream>
#include<algorithm>
using namespace std;
int main(){
    int num[1000]={0};
    int a;
    while(cin>>a)num[a]++;
    int flg=0;
    for(int i=100;;i--){
        for(int j=0;j<200;j++){
            if(num[j]==i){
                flg=1;
                cout<<j<<endl;
            }
        }
        if(flg)break;
    }
    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;
	for(int i=0;i<100;i++){
		max_r = max( max_r, Vec[i]);
	}
	for(int i=0;i<100;i++){
		if(max_r == Vec[i]){
			ans = i;
		}
	}
	cout<<i<<endl;
	
	return 0;
}

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

using namespace std;

int main() {
    map<int, int> map;
    int a, max_ = 0;
    while (cin >> a) {
        if (map.find(a) != map.end()) {
            map[a] += 1;
            max_ = max(max_, map[a]);
        } else {
            map[a] = 1;
        }
    }

    for (auto a_ : map) {
        if (a_.second == max_) {
            cout << a_.first << endl;
        }
    }
}

C++: #include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<cmath>
#include<stdio.h>
#include<queue>
#include <climits>
#include <map>
#include <set>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
const int mod = 1e9 + 7;
const long long INF = 1LL << 60;

int cnt[105];

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

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

int main()
{
    map<int, int> iData;
    int iBuff, maxCount, maxElement[100];
    pair<map<int, int>::iterator, bool> flag;
    while(cin >> iBuff)
    {
        flag = iData.insert(map<int, int>::value_type(iBuff, 1));
        if(flag.second == false)
        {
            iData[iBuff]++;
            maxCount = max(maxCount, iData[iBuff]);
        }
    }
    for(map<int, int>::iterator it = iData.begin(); it != iData.end(); it++)
    {
        if(it->second == maxCount )
            cout << it->first << endl;
    }
    return EXIT_SUCCESS;
}

C++: #include <iostream>

using namespace std;

void solve(){

}
int encnt[101], ans;
int main(){
  int n;

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

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

using namespace std;

int main() {
	int x, m;
	vector<int> a(101, 0);
	while(cin >> x){
		a[x] += 1;
	}
	m = *(max_element(a.begin(), a.end()));
	for(int i = 1;i <= 100;++i){
		if(a[i] == m) {
			cout << i << endl;
		}
	}
	return 0;
}

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

#define N 100
#define MYSCAN scanf_s

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

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

using namespace std;
#define loop(i,a,b) for(int i=(a); i<int(b); i++)
#define rep(i,b) loop(i,0,b)

int main(){
	int a[101];
	rep(i, 101) a[i] = 0;
	int n;
	int m = 0;
	while(cin >> n){
		a[n]++;
		m = max(m, a[n]);
	}
	rep(i, 101) if(m == a[i]) cout << i << endl;
}

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

typedef istringstream ISS;
typedef ostringstream OSS;
typedef vector <string> VS;
typedef vector <int> VI;
typedef vector <VI> VVI;
template <class T> T gcd( T a, T b ) { return !b ? a : gcd( b, a % b ); }
template <class T> T lcm( T a, T b ){ return a / gcd( a, b ) * b; }
template <class T> string print_v( vector<T> v ) { OSS oss; for ( typename vector<T>::iterator it_i = v.begin(); it_i != v.end(); ++ it_i ) { oss << *it_i << ", "; } return oss.str(); }

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

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

int main(void) {
    int n = 0, i, a[100], b[101] = {};
    while(cin >> i)
        a[n++] = i;
    for (int i= 0; i < n; ++i)
        ++b[a[i]];
    int max = 0;
    for (int i = 1; i <= 100; ++i)
        if (b[i] > max)
            max = b[i];

    for (int i = 1; i <= 100; ++i)
        if (max == b[i])
            cout << i << endl;

    return 0;
}

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

#define NOT_FOUND -1

int GetContainsElement(const vector<pair<int, int>> v, int target)
{
    int i = 0;
    for (vector<pair<int, int>>::const_iterator it = v.begin(); it != v.end(); it++) {
        if (it->first == target) {
            return i;
        }
        i++;
    }

    return NOT_FOUND;
}

int GetMostfrequentlyNumber(const vector<pair<int, int>> v)
{
    int ret = v[0].second;
    for (vector<pair<int, int>>::const_iterator it = (v.begin() + 1); it != v.end(); it++) {
        if (ret < it->second) {
            ret = it->second;
        }
    }

    return ret;
}

int main()
{
    int n = 0;
    vector<pair<int, int>> vec;

    while (scanf("%d", &n) != EOF) {
        int idx = GetContainsElement(vec, n);
        if (NOT_FOUND == idx) {
            vec.push_back(make_pair(n, 0));
        }
        else {
            vec[idx].second++;
        }
    }

    sort(vec.begin(), vec.end());
    int mostFrequently = GetMostfrequentlyNumber(vec);

    for (vector<pair<int, int>>::const_iterator it = vec.begin(); it != vec.end(); it++) {
        if (mostFrequently == it->second) {
            printf("%d\n", it->first);
        }
    }

    return 0;
}

C++: #include<cstdio>


using namespace std;
int main(void)
{
	int a[101]= {0},kari,most = 0;
	for(int i = 0;;i++)
	{
		if(scanf("%d",&kari)==EOF) break;
		a[kari] += 1;
		if(a[kari] >= most) most = a[kari];
	}
	for(int i = 0;i < 100;i++)
	{
		if(most == a[i]) printf("%d\n",i);
	}


	return 0;
}