Go: package main

import (
	"fmt"
	"sort"
)

func main() {
	var max int

	numbers := map[int]int{}
	for {
		var a int
		_, err := fmt.Scan(&a)
		if err != nil {
			break
		}
		numbers[a]++
		if numbers[a] >= max {
			max = numbers[a]
		}
	}

	var modes []int
	for a, b := range numbers {
		if b == max {
			modes = append(modes, a)
		}
	}

	sort.Ints(modes)
	for _, mode := range modes {
		fmt.Println(mode)
	}
}

C++: #include<stdio.h>
#include <algorithm>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <iterator>
#include <list>
#include <map>     
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <iomanip>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define ll long long
#define ld long double
#define roop(a,t) for(int a=0;a<t;a++) 
int main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);
int a[101];
for(int i=0;i<101;i++){a[i]=0;}
int n;
while(cin>>n){
a[n]++;
}
int ans=0;
for(int i=1;i<101;i++){
ans=max(ans,a[i]);
}
for(int i=1;i<101;i++){
if(a[i]==ans){cout<<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 i=0;
	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>
using namespace std;

int main() {
	int num[100] = {};
	int n;
	while (cin >> n) {
		num[n - 1]++;
	}
	int max = 0;
	for (int i = 0; i < 100; i++) {
		if (num[i] > max) max = num[i];
	}
	for (int i = 0; i < 100; i++) {
		if (num[i] == max) cout << i + 1 << endl;
	}
}

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

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

C++: #include<iostream>

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

C++: #include<iostream>
#include<vector>
#include<algorithm>

int main(void)
{
	std::vector<int> data;

	int n;

	while(std::cin >> n)
	{
		data.push_back(n);
	}

	std::vector<int> count(data.size());

	for(size_t i=0; i<data.size(); ++i)
	{
			for(size_t j=0; j<data.size()-i; ++j)
		{
			if(data[i]==data[i+j])
			{
				++count[i];
			}
		}

	}

	count.push_back(0);//ここまででdataのサイズとcountのサイズは同じはずだが、count[i]とcount[i+1]の比較があるのでcountのサイズを一つ大きくしておく Max(count)!=0のはずなので0を入れておけば結果に問題はない

	int countmax = *std::max_element(count.begin(),count.end());

	std::vector<int> answer;
	
	for( size_t i=0; i<count.size(); ++i )
	{
		if(count[i]==countmax)
		{
			answer.push_back(data[i]);
		}
	}
	
	std::sort(answer.begin(),answer.end());

	for( size_t i=0; i<answer.size(); ++i)
	{
		std::cout << answer[i] << '\n';
	}
}

C++: #include <iostream>
#include <algorithm>
#include <deque>
#include <functional>
using namespace std;
int main(){
	int data[150]={0},cp[150]={0},t,cnt=1,max,i=0;
	while(cin>>t){
		data[t]++;
		cnt++;
	}
	for(i=0;i<cnt;i++){
		cp[i]=data[i];
	}
	sort(data,data+150,greater<int>());
	for(int j=0;j<cnt;j++){
		if(data[0]==cp[j]){
			cout<<j<<endl;
		}
	}
return 0;
}

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

using namespace std;

int main(void) {
    int a, n[100], max;
    stack<int> mode;
    
    for (int i = 0; i < 100; i++) {
        n[i] = 0;
    }
    while (cin >> a) {
        n[a - 1]++;
    }
    max = n[99];
    mode.push(99);
    for (int i = 98; i >= 0; i--) {
        if (n[i] > max) {
            while (!mode.empty()) {
                mode.pop();
            }
            max = n[i];
            mode.push(i);
        } else if (n[i] == max) {
            mode.push(i);
        }
    }
    while (!mode.empty()) {
        cout << mode.top() + 1 << endl;
        mode.pop();
    }
    return 0;
}

C++: #include <cstdio>
#include <vector>
#include <algorithm>
#include <cstring>
#include <string>
#include <cctype>
#include <sstream>
#include <cmath>
#include <climits>
#include <map>

using namespace std;

#define reep(i,f,n) for(int i=f; i<int(n); ++i)
#define rep(i,n) reep(i,0,n)

typedef vector<int> vi;

int main()
{
	map<int, int> m;
	int a;
	int best = 0;
	while(scanf("%d", &a) != EOF){
		if(m.count(a))
			m[a]++;
		else
			m[a] = 1;
		best = max(best, m[a]);
	}

	for(map<int,int>::iterator itr = m.begin(); itr != m.end(); ++itr)
		if(itr->second == best)
			printf("%d\n", itr->first);

	return 0;
}

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

int n ;
int p ;
int max ;
int ans[110] ;
int count[110] ;

int main ( )
{
	memset ( count , 0 , sizeof ( count ) ) ;
	max = 1 ;
	p = 0 ;
	while ( scanf ( "%d" , &n ) == 1 ) {
		count[n]++ ;
	}
	for ( int i = 0 ; i < 110 ; i++ ) {
		if ( count[i] > max ) {
			max = count[i] ;
			p = 0 ;
			ans[p++] = i ;
		}
		else if ( count[i] == max ) {
			ans[p++] = i ;
		}
	}
	for ( int i = 0 ; i < p ; i++ ) {
		printf ( "%d\n" , ans[i] ) ;
	}
	return 0 ;
}

C++: //include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef unsigned long long ULL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);

//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

int main() {
  int n, max = 0;
  int cnt[100] = {0};

  while(cin >> n) cnt[n-1]++;
  for(int i = 0; i < 100; i++) {
    if(cnt[i] > max) max = cnt[i];
  }

  for(int i = 0; i < 100; i++) {
    if(cnt[i] == max) cout << i+1 << endl;
  }
}