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<algorithm>
#include<vector>
#include<stack>
#include<queue>
#include<cstdio>
#include<climits>
#include<cmath>
#include<cstring>
#include<string>
#include<complex>

#define f first
#define s second
#define mp make_pair

#define REP(i,n) for(int i=0; i<(int)(n); i++)
#define FOR(i,c) for(__typeof((c).begin()) i=(c).begin(); i!=(c).end(); i++)
#define ALL(c) (c).begin(), (c).end()
#define EPS (1e-10)
using namespace std;

typedef unsigned int uint;
typedef long long ll;
typedef complex<double> P;

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

C++: //
//  main.cpp
//  kazane
//
//  Created by h3036136 on 2017/07/27.
//  Copyright ?? 2017??´ h3036136. All rights reserved.
//1=31,2=29,3=31,4=30,5=31,6=30,7=31,8=31,9=30,10=31,11=30,12=31

#include <iostream>
#include <string>
using namespace std;
int main(){
    int a[101]={0},b,i,saihin[100]={0},c=0,saidai=0;
    while(cin>>b){
        a[b]=a[b]+1;
    }
    for(i=1;i<=100;i++){
        if(saidai<a[i]){
            saidai=a[i];
        }
    }
    for(i=1;i<=100;i++){
        if(a[i]==saidai){
            saihin[c]=i;
            c=c+1;
        }
    }
    for(i=0;i<100;i++){
        if(saihin[i]==0)break;
        cout<<saihin[i]<<endl;
    }
    return 0;
}

C++: #include<iostream>
using namespace std;
int main() {
    int a[100 + 1] = {0};
    int n;
    int Max = 0;
    while (cin >> n) {
        a[n]++;
        Max = Max < n ? n : Max;
    }
    int ans[100] = {0};
    int cnt = 0;
    int id[100] = {0};
    for (int i = 1; i <= Max; i++) { //~a[Max]
        if (ans[0] < a[i]) {
            ans[0] = a[i]; id[0] = i;
            for (int j = 1; j <= cnt; j++) {
                id[j] = 0;
            }
            cnt = 0;
        } else if (ans[0] == a[i]) {
            id[++cnt] = i;
        }
    }
    for (int i = 0; i < Max; i++) {
        if (id[i] != 0) {
            cout << id[i] << endl;
        }
        else break;
    }
    
}

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

#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for (int i = x; i < n; i++)
#define OP(m) cout << m << endl;
typedef long long ll;
typedef unsigned long long ull;

int main()
{
    vector<int> a(100);
    int n;
    while (cin >> n)
    {
        a[n]++;
    }

    int v = *max_element(ALL(a));

    rep(i, 100)
    {
        if (v == a[i])
        {
            OP(i)
        }
    }

    return 0;
}

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

using namespace std;

int main(void){
	int a;
	int maxa=0;
	vector<int> ans;
	map<int,int> f;
	for(a=0;a<=100;a++){
		f.insert( map<int,int>::value_type(a,0));
	}
	while(~scanf("%d",&a)){
		f[a]++;
	}
	for(a=0;a<=100;a++){
		maxa=max(maxa,f[a]);
	}
	for(a=0;a<=100;a++){
		if(maxa==f[a])ans.push_back(a);
	}
	sort(ans.begin(), ans.end());

	for(a=0;a<ans.size();a++){
		cout << ans[a] << endl;
	}
	return 0;
}

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

int data[101];
int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);

	int n;
	while(cin >> n){
		data[n]++;
	}

	int m = 0;
	for(int i = 1; i <= 100; ++i){
		m = max(data[i], m);
	}

	for(int i = 1; i <= 100; ++i){
		if(data[i] == m){
			cout << i << endl;
		}
	}

	return 0;
}

C++: #include<iostream>
using namespace std;
int main()
{
	int a[100]={0};
	int b[100][2]={0};
	int B1,B2;
	int i=0;
	for(int h=0;h<100;h++)
	{
		b[h][1]=h+1;
	}
while (cin>>a[i])
{
	b[a[i]-1][0]++;
	i++;
}
for(int j=0;j<i;j++)
{
	for(int k=j+1;k<i;k++)
	{
		if(b[k][0]>b[j][0])
		{
			B1=b[k][0];
			b[k][0]=b[j][0];
			b[j][0]=B1;
			B2=b[k][1];
			b[k][1]=b[j][1];
			b[j][1]=B2;
		}
	}
}
int l=0;
while(b[l][0]==b[0][0])
{
	cout<<b[l][1]<<endl;
	l++;
}
return 0;
}

C++: #include<iostream>
#include <string>
using namespace std;
int a[100];
int p,q=0;
int mode=100;
	int main(){
		for(int i=0;i<100;i++){
		cin>>p;
		if(a[p-1]<0){
			a[p-1]=1;}else{a[p-1]++;}}
		while(1){
			for(int ii=0;ii<100;ii++){
				if(a[ii]==mode){cout<<ii+1<<endl;
				q++;
				}}
			if(q>0){break;}else{mode--;}}
    return 0;
	}

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

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

C++: /*
	0028:Mode Value
*/
#include	<iostream>

using namespace std;

int max(int a, int b);

int main(void) {
	int ds[100] = {0};
	int nMode = 0;
	
	while(1) {
		int a;
		
		cin >> a;
		if( cin.eof() ) { break; }
		ds[a-1]++;
	}
	for(int i = 0; i < 100; i++) {
		nMode = max(nMode, ds[i]);
	}
	for(int i = 0; i < 100; i++) {
		if(nMode == ds[i]) {
			cout << i+1 << endl;
		}
	}
}

int max(int a, int b) {
	if(a > b) {
		return a;
	}
	return b;
}

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

int main() {
  vector<int> v;
  int temp;
  
  while(cin>>temp) v.push_back(temp);
  
  sort(v.begin(),v.end());
  
  int mx=0, cnt[101] = {};
  for(unsigned int i = 0; i < v.size(); i++) {
    mx = max(mx, ++cnt[v[i]]);
  }
  for(int i = 0; i < 101; i++) {
    if(mx == cnt[i]) cout << i << endl;
  }
  return 0;
}

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

int main(){
    int d[100];
    int maximize[100];

    int buf;
    while( scanf( "%d",&buf ) != EOF  ) d[buf-1]++;

    int buff = 0;
    for( int i = 0;i < 100;i++ ){
        if( d[i] > buff ) buff = d[i];
    }

    for( int i = 0;i < 100;i++ ){
        if( d[i] >= buff ) printf( "%d\n",i+1 );
    }
    return 0;
}

C++: #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
using namespace std;
static const double EPS = 1e-5;
typedef long long ll;
typedef pair<int,int> pint;
#define foreach(i,n) for(i=0;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define F first
#define S second
int dx[]={1,-1,0,0},dy[]={0,0,1,-1};

int main(){
	pair<int,int> a[101];
	rep(i,101){
		a[i].second=-i;
	}
	for(int k;cin>>k,k;){
		a[k].first++;
	}
	sort(a,a+101,greater<pair<int,int> >());
	for(int i=0;cout<<-a[i].second<<endl,a[i].F==a[i+1].F;i++);
	return 0;
}