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 <iostream>
using namespace std;

#define SAFE_DELETE( x ) { if ( x ){ delete x; x = NULL; } }

struct tCell{
	tCell() : number( 0 ), count( 0 ), prev( NULL ), next( NULL ){}

	int number, count;
	tCell *prev, *next;
};

class Database{
public:
	Database() : size( 0 ), head( NULL ), tail( NULL ){
		head = new tCell;
		tail = new tCell;
		head->next = tail;
		tail->prev = head;
	}
	~Database(){
		init();
		SAFE_DELETE( tail );
		SAFE_DELETE( head );
	}

	void init(){
		for ( int i = size; i > 0; --i ){
			tCell* cell = tail->prev;
			cell->prev->next = cell->next;
			cell->next->prev = cell->prev;
			SAFE_DELETE( cell );
		}
	}
	void store( int n ){
		bool stored = false;
		tCell* cell = head;
		for ( int i = 0; i < size; ++i ){
			cell = cell->next;
			if ( cell->number == n ){
				++cell->count;
				stored = true;
				break;
			}
		}
		if ( !stored ){
			pushBack( n );
		}
	}
	void sort(){
		for ( int i = 0; i < size - 1; ++i ){
			tCell* cell = head;
			tCell* celln = head->next;
			for ( int j = 0; j < size - 1 - i; ++j ){
				cell = celln;
				celln = celln->next;
				if ( cell->number > celln->number ){
					int tn = cell->number;
					int tc = cell->count;
					cell->number = celln->number;
					cell->count = celln->count;
					celln->number = tn;
					celln->count = tc;
				}
			}
		}
	}
	void maxCount( Database& db ){
		int c = 0;
		tCell* cell = head;
		for ( int i = 0; i < size; ++i ){
			cell = cell->next;
			if ( c < cell->count ) c = cell->count;
		}
		db.init();
		cell = head;
		for ( int i = 0; i < size; ++i ){
			cell = cell->next;
			if ( cell->count == c ){
				db.store( cell->number );
			}
		}
	}
	int getSize(){ return size; }
	
	tCell operator[]( int n ){
		tCell* cell = head->next;
		if ( n >= size ){ cell = NULL; return *cell; }
		for ( int i = 0; i < n; ++i ){
			cell = cell->next;
		}
		return *cell;
	}

private:
	void pushBack( int n ){
		++size;
		tCell* cell = new tCell;
		cell->number = n;
		++cell->count;
		cell->prev = tail->prev;
		cell->next = tail;
		cell->prev->next = cell;
		cell->next->prev = cell;
	}

	int size;
	tCell *head, *tail;
};

int main(){
	int n;
	Database db, result;

	while ( cin >> n ){
		db.store( n );
	}

	db.sort();
	db.maxCount( result );
	for ( int i = 0; i < result.getSize(); ++i ){
		cout << result[ i ].number << endl;
	}

	return 0;
}

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

int num[10];
int big = 0;
int input;
int main(){
	for(int i=0; i < 10; i++) num[i]=0;
	while(cin >> input) num[input]++;
	for(int i=0; i < 10; i++) big = max(big, num[i]);
	for(int i=0; i < 10; i++){
		if(num[i] == big){
			cout << i << endl;
		}
	}
}

C++: #include <stdio.h>

int main()
{
	int val[100], val2[100], k, i, j, t, s;

	i = 0;
	while(scanf("%d", &val[i]) != EOF){
		for (j = 0; j <= i; j++){
			if(val[j] > val[i]){
				t = val[j];
				val[j] = val[i];
				val[i] = t;
			}
		}

		i++;
	}

	i = 0;
	j = 1;
	t = 0;
	k = 0;
	s = 1;
	while(val[i] != '\0'){
		if (t == val[i]) j++;
		else{
			if(s == j) {k++; val2[k] = val[i-1];}
			else if(s < j) {s = j; k = 0; val2[k] = val[i-1];}
			t = val[i]; j = 1;
		}

		i++;
	}

	i = 0;
	while(val2[i] != '\0'){
		printf("%d\n", val2[i]);
		i++;
	}

	return 0;
}

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

