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<cmath>

using namespace std;

void Solution()
{
    int n;
    
    int times = 0; // save the data in here about most frequently times
    
    int a[101] = {0};　// the array which saves the mode value, at the beginning is all "0"
    
    while(cin>>n)
    {
        a[n]++; //after input some value, array's value can be added by 1 (0 -> 1), repeat this part.
    }
    
    
    for(int i = 0; i < 101; i++) // the data is less than 100
    {
        if(a[i] > times) //check the  a[] value for ensuring the mode value
        {
            times = a[i]; //repeat this part, at the last, can find mode value
        }
    }
    
    for(int i = 0; i < 101; i++) //output mode value
    {
        if(a[i] == times)
        {
            cout<<i<<endl;
        }
    }
    return;
}

int main()
{
    Solution();
    return 0;
}

C++: #include<iostream>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
using namespace std;
int main(){
  int out[101]={0};
  int in;
  while(cin>>in)out[in]++;
  int max1=0;
  rep(i,101)max1=max(max1,out[i]);
  rep(i,101)if(max1==out[i])cout<<i<<endl;
}

C++: #inlcude <stdio.h>
#include <stdlib.h>

int main(){
    int d[100];
    int maximize[100];

    int buf;
    while( scanf( "%d",&buf ) != EOF  ) d[buf-1]++;

    int buff = 0;
    for( int i = 0;i < 100;i++ ){
        if( d[i] > buff ) buff = d[i];
    }

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

C++: #include <iostream>

int main(void)
{
	int count[100]={0},n;
	while(std::cin >> n)
		count[n-1]++;

	int max=0;
	for(int i=0; i<100; i++)
		if(count[i] > max)
			max = count[i];
	for(int i=0; i<100; i++)
		if(max == count[i])
			std::cout << i+1 << std::endl;
	return 0;
}

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

using namespace std;

int main() {

	int a, max1=0,b[101] = {};

	while (cin>> a) {
		b[a]++;
		max1 = max(b[a], max1);
	}

	for (int i = 0; i < 101; i++) {
		if (b[i] == max1)cout<< i <<endl;
	}

	return 0;
}

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<Vec.size();i++){
		max_r = max( max_r, Vec[i]);
	}
	for(int i=0;i<Vec.size();i++){
		if(max_r == Vec[i]){
			cout<<i<<endl;
		}
	}
	
	
	return 0;
}

C++: #include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
using namespace std;
static const double EPS = 1e-5;
typedef long long ll;
typedef pair<int,int> pint;
#define foreach(i,n) for(i=0;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define F first
#define S second
int dx[]={1,-1,0,0},dy[]={0,0,1,-1};

int main(){
	pair<int,int> a[101];
	rep(i,101){
		a[i].second=-i;
	}
	for(int k;cin>>k,k;){
		a[k].first++;
	}
	sort(a,a+101,greater<pair<int,int> >());
	for(int i=0;cout<<-a[i].second<<endl,a[i].F==a[i+1].F;i++);
	return 0;
}

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


using namespace std;
#define LENGTH 100

int main(){
  
  vector<int> Digit(LENGTH, 0);
  
  
  int tmp;
  int cnt=0;
  while(cin >> tmp){
    cnt++;
    Digit[tmp]++;
  }
  int max = 0;
  vector<int> maxDigits;
  for(int i=0;i<cnt;i++){
    if(Digit[i]>max){
      //      vector<int>().swap(maxDigits); //
      maxDigits.clear();
      maxDigits.push_back(i);
      max = Digit[i];
      //      cout << i << ">:" << endl; 
    }else{
      if(Digit[i]==max){
	maxDigits.push_back(i);
	//	cout << i << "==:" << endl;
      }
    }
  }

  sort(maxDigits.begin(), maxDigits.end());

  for(int i=0;i<maxDigits.size();i++){
    cout << maxDigits[i] << endl;
  }
    
  
}

C++: #include<iostream>
#include<cstdio>
using namespace std;
int main()
{
    int math[101],check,mmax=0;
    for(int i=1;i<101;i++)math[i]=0;
    while(scanf("%d",&check)!=EOF){
        math[check]++;
        if(math[check]>mmax)mmax=math[check];
    }
    for(int i=1;i<101;i++){
        if(check==math[i])cout<<i<<endl;
    }
}

C++: 
//Nayeem Shahriar Joy ,Applied Physics And Electronic Engineering , University of Rajshahi.

  #include <iostream>
  #include <cstdio>
  #include <algorithm>
 
  using namespace std;
 
  char data[1000000];
 
  int main(void)
  {
    int n;
    int max = 0;
     
    while (scanf("%d", &n) != EOF){
        data[n]++;
    }
     
    for (int i = 0; i < 1000000; i++){
         
        if (data[i] > max){
            max = data[i];
        }
    }
    for (int i = 0; i < 1000000; i++){
        if (data[i] == max){
            printf("%d\n", i);
        }
    }
     
    return (0);
}

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

int main()
{
	int data[101] = {0}, n, max = 0;

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

	for (int i = 1; i < 101; i++){
		if (max < data[i]) max = data[i];
	}

	for (int i = 1; i < 101; i++){
		if (data[i] == max) cout << i << endl;
	}

	return (0);
}

C++: #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <time.h>
#include <math.h>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <algorithm>
#include <iterator>
#include <sstream>
#include <string>
#include <bitset>
using namespace std;
#define FOR(I,F,N) for(int I = F; I < (int)(N); I++)
#define rep(i, n) FOR(i, 0, n)
#define FIN(V) cout<<V<<endl
#define pb push_back
#define INF (1 << 30)
typedef pair<int, int> P;
typedef long long ll;
typedef priority_queue<int> pq;
int StrToInt(string);
string IntToStr(int);
int dx[4] = {1, -1, 0, 0};
int dy[4] = {0, 0, 1, -1};

int main(void){
	int n;
	vector<int> v(101, 0);
	while(cin >> n){
		v[n]++;
	}
	int mx = 0;
	rep(i,v.size()){
		if(v[i] > mx)mx = v[i];
	}
	rep(i,v.size()){
		if(v[i] == mx)cout << i << endl;
	}

	return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <map>
using namespace std;
int main(){
	int a;
	vector<int> in;
	while(scanf("%d",&a)!=EOF){
		if(a==0)	break;
		in.push_back(a);
	}
	map<int,int> dic;
	for(int it:in)	dic[it]++;
	int num=0;
	for(auto it:dic)	num=max(num,it.second);
	for(auto it:dic){
		if(num==it.second)	cout<<it.first<<endl;
	}
	return 0;
}

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

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