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++: //aoj0028
#include<iostream>
#include<algorithm>
using namespace std;

int ar[120] = {};
int b[120] = {};

int main() {
	int n;
	int ca = 0;
	while (cin >> n) {
		ar[n - 1]++;
		b[n - 1]++;
		ca++;
	}

	sort(b, b + ca);
	int max = b[ca - 1];
	for (int i = 0; i < ca; i++) {
		if (ar[i] == max) {
			cout << ar[i] << endl;
		}
	}
	return 0;
}

C++: #include<iostream>
int intager[101]={0};

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

C++: #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int y[10000000], n, maxv; vector<int>a;
int main() {
	while (cin >> n) {
		y[n]++;
	}
	for (int i = 0; i < 10000000; i++) {
		maxv = max(maxv, y[i]);
	}
	for (int i = 0; i < 10000000; i++) {
		if (y[i] == maxv) { cout << i << endl; }
	}
}

C++: 
#include<stdio.h>

int main()
{
	int i;
	int seed,max = 0;
	int data[100] = { 0 };
	int maxnum[100];
	while ((scanf("%d", &seed)) != EOF)
	{
		data[seed] += 1;
	}
	for (i = 0; i < 100; i++)
	{
		if (data[i] > max) max = data[i];
	}
	for (i = 0; i < 100; i++)
	{
		if (data[i] == max) printf("%d\n", i + 1);
	}
	return 0;
}

C++: #include<cstdio>
#include<cstring>
int main(){
  int num[500];
  int i,n,max=0;
  memset(num,0,sizeof(num));
  while((scanf("%d",&n))!=EOF){
    num[n]++;
    if(num[n]>max)max=num[n];
  }
  for(i=0;i<101;i++)if(max == num[i])printf("%d\n",i); 
}

C++: #include<iostream>
#include <fstream>
#include <stdio.h>
#include <stdlib.h>
#define _USE_MATH_DEFINES
#include <math.h>
#include<string>
#include<vector>
#include<cmath>
#include<stack>
#include<queue>
#include<sstream>
#include<algorithm>
#include<map>
#include<complex>
using namespace std;


#define li			long long int
#define rep(i,to)	for(int i=0;i<((int)(to));i++)
#define repp(i,start,to)	for(int i=(int)(start);i<((int)(to));i++)
#define pb			push_back
#define sz(v)		((li)(v).size())
#define bgn(v)		((v).begin())
#define eend(v)		((v).end())
#define allof(v)	(v).begin(), (v).end()
#define dodp(v,n)		memset(v,(li)n,sizeof(v))
#define bit(n)		(1ll<<(li)(n))
#define mp(a,b)		make_pair(a,b)
#define rin	rep(i,n)
#define EPS 1e-10
#define ETOL 1e-8
#define MOD 1000000007
#define F first
#define S second
#define p2(a,b)		cout<<a<<"\t"<<b<<endl
#define p3(a,b,c)		cout<<a<<"\t"<<b<<"\t"<<c<<endl


int main(){
	li num;
	map<li,li> table;
	while(cin>>num){
		table[num]++;
	}
	
	vector<pair<li,li> > s;
	
	for(map<li, li>::iterator it=table.begin(); it!=table.end(); it++){
		s.pb(mp(it->S, -(it->F)));
	}
	
	sort(allof(s) ,greater<pair<li,li> >());
	
	//rep(i,sz(s)){p2(s[i].F, s[i].S);}
	
	li maxval=s[0].F;
	cout<<-s[0].S<<endl;
	li ma=1;
	while(s[ma].F==maxval){
		cout<<-s[ma].S<<endl;
		ma++;
	}
	
	return 0;
}

C++: #include<stdio.h>
#include<string.h>
#include<iostream>
#include<vector>
#include<set>
#include<stack>
#include<queue>
#include<ctype.h>
#include<math.h>
#include<map>
#include<time.h>
#include<algorithm>
using namespace std;
const int N=100+1;
map<int,int> a;
typedef pair<int,int> PAIR;
bool cmp(const PAIR& left,const PAIR& right)
{
	return left.second==right.second?left.first<right.first:left.second>right.second;
}
int main()
{
	int n;
	while(~scanf("%d",&n))
		a[n]++;
	vector<PAIR> v(a.begin(),a.end());
	sort(v.begin(),v.end(),cmp);
	int max=v[0].second;
	for(int i=0;i!=v.size();i++)
		if(v[i].second==max)
			printf("%d\n",v[i].first);
		else break;
	return 0;
}

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

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

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

