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++: // Mode value

#include <iostream>
#include <algorithm>
#include <vector>

using std::cout;		using std::endl;
using std::cin;			using std::sort;
using std::vector;

int main(void)
{
	int num;
  int counters[101] = {0};
	int max_count = 1;
	vector<int> numbers;

  while (cin >> num) {
    counters[num]++;
  }

  for (int i = 1; i <= 100; i++) {
    if (max_count < counters[i]) {
      if (numbers.empty()) {
        numbers.push_back(i);
      } else {
        numbers.erase(numbers.begin(), numbers.end());
        numbers.push_back(i);
      }
      max_count = counters[i];
    } else if (max_count == counters[i]) {
      numbers.push_back(i);
    }
  }

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

  for (vector<int>::const_iterator iter = numbers.begin(); iter != numbers.end(); iter++) {
    cout << *iter << endl;
  }

  return 0;
}

C++: #include<iostream>
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 <iostream>
#include <string>
using namespace std;

int main(){
	int n[101], k, max=0;
	string ans;

	for (int i = 0; i < 101; i++) {
		n[i] = 0;
	}

	while(true){
		cin >> k;
		if (cin.eof()) { break; }
		n[k]++;
	}
	for(int i = 0;i<101;i++){
		if(max == n[i]){
			ans += "\n";
			ans += to_string(i);
		}
		else if (max < n[i]){
			ans = to_string(i);
			max = n[i];
		}
	}
	cout << ans << endl;
	return 0;
}

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

#define REP(i, s, n) for (int i = s; i < n; ++i)
#define rep(i, n) REP(i, 0, n)
#define SORT(c) sort((c).begin(), (c).end())
#define IINF INT_MAX
#define LLINF LLONG_MAX
#define DEBUG false

//Zeller's conguence

int main()
{
    int a[101]={0};
    int n;
    while(cin>>n){
        a[n]++;
    }
    //cout<<"hoge"<<endl;
    int temp=0;
    rep(i,101) temp=max(temp,a[i]);
    vector<int> hoge;
    rep(i,101) if(temp==a[i]) hoge.push_back(i);
    SORT(hoge);
    rep(i,hoge.size()){
        cout<<hoge[i]<<endl;
    }
    return 0;
}

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

int main(){

  int n, m;
  int cnt[101] = {0};

  while(cin >> n){
    cnt[n]++;
  }
  
  m = *max_element(cnt+1, cnt+101);

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

  return 0;
}

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

using namespace std;

int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int num, max = 0;
    vector<int> cnt(101);

    while(cin >> num)
        cnt[num]++;

    for(int i=0; i<101; i++)
        if(max < cnt[i]) max=cnt[i];
    for(int i=0; i<101; i++)
        if(max == cnt[i])
            cout << i << endl;

    return 0;
}

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

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

C++: #include <iostream>

using namespace std;

constexpr int n = 100;
int freq[n];
int main(){
  int a;
  while(cin >> a){
    freq[a-1]++;
  }
  int maxi,maxval=-1;
  for(int i=0;i<n;++i){
    if(maxval<freq[i]){
      maxi = i;
      maxval = freq[i];
    }
  }

  for(int i=0;i<n;++i){
    if(freq[i]==maxval){
      cout << i+1 << endl;
    }
  }
}

C++: #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
using namespace std;
int main(){
	int data[101],n,ans;
	for(int i=1;i<101;i++){
		data[i]=0;
	}
	while(cin>>n){
		data[n]++;
	}
	for(int i=1;i<101;i++){
		ans=max(ans,data[i]);
	}
	for(int i=1;i<101;i++){
		if(data[i]==ans)cout<<i<<endl;
	}
	return 0;
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int data[101];
int mod[101];
void ini(void){
  for(int i=0;i<101;i++){
    data[i]=0;
    mod[i]=0;
  }
}



main(){
  int max=0;
  int j;
  j=0;
  int in;
  while(cin >> in){
    for(int i=0;i<101;i++){
      if(in == i){
	data[i]++;//inidata[i];
	break;
      }
    }
    j++;
  }

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

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

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(mmax==math[i])cout<<i<<endl;
    }
}

C++: 
/* vo0_28.cpp */
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;

inline int MAX(int a, int b) { return (a < b) ? b : a; }

int main()
{
	vector<int> d;
	int count[100];
	
	for (int i = 0; i < 100; ++i) { count[i] = 0; }

	int n;
	while (cin >> n) { d.push_back(n); }

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

	for (int i = 0; i < d.size(); ++i) { count[d[i] - 1]++; }

	int max = 0;
	for (int i = 0; i < d.size(); ++i) { max = MAX(max, count[i]); }
	for (int i = 0; i < d.size(); ++i) {
		if (max == count[i])
			cout << i + 1 << '\n';
	}

	return 0;
}

C++: #include<stdio.h>

int main()
{
	int a[100]={0},x=0,b[100]={0},max=0;
	while(scanf("%d",&a[x])!=EOF)
	{
		if(a[x]<=0||a[x]>100)
		{
			x--;
		}
		else
		{
			b[(a[x]-1)]++;
		}
		x++;
	}

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

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

using namespace std;

int main(void){
	int max, cnt[100], x, i;
	memset(cnt,0,sizeof(cnt));
	while(scanf("%d",&x) != EOF){
		cnt[x - 1]++;
	}
	max = 0;
	for(i = 0;i < 100;i++){
		if(max < cnt[i]){
			max = cnt[i];
		}
	}
	for(i = 0;i < 100;i++){
		if(max == cnt[i]){
			printf("%d\n",i + 1);
		}
	}
	return 0;
}

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

using namespace std;

int main()
{
  int data[100] = {};
  int n, m = 0;
  while(cin >> n)
    data[n - 1]++;
  for(int i = 1; i <= 100; i++)
    m = max(m, data[i - 1]);
  for(int i = 1; i <= 100; i++)
    if(m == data[i - 1])
      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;
}