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++: #define _USE_MATH_DEFINES
#include <iostream>
#include <queue>
#include <vector>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <string>
#include <stack>
#include <cctype>
#include <cstdlib>
#include <map>
using namespace std;

#define INF (1 << 20)
#define EPS (1e-10)
#define EQ(a,b) (fabs((a)-(b)) < EPS)

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

C++: #include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>
#include <sstream>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <numeric>
#include <cmath>
#include <climits>
#include <limits>
#include <cfloat>
#include <fstream>
using namespace std;

int main()
{
//	cut here before submit 
//	freopen("testcase.mv", "r", stdin);
	string str = "";
	map <int, int> a;

	while ( getline (cin, str ) ){
		int n;
		stringstream ss(str);
		ss >> n;
		++a[n];
	} // end for
	multimap <int, int, greater<int> > order;
	map <int, int>::iterator it = a.begin();
	
	for (; it != a.end(); ++it){
		order.insert (make_pair ((*it).second, (*it).first ) );
	} // end for

	it = a.begin();
	multimap <int, int, greater<int> >::iterator ito = order.begin();
	int num = (int)order.count ((*it).second );
	for (int i = 0; i < num; ++i, ++ito){
		cout << (*ito).second << endl;
	} // end for
		
	return 0;
}

C++: //#pragma GCC optimize(2)
//#pragma GCC optimize(3)
#include<bits/stdc++.h>
#define fo(x,a,b) for(register int x=a;x<=b;x++)
#define dfo(x,a,b) for(register int x=a;x>b;x--)
using namespace std;
int a[1000],x,n,m;
char c;
int main ()
{
	//、、freopen("modeval.in","r",stdin);
	//freopen("modeval.out","w",stdout);
	do
	{
		scanf("%d",&x);
		if (getchar()!='\n') break;
		a[x]++;
		m=max(a[x],m);
	}while (true);
	fo(i,1,100)
	{
		if (a[i]==m)
		{
			printf("%d\n",i);
		}
	}

	return 0;
}

C++: #include <iostream>

int main(){
	int a,c=0,t=0;
	int b[100],f[100],z[100];
	z[0]=0;
	
	while(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]){
				t++;
				z[t]=g;
		}
	}
	for(int p=0;p<t;p++){
		std::cout<<z[p]<<std::endl;
	}
	return 0;
		}

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

using namespace std;

int main(){
  int input=0;
  int a[100];
  int b[100][2];
  int n=0;
  while(cin>>input){
    a[n]=input;
    n++;
  }
  sort(a,a+n);
  int i=0,j=0;
  for(i=0;i<n;i++){
    if(i=0){
      b[0][0]=a[0];
      b[0][1]++;
    }
    else if(b[j][2]==a[i]){
      b[j][1]++;
    }
    else{
      b[++j][0]=a[i];
      b[j][1]++;
    }
  }
  int max=b[0][1];
  for(int k=0;k<=j;k++){
    if(max<b[k][1]){
      max=b[k][1];
    }
  }
  int out[100];
  int m=0;
  for(int k=0;k<=j;k++){
    if(max==b[k][1]){
      out[m]=b[k][0];
      m++;
    }
  }
  for(int p=0;p<m;p++){
    cout<<out[p]<<"\n";
  }
  return 0;
}

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

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

C++: #include <cstdio>
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
using namespace std;
#define tr(c, i) for(auto i = (c).begin(); i != (c).end(); i++)

int main(int argc, char **argv)
{
  map<int, int> mode;
  int i;
  for (;;) {
    cin >> i;
    if (cin.eof())
      break;

    mode[i]++;
  }

  int m = 0;
  tr(mode, i) {
    m = max(i->second, m);
  }
  tr(mode, i) {
    if (i->second == m)
      cout << i->first << endl;
  }
  return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
int main(){
  int n,a[101]={0},k=0;
  while(cin>>n){
    a[n]++;
    k=max(a[n],n);
  }
  for(int i=1;i<101;i++)if(a[i]==k)cout<<i<<endl;
}

C++: #include <string>
#include <vector>
#include <iostream>
#include <complex>
#include <map>
using namespace std;

typedef vector<int> VI;
#define REP(i,s,t) for(int i=(s);i<(t);i++)

int main() {
    int i;
    map<int, int> count;
    while (cin >> i){
        map<int, int>::iterator it = count.find(i);
        if (it!=count.end()){
            count[i] += 1;
        } else {
            count[i] = 1;
        }
    }
    int mode = 0;
    VI m;
    for (auto it = count.cbegin(); it != count.cend(); ++it){
        if (mode < it->second){
            mode = it->second;
            m.clear();
            m.push_back(it->first);
        }else if (mode == it->second){
            m.push_back(it->first);
        }

    }
    std::sort(m.begin(), m.end());
    for (int num:m){
        cout << num << endl;
    }
    return 0;
}

C++: /*AOJ 0028*/

#include<iostream>
using namespace std;

#define FOR(i,n) for(int i=0;i<n;i++)

int main(){

	int data[100];
	int num;
	int max=0;

	FOR(i,100){
		data[i] = 0;
	}

	while(cin>>num){
		
		if(num == 0){
			break;
		}
		data[num-1]++;
	}

	FOR(i,100){
		if(max<=data[i]){
			max = data[i];
		}
	}

	FOR(i,100){
		if(data[i] == max){
			cout<<i+1<<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 <iomanip>
#include <algorithm>
#include <stdio.h>
#define _USE_MATH_DEFINES
#include <math.h>
#include <cstring>
#include <map>
#include <cctype>
#include <string>
#include <cstdlib>
#include <math.h>
using namespace std;

#define REP(i,n)  for(int i=0; i<n; i++)

int main()
{
  cout << setprecision(6);
  cout << setiosflags(ios::scientific);
  cout.flags(ios::fixed);

  int counts[100+1];
  memset(counts, 0, sizeof(counts));
  int num=0;
  while(cin >> num){
    counts[num]++;
  }

  int maxNum=0;
  REP(i,101)
    maxNum = max(maxNum,counts[i]);

  REP(i,101){
    if(counts[i]==maxNum){
      cout << i << endl;
    }
  }
}

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