C++: #include<bits/stdc++.h>
#define rep(i,n) for(int i=0; i<n; i++)
#define INF 1000000
using namespace std;
int main(){
    vector<int> vec(101);
    rep(i,101) vec[i] = 0;
    int n;
    while(cin >> n){
        vec[n]++;
        int tmp = 0;
        rep(i,vec.size()){
            if(tmp <= vec[i]) tmp = vec[i];
        }
        vector<int> ans;
        rep(i,vec.size()){
            if(tmp == vec[i]) ans.push_back(i);
        }
        sort(ans.begin(),ans.end());
        rep(i,ans.size()) cout << ans[i] << endl;
    }
    return 0;
}

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

int main(){
  int n,m;
  int a[100]={0};
  while(cin>>n) a[n-1]++;
  m = *max_element(a,a+100);
  for(int i=0;i<100;i++){
    if(m==a[i]) cout<<i+1<<endl;
  }
  return 0;
}

C++: #include <iostream>
using namespace std;
int main()
{
	int n, time[100] = {0}, i, tmp = 0, max[100] = {0};
	while (cin >> n && !cin.eof())
		time[n-1]++;
	for (i = 0; i < 100; i++)
		if (time[i] > tmp)
			tmp = time[i];
	for (i = 0; i < 100; i++)
		if (time[i] == tmp)
			cout << i+1 << endl;
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;

int main(){
  int n;
  map<int, int> p;
  int mx=0;
  while(cin>>n){
    mx=max(mx,++p[n]);
  }
  for(auto i:p)
    if(mx==i.second) cout<<i.first<<endl;
  return 0;
}

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

using namespace std;

int main(){
    int cnt[101] = {0};

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

C++: #include<iostream>
#include<cstdio>
#include<vector>
using namespace std;
int main()
{
int a[100];
for(int i=0;i<100;i++)a[i]=0;
int n;
while(cin >> n){
a[n-1]++;
}
int ans=0;
for(int i=1;i<100;i++){
if(a[ans]<a[i])ans=i;
}
cout << ans+1 << "\n";
return 0;
}

C++: #include<iostream>
using namespace std;
int main()
{
	int a[100]={0};
	int b[100][2]={0};
	int B1,B2;
	int i=0;
	for(int h=0;h<100;h++)
	{
		b[h][1]=h+1;
	}
while (cin>>a[i])
{
	b[a[i]-1][0]++;
	i++;
}
for(int j=0;j<i;j++)
{
	for(int k=i-1;k>=j+1;k--)
	{
		if(b[k][0]>b[j][0])
		{
			B1=b[k][0];
			b[k][0]=b[j][0];
			b[j][0]=B1;
			B2=b[k][1];
			b[k][1]=b[j][1];
			b[j][1]=B2;
		}
	}
}
int l=0;
while(b[l][0]==b[0][0])
{
	cout<<b[l][1]<<endl;
	l++;
}
return 0;
}

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

int main(){
  int j,k;
  int v[200]={0};
  int a;
  int max=0;

  while((scanf("%d",&a)!=EOF)){
    v[a-1]++;
  }

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

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

int n;
int maxcnt;
int cnt[101];

int main() {
  while (1) {
    if (scanf("%d", &n) != 1) break;
    cnt[n]++;
    maxcnt = max(maxcnt, cnt[n]);
  }

  for (int i=1; i<=100; i++) {
    if (maxcnt == cnt[i]) {
      printf("%d\n", i);
    }
  }
}

C++: #include<iostream>

using namespace std;

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

}

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

double r(double x1,double y1,double x2,double y2){
	return sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
	
	}

int main() {
	// your code goes here
int n;
int a[110]={0};
while(cin>>n){
	a[n]=a[n]+1;

}
int ma=-1;
vector<int> ve;
for(int j=0;j<101;j++){
	if(a[j]==ma){
		ve.push_back(j);
	}
	else if(a[j]>ma){
		ve.clear();
        ve.push_back(j);
        ma=a[j];
	}
		
		
	}
	
	int y=ve.size();
	for(int u=0;u<y;u++){
		cout<<ve[u]<<endl;
		
	}
	


	
	return 0;
}

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

#define MAX 100

int main()
{
	vector<int> data(MAX);
	int a, max, i;

	max = 0;
	while (cin>>a)
		if (++data[a-1] > max) max = data[a-1];

	for (i = 0; i < MAX; i++)
		if (data[i] == max) cout<<(i+1)<<endl;

	return 0;
}