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<cstdlib>
using namespace std;
int compare(const void *a,const void *b){
	return *(int *)a-*(int *)b;
}
int main(){
	int n,a[200][2],k=0,b[200],max=0,d=0,i;
	for(i=0;i<200;i++)
	a[i][1]=0;
	while(cin>>n){
		for(i=0;i<k;i++)
		if(a[i][0]==n){
			a[i][1]++;
			break;
		}
		if(i==k){
			a[k][0]=n;
			a[k++][1]++;
		}
	}
	for(i=0;i<k;i++)
		if(a[i][1]>max)
			max=a[i][1];
	for(i=0;i<k;i++)
		if(max==a[i][1])
			b[d++]=a[i][0];
	qsort(b,d,sizeof(int),compare);
	for(i=0;i<d;i++)
		cout<<b[i]<<endl;
	return 0;
}

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

C++: #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cassert>
#include <vector>
#include <string>
#include <cmath>
#include <map> 
#include <sstream>
#include <cstdio>
#include <complex>
#include <cstring>
using namespace std;
 
const int MAX= 10000100;

#define loop(i,a,b) for(int i = a ; i < b ; i ++)
#define rep(i,a) loop(i,0,a)
#define all(a) (a).begin(),(a).end()
#define ll long long int
#define gcd(a,b) __gcd(a,b)
#define pb(a) push_back(a)
int GCD(int a, int b) {if(!b) return a; return gcd(b, a%b);}
int lcm(int a, int b) {return a*b / gcd(a, b);}

int main(void){
  int a[100] = {0};
  int n;
  int len = 0;
  while(cin>>n){
    a[n-1] ++;
  }
  int max = -1;
  vector<int> res;
   rep(i,100){
    if(a[i] > max){
 
      max = a[i];
      res.clear();
      res.pb(i);
    }
    if(a[i] == max)res.pb(i);
  }
  rep(i,res.size())cout<<res[i]+1<<endl;

}

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

int main(void){
  int n, m=0;
  map<int,int> mode; //保存する変数の値,入力された回数
  vector<int> ans;

  for(int i=1; i<=100; i++){ //保存先の確保と初期化
    mode.insert( map<int,int>::value_type(i, 0));
  }

  while(cin >> n){ //入力回数をカウント
    mode[n] += 1;
  }

  for(int i=1; i<=100; i++){ //最も入力が多い数の回数
    m = max( mode[i], m );
  }

  for(int i=1; i<=100; i++){ //最頻値の取り出し
    if(m==mode[i]){
      ans.push_back(i);
    }
  }

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

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

  return 0;
}

C++: #include "bits/stdc++.h"
#pragma warning(disable:4996)
using namespace std;

int main() {
	int a;
	map<int, int>mp;
	while (cin >> a) {
		mp[a]++;
	}
	int amax = 0;
	vector<int>anss;
	for (auto m : mp) {
		if (m.second > amax) {
			anss.clear();
			amax = m.second;
		}
		if (m.second == amax) {
			anss.push_back(m.first);
			
		}
	}
	sort(anss.begin(), anss.end());
	for (auto ans : anss) {
		cout << ans << endl;
	}
	return 0;
}

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

using namespace std;

int main(){
	int num;
	int list[100] = {0};

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

	sort(list, list + 100);

	cout << list[99] << endl;
	
	for (;;){
		int i = 98;
		if (list[i] == list[i + 1]){
			cout << list[i] << endl;
		}
		else {
			break;
		}
		i--;
	}

	return 0;
}

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

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

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

map<int, int> freqmap;
vector<int> most_freqs;

int main() {
    int n;
    while (cin >> n) {
        freqmap[n]++;
    }

    int freq = 0;
    for (map<int, int>::iterator i = freqmap.begin(); i != freqmap.end(); i++) {
        freq = freq > (*i).second ? freq : (*i).second;
    }

    for (map<int, int>::iterator i = freqmap.begin(); i != freqmap.end(); i++) {
        if ( (*i).second == freq ) {
            most_freqs.push_back( (*i).first );
        }
    }

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

    for (vector<int>::iterator i = most_freqs.begin(); i != most_freqs.end(); i++) {
        cout << (*i) << endl;
    }

    return 0;
}

C++: #include <iostream>

using namespace std;

void Solution()
{
    // notice the typing !!
    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++: int main()
{
	int i;
	int seed,max = 0;
	int data[100] = { 0 };
	int maxnum[100];
	while ((scanf("%d", &seed)) != EOF)
	{
		data[seed] += 1;
	}
	for (i = 0; i < 100; i++)
	{
		if (data[i] > max) max = data[i];
	}
	for (i = 0; i < 100; i++)
	{
		if (data[i] == max) printf("%d\n", i + 1);
	}
	return 0;
}

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

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

C++: #include <iostream>

using namespace std;

int main(void) {
	int n, num[101] = {0};
	int mode[100] = {0};

	while (cin >> n) {
		num[n]++;
	}
	for (int i = 1; i <= 101; i++) {
		if (num[i] != 0) {
			if (num[i] == num[mode[0]]) {
				for (int j = 0; j < 100; j++) {
					if (mode[j] == 0) {
						mode[j] = i;
						break;
					}
				}
			}
			else if (num[i] > num[mode[0]]) {
				for (int j = 0; j < 100; j++) {
					mode[j] = 0;
				}
				mode[0] = i;
			}
		}
	}
	for (int i = 0; i < 100; i++) {
		cout << mode[i] << endl;
		if (mode[i + 1] == 0) {
			break;
		}
	}
}

C++: #include <iostream>
#include <algorithm>
#include <vector>
#include <map>
using namespace std;
int main()
{
    vector<int> b(101, 0);
    int t;
    while (cin >> t) b[t]++;

    vector<pair<int, int> > v;
    for (int i = 1; i < 101; ++i) v.push_back(make_pair(-b[i], i));
    sort(v.begin(), v.end());
    for (int i = 0; i < 101; ++i) if (v[i].first == v[0].first)
        cout << v[i].second << endl;

    return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <cctype>
#include <cstdio>
#include <math.h>
using namespace std;

int main(){
	int t[250000]={0},m=0,n;
	while(cin>>n){
		t[n]++;
		if(t[n]>m)m=t[n];
	}
	for(int i=0;i<250000;i++){
		if(t[i]==m)cout<<i<<endl;
	}
}