using namespace std;

int main() {
	map<int, int> cntMap;
	map<int, int>::iterator it;
	int in, buf;
	while(cin>>in){
		if(cntMap.count(in) == 0){ cntMap.insert(make_pair(in, 0)); }
		else{ cntMap.find(in)->second++; }
	}

	int maxCnt = 0;
	for(it=cntMap.begin(); it!=cntMap.end(); it++){
		maxCnt = max(maxCnt, it->second);
	}
	for(it=cntMap.begin(); it!=cntMap.end(); it++){
		cout<<it->first<<endl;
	}
	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 <stdio.h>
#include<math.h>
using namespace std;

int main(){

	int count[101],tmp,max=-1;
	for(int i=0;i < 101;i++)count[i] = 0;

	while(scanf("%d",&tmp)!=EOF){
		count[tmp]++;
		max = (max >= count[tmp])?max:count[tmp];
	}

	for(int i=0;i<101;i++){
		if(count[i] == max)printf("%d\n",i);
	}
    return 0;
}

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

int ary[110];
int main(){
	int n;
	while(cin>>n){
		ary[n]++;
	}
	vector<pair<int,int> > ve;
	for(int i=1;i<=100;i++){
		ve.push_back(make_pair(-ary[i],i));
	}
	sort(ve.begin(),ve.end());
	cout<<ve[0].second<<endl;
	for(int i=1;i<100;i++){
		if(ve[i-1].first!=ve[i].first)break;
		cout<<ve[i].second<<endl;
	}
	return 0;
}

C++: #include <stdio.h>
int main(){
int a[101]={0},temp,top=0;
while(scanf("%d",&temp)!=EOF){
a[temp]++;
}
for(int i=1;i<101;i++){
if(a[i]>top)top=a[i];
}
for(int i=1;i<101;i++)if(a[i]==top)printf("%d\n",i);
}

C++: #include <iostream>
#define N 100
using namespace std;
int main(){
	int n[N] = {0};
	int i;
	while(cin >> i){
		n[i-1] ++;
	}
	int max = 0;
	for(int i = 0; i < N; i++){
		if(n[i] > max) max = n[i];
	}
	for(int i = 0; i < N; i++){
		if(n[i] == max) cout << i+1 << endl;
	}
	return 0;
}

C++: #include <iostream>

using namespace std;

constexpr int n = 100;
int freq[n];
int main(){
  int a;
  while(cin >> a){
    freq[a-1]++;
  }
  int maxi,maxval=-1;
  for(int i=0;i<n;++i){
    if(maxval<freq[i]){
      maxi = i;
      maxval = freq[i];
    }
  }

  for(int i=0;i<n;++i){
    if(freq[i]==maxval){
      cout << i+1 << endl;
    }
  }
}

C++: #include <iostream>
#include <map>
#include <vector>
#include <cmath>
#include <iomanip>
#include <string>
#include <queue>
#include <algorithm>
#include <cctype>
#define shosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef pair<int,P> pip;
typedef vector<pip> vip;
const int inf=1<<30;
const double pi=acos(-1);

int a,ans=-1;
map<int,int> m;

int main(){
	while(cin>>a) m[a]++;
	for(map<int,int>::iterator it=m.begin();it!=m.end();it++) ans=max(ans,it->second);
	for(map<int,int>::iterator it=m.begin();it!=m.end();it++){
		if(ans==it->second) cout<<it->first<<endl;
	}
}

C++: #include<iostream>
int main(){
  int l[99999],i,f;
  for(i=0;i<99999;i++) l[i]=0;
  while(std::cin>>i)l[i-1]++;
  for(i=0,f=0;i<99999;i++)
    if(f<l[i])f=l[i];
  for(i=0;i<99999;i++)
    if(l[i]==f)std::cout<<i+1<<"\n";
}