Go: package main

import (
	"fmt"
	"sort"
)

func main() {
	var max int

	numbers := map[int]int{}
	for {
		var a int
		_, err := fmt.Scan(&a)
		if err != nil {
			break
		}
		numbers[a]++
		if numbers[a] >= max {
			max = numbers[a]
		}
	}

	var modes []int
	for a, b := range numbers {
		if b == max {
			modes = append(modes, a)
		}
	}

	sort.Ints(modes)
	for _, mode := range modes {
		fmt.Println(mode)
	}
}

C++: #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <utility>
#define INF 1000000000
#define mod 1000000007
#define rep(i,n) for(int i=0;i<(n);i++)
#define REP(i,a,b) for(int i=(a);i<(b);i++)
#define all(x) (x).begin(),x.end()
using namespace std;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
bool debug=false;

int main(){
  int x[101]={0};
  int n;
  while(cin>>n) x[n]++;
  int maxi=-INF;
  rep(i,101)if(maxi<x[i])maxi=x[i];
  rep(i,101)if(maxi==x[i])cout<<i<<endl;
  return 0;
}

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

using namespace std ;

#define pb(n) push_back(n)
#define fi first
#define se second
#define all(r) (r).begin(),(r).end()
#define gsort(st,en) sort((st),(en),greater<int>())

#define rep(i,n) for(int i = 0; i < (n);++i)
#define repc(i,a,b) for(int i = (a);i <(b);++i)
#define repa(n,array) for(auto n :(array))

typedef long long ll ;
typedef vector<int> vi ;
typedef vector<ll> vl ;

constexpr int IMAX = ((1<<30)-1)*2+1 ;
constexpr int INF = 100000000;
double EPS = 1e-10 ;

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int num,max;
  vi tmp(101,0);
  while(cin >> num){
    ++tmp[num] ;
  }
  max = *max_element(all(tmp)) ;
  rep(i,101){
    if(tmp[i] == max){
      cout << i << endl ;
    }
  }
  return 0;
}

C++: #include <cstdio>
#include <map>
#include <vector>
#include <algorithm>
using namespace std;
typedef map<int, int> I2imap;

int main(int argc, char *argv[]) {
	I2imap get_map;
	vector<int> num_list;
	
	// init map
	for (int i = 1; i < 101; i++) {
		get_map.insert(I2imap::value_type(i, 0));
	}
	// load
	while (true) {
		int rcv;
		if (EOF == fscanf(stdin, "%d", &rcv)) {
			break;
		}
		get_map[rcv]++;
	}
	// search max mode value
	int max_mv = 0;
	I2imap::iterator itr = get_map.begin();
	while (itr != get_map.end()) {
		if ((*itr).second > max_mv) {
			max_mv = (*itr).second;
		}
		itr++;
	}
	// get number having max mode value
	itr = get_map.begin();
	while (itr != get_map.end()) {
		if ((*itr).second == max_mv) {
			num_list.push_back((*itr).first);
		}
		itr++;
	}
	sort(num_list.begin(), num_list.end());
	// print result
	vector<int>::iterator v_itr = num_list.begin();
	while (v_itr != num_list.end()) {
		printf("%d\n", (*v_itr));
		v_itr++;
	}
	return 0;
}

C++: #include<stdio.h>
int main()
{
	int v,b[100]={0},c=0;
	while(scanf("%d",&v)!=EOF){
		b[v-1]+=1;
	}
	for(int i=0;i<100;i++){
		if(b[i]>c){
			c=b[i];
		}
	}
	for(int i=0;i<100;i++){
		if(c==b[i]){
			printf("%d\n",i+1);
		}
	}
	return 0;
}

C++: #include<iostream>

using namespace std;

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

	return 0;
}

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

int count[101]={0};

int main() {
	int n;
	while(scanf("%d",&n) != EOF){
		count[n] = count[n] + 1;
	}
	int max=count[1];
	for(int i=2;i<=100;i=i+1){
		if(count[i] > max){
			max = count[i];
		}
	}
	for(int i=1;i<=100;i=i+1){
		if(count[i] == max){
			cout << i << endl;
		}
	}
	
	return 0;
}

C++: #define _USE_MATH_DEFINES
#include <iostream>
#include <sstream>
#include <cmath>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>

typedef long long ll;
using namespace std;

typedef pair<int,int> P;

int main()
{

	int a;
	map<int,int> num;
	queue<int> que;
	while(~scanf("%d",&a)){
		num[a]++;
	}

	int max_freq = -1;

	for(map<int,int>::iterator it=num.begin(); it != num.end(); it++){
		if(it->second == max_freq){
			que.push(it->first);
		}
		else if(it->second > max_freq){
			while(!que.empty()){
				que.pop();
			}
			max_freq = it->second;
			que.push(it->first);
		}
		
	}

	while(!que.empty()){
		cout << que.front() << endl;
		que.pop();
	}

}

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