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++: import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		Scanner input = new Scanner(System.in);
		int cnt[] = new int[100];
		
		while (input.hasNext()){
			int n = input.nextInt();
			cnt[--n]++;
		}
		
		int max = 0;
		for (int n : cnt){
			if (max < n){
				max = n;
			}
		}
		
		for (int i = 0; i < cnt.length; i++){
			if (cnt[i] == max){
				System.out.println(i + 1);
			}
		}
	}
}

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

#define REP(i,a,n) for(int i=(a);i<(int)(n);i++)
#define rep(i,n) REP(i,0,n)
#define pb push_back
#define mp make_pair
#define all(x) x.begin(),x.end()
#define EPS 1e-8

bool cmp(pair<int,int> a, pair<int,int> b){
	if( a.second == b.second ) return a.first < b.first;
	return a.second > b.second;
}
int main(){
	map<int,int> mii;
	vector<pair<int,int> > vp;
	int n;
	while(~scanf("%d",&n)){
		mii[n]++;
	}
	map<int,int>::iterator it;
	for(it=mii.begin(); it!=mii.end(); it++)vp.push_back(*it);
	sort(vp.begin(), vp.end(), cmp);
	int i;
	for(i=1; i<vp.size() && vp[i].second==vp[i-1].second; i++);
	rep(j,i)printf("%d\n",vp[j].first);
	/*
	rep(j,vp.size()){
		printf("%d %d\n",vp[j].first, vp[j].second);
	}
	*/
	return 0;
}

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<iostream>
#include<stdio.h>
#include<algorithm>
using namespace std;

int num[101];
int big = 0;
int input;
int main(){
	for(int i=0; i <= 101; i++) num[i]=0;
	while(scanf("%d", &input) != EOF) num[input]++;
	for(int i=0; i <= 100; i++) big = max(big, num[i]);
	for(int i=0; i <= 100; i++) if(num[i] == big) cout << i << endl;
}

C++: #include<iostream>
using namespace std;
int main(){
  int count[100];
  int b;
  int ans[100];
  int ans2[100];
  int ans3;
  ans3 = 0;
  for(int i=0;i<100;i++){
    ans[i] = 0;
    ans2[i] = 0;
    count[i] = 0;
  } 
  while(cin>>b) count[b-1]++;
  for(int i=0;i<100;i++){
    if(ans[ans3]<count[i]){
      ans[i] = count[i];
      ans2[i] = i + 1;
      ans3 = i;
      for(int k=0;k<100;k++) if(k!=i) ans2[k] = 0;    
    }
    else if(ans[ans3]==count[i]&&ans3!=0) ans2[i] = i + 1;
  }
  for(int i=0;i<100;i++) if(ans2[i]!=0) cout << ans2[i] << endl;
  return 0;
}

C++: /*****include*****/
#include <iostream>
#include <fstream>
#include <string>

/*****デバッグ定義*****/
//#define DEBUG
/*****マクロ定義*****/

/*****名前空間*****/
using namespace std;

/*****グローバル変数置き場*****/

/*****その他関数置き場*****/

/*****main関数*****/
int main(){
	/*****ファイルオープン*****/
#ifdef DEBUG
	ofstream fout("output.txt");
	ifstream fin("input.txt");
	if(!fout || !fin){
		cout << "Can't open the file.\n";
		return 0;
	}
#endif
	/*****変数置き場*****/
	int num;
	int appear[101];
	int max;
	/*****処理部*****/
	max = 0;
	for(int i=0;i<101;i++)	appear[i] = 0;
	while(!cin.eof()){
		cin >> num;
		//cin >> num;
		appear[num] += 1;
	}
	for(int i=0;i<101;i++)
		if(appear[i] > max)	max = appear[i];
	for(int i=0;i<101;i++)
		if(appear[i] == max)
			cout << i << endl;
	/*****処理終了後*****/
#ifdef DEBUG
	fout.close();
	fin.close();
#endif
	return 0;
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <algorithm>
#include <sstream>
#include <cmath>
#include <set>
#include <iomanip>
#include <deque>
#include <stdio.h>
using namespace std;

#define REP(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define RREP(i,n) for(int (i)=(int)(n)-1;i>=0;i--)
#define iREP(i,Itr) for(auto (i)=(Itr).begin();(i)!=(Itr).end();(i)++)
#define REMOVE(Itr,n) (Itr).erase(remove((Itr).begin(),(Itr).end(),n),(Itr).end())
#define PB_VEC(Itr1,Itr2) (Itr1).insert((Itr1).end(),(Itr2).begin(),(Itr2).end())
#define UNIQUE(Itr) sort((Itr).begin(),(Itr).end()); (Itr).erase(unique((Itr).begin(),(Itr).end()),(Itr).end())
#define LBOUND(Itr,val) lower_bound((Itr).begin(),(Itr).end(),(val))
#define UBOUND(Itr,val) upper_bound((Itr).begin(),(Itr).end(),(val))
typedef long long ll;

int main(){
    
    int cnt[101]={};
    int t;
    while(cin>>t){
        cnt[t]++;
    }
    
    int maxa=-1;
    REP(i,101)maxa=max(maxa,cnt[i]);
    
    REP(i,101){
        if(cnt[i]==maxa)cout<<i<<endl;
    }
    
    return 0;
}

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

int main(void) {
    int n = 0, i, a[100], b[100] = {};
    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 <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <math.h>

//#define PI 3.141592653589

using namespace std;



int main()
{
	int dic[10];
	int data;
	int max_data = 0;
	
	for (int i=0; i<10; i++) dic[i] = 0;
	while (cin >> data)
	{
		dic[data]++;
		max_data = max(max_data, dic[data]);
	}
	for (int i=0; i<10; i++)
	{
		if (dic[i] == max_data)
		{
			cout << i << endl;
		}
	}
	
	return 0;
}

C++: #include<iostream>

using namespace std;

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

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

int main(){
  int n;
  map<int, int> mp;
  while (cin >> n){
    mp[n]++;
  }
  int maxnum = 1;
  for (auto m:mp) {
    maxnum = max(m.second, maxnum);
  }
  for (auto m:mp) {
    if (maxnum == m.second)
    cout << m.first << endl;
  }
}

C++: #include<bits/stdc++.h>
#define rep(i,n) for(int i=0; i<n; i++)
#define INF 1000000
using namespace std;
int main(){
    vector<int> vec(101);
    rep(i,101) vec[i] = 0;
    int n,tmp=0;
    while(cin >> n){
        vec[n]++;
        rep(i,vec.size()){
            if(tmp <= vec[i]) tmp = vec[i];
        }
        vector<int> ans;
        rep(i,vec.size()){
            if(tmp == vec[i]) ans.push_back(i);
        }
        sort(ans.begin(),ans.end());
        rep(i,ans.size()) cout << ans[i] << endl;
    }
    return 0;
}

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

int main() {
	int a;
	int max=0;
	int data[101]={0};


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