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>

using namespace std;

int main(void)
{
	int n;
	int a[10]={};
	while(cin>>n)
	{
		a[n]++;
	}
	int max=0;
	for(int i=0;i<10;i++)
	{
		if(a[i]>max)
		{
			max=a[i];
		}
	}
	for(int i=0;i<10;i++)
	{
		if(a[i]==max)
		{
			cout<<i<<endl;
		}
	}
}

C++: #include<iostream>
#include<map>
using namespace std;
 
int main(int argc, char* argv[]) {
  map<int, int> data;
  int var;
  int max = 0;
  while(cin >> var) {
    data[var]++;
    if(data[var] > max) {
      max = data[var];
    }
  }
  //cout << max << endl;
  for(map<int, int>::iterator it=data.begin(); it!=data.end(); it++) {
    if(it->second == max) cout << it->first << endl;
  }
}

C++: #include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
int main() {
	int t[100] = {};
	int i = 0;
	vector<int>a;
	while (cin >> i) {
		t[i]++;
	}
	int m = 0;
	for (int i = 0; i < 100; i++) {
		m = max(t[i], m);
	}
	for (int i = 0; i < 100; i++) {
		if (t[i] == m) {
			a.push_back(t[i]);
		}
	}
	sort(a.begin(), a.end());
	for (int i = 0; i < a.size(); i++) {
		cout << a[i] << endl;
	}
}

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

int main() {
  int n;
  int a[100] = {};
  while (cin >> n) a[n - 1]++;

  int maxa = 0;
  while (true) {
    int maxb = maxa;
    maxa = 0;

    int max_val = 0;
    for (int i = 0; i < 100; i++) {
      if (a[i] > maxa) {
        maxa = a[i];
        max_val = i + 1;
      }
    }
    if (maxa < maxb) break;

    cout << max_val << endl;
    a[max_val - 1] = 0;
  }

  return 0;
}

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

int cnt[101];

int main(){
	int i;
	while( ~scanf("%d",&i) ){
		cnt[i]++;
	}
	
	int mmax = 0;
	//データ数を求める
	for( i = 0;i < 101;i++ ){
		mmax = max( mmax, cnt[i] );
	}
	
	//最頻値を探す( データ数と照らし合わせる )
	for( i = 0;i < 101;i++ ){
		if( cnt[i] == mmax ){
			printf("%d\n",i );
		}
	}
	return 0;
}

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

C++: #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <map>
#include <numeric>
using namespace std;

#define FOR(i,a,b) for(long long int i=(a);i<(b);i++)
#define REP(i,n) for(long long int i=0;i<(n);i++)
#define ALL(s) (s).begin(),(s).end()

#define PI 3.14159265358479

typedef long long ll;
typedef vector<long long int> vi;
typedef vector<long long int>::iterator vit;

int main(){
	int n,c = 0;
	int a[110] = {};
	while (cin >> n){
		a[n]++;
		if (c < a[n]){
			c++;
		}
	}
	REP(i, 100){
		if (a[i] == c){
			cout << i << "\n";
		}
	}
}

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

int main()
{
	vector<int> Vec(100);
	int n;
	while(cin>>n){
		Vec[n]++;
	}
	int max_r = 0, ans=0;
	for(int i=0;i<100;i++){
		max_r = max( max_r, Vec[i]);
	}
	for(int i=0;i<100;i++){
		if(max_r == Vec[i]){
			ans = i;
		}
	}
	cout<<ans<<endl;
	
	return 0;
}

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

typedef istringstream ISS;
typedef ostringstream OSS;
typedef vector <string> VS;
typedef vector <int> VI;
typedef vector <VI> VVI;
template <class T> T gcd( T a, T b ) { return !b ? a : gcd( b, a % b ); }
template <class T> T lcm( T a, T b ){ return a / gcd( a, b ) * b; }
template <class T> string print_v( vector<T> v ) { OSS oss; for ( typename vector<T>::iterator it_i = v.begin(); it_i != v.end(); ++ it_i ) { oss << *it_i << ", "; } return oss.str(); }

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

C++: #include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <functional>

using namespace std;

int main()
{
	int n;
	map<int,int> numbers;

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

	int max = 0;

	for ( map<int,int>::iterator it = numbers.begin(); it != numbers.end(); it++ )
	{
		if ( max < (*it).second )
		{
			max = (*it).second;
		}
	}

	for ( map<int,int>::iterator it = numbers.begin(); it != numbers.end(); it++ )
	{
		if ( (*it).second == max )
		{
			cout << (*it).first << endl;
		}
	}

	return 0;
}

C++: #include<cstdio>

using namespace std;



int main(void){

	int n,max=0,num[101]={0};

	while(scanf("%d",&n)!=EOF){
		num[n]++;
		if(num[n]>max) max=num[n];
	}

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

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

typedef istringstream ISS;
typedef ostringstream OSS;
typedef vector <string> VS;
typedef vector <int> VI;
typedef vector <VI> VVI;
template <class T> T gcd( T a, T b ) { return !b ? a : gcd( b, a % b ); }
template <class T> T lcm( T a, T b ){ return a / gcd( a, b ) * b; }
template <class T> string print_v( vector<T> v ) { OSS oss; for ( typename vector<T>::iterator it_i = v.begin(); it_i != v.end(); ++ it_i ) { oss << *it_i << ", "; } return oss.str(); }

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

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

int main(){

  int a[1000]={0},n,temp=0;

  while(cin >> n) a[n]++;

  for(int i=0;i<=100;i++){
    if(temp<a[i]) temp=a[i];
  }

  for(int i=0;i<=100;i++){
    if(temp==a[i]) cout << i << endl;
  }

}

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

using namespace std;


signed main()
{   
    int mp[101] = {0};
    int key, j = 0;
    while ( scanf("%d\n", &key ) != EOF )
    {
        mp[ key ]++;
    }
    int mode = 0;
    for( int i = 1; i <= 100; i++ )
    {
        if( mode < mp[i] )
        {
            mode = mp[i];
        }
    }
    
    ///mode_value
    for( int i = 1; i <= 100; i++ )
    {
        if( mp[i] == mode )
        {
            cout << i + 1 << endl;
        }
    }
    return 0;
}