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>

#define MAXINUM   ( 100 + 1 )

using namespace std;

/** Application main entry point. */
int main (
  int     argc,
  char  * argv[ ]
  )
{
  int input[ MAXINUM ] = { 0 };
  int countMax = 0;

  while ( true )
  {
    int __tmp;
    
    if ( !( cin >> __tmp ) ) break;
    countMax = max ( countMax, ++input[ __tmp ] );
  }
  if ( countMax == 0 )  return ( 0 );

  for ( int i = 0; i < MAXINUM; ++i )
  {
    if ( input[ i ] == countMax )
    {
      cout << i << endl;
    }
  }

  return ( 0 );
}

C++: #include<iostream>
#include<cstdio>
using namespace std;
int main(){
  int date[1000],higher[1000],high[1000]={0},t=0,bell=0,hess=0,aizu=0,riri=0;
  while(scanf("%d",&date[t])!=EOF){
    high[date[t]]++;
    t++;
  }
  for(int i=0;i<t;i++){
    if(bell<high[i]){
      higher[0]=i;
      bell=high[i];
      riri=i;
    }
  }
  for(int i=0;i<t;i++){
    if(higher[hess]==high[i] && i!=riri){
      hess++;
      higher[hess]=i;
    }
  }
  for(int i=0;i<=hess;i++){
    cout << higher[i] << endl;
  }
  return (0);
}

C++: // includes
#include <cstdio>
#include <cstdint>
#include <iostream>
#include <iomanip>
#include <string>
#include <queue>
#include <stack>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <utility>
#include <functional>
#include <cmath>
#include <climits>
#include <bitset>

// macros
#define ll long long int
#define pb push_back
#define mk make_pair
#define pq priority_queue
#define FOR(i, a, b) for(int i=(a); i<(b);++i)
#define rep(i, n) FOR(i, 0, n)

using namespace std;

//  types
typedef pair<int, int> P;
typedef pair<ll, int> Pl;
typedef pair<ll, ll> Pll;
 
// constants
const int inf = 1e9;
const ll linf = 1LL << 50;
const double EPS = 1e-10;

// solve

int main(int argc, char const* argv[])
{
  int n;
  unordered_map<int, int> mp;
  while(cin >> n){
    mp[n]++;
  }
  int maxi = -1;
  for(auto itr = mp.begin(); itr != mp.end(); ++itr){
    maxi = max(maxi, itr->second);
  }
  vector<int> vec;
  for(auto itr = mp.begin(); itr != mp.end(); ++itr){
    if(maxi == itr->second)vec.pb(itr->first);
  }
  sort(vec.begin(), vec.end());
  rep(i, vec.size()){
    cout << vec[i] << endl;
  }
	return 0;
}

C++: #include <iostream>

int main(){
	int a,c=0,t=0;
	int b[100],f[100],z[100];
	z[0]=0;
	for(int ds=0;ds<12;ds++){
	std::cin>>a;
         c++;
	    b[c]=a;
	}
	for(int g=1;g<=100;g++){
		f[g]=0;
		z[g]=0;
	}
	for(int d=1;d<=c;d++){
			f[b[d]]++;
			}
	for(int g=1;g<=100;g++){
		
			if(f[g]>z[0]){
			
			z[0]=g;
				t=0;
			}else if(f[g]==z[0]){a
				t++;
				z[t]=g;
		}
	}
	for(int p=0;p<t;p++){
		std::cout<<z[p]<<std::endl;
	}
	return 0;
		}

C++: #include<cstdio>
int main(){
    int a[100];
    int s,m=0;
    for(int i=0;i<100;i++){
        a[i]=0;
    }
    while(~scanf("%d",&s)){
        a[s-1]++;
        if(m<a[s-1]) m=a[s-1];
    }
    for(int i=0;i<100;i++){
        if(a[i]==m) printf("%d\n",i+1);
    }
}

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

}