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

class Mode_Value{
	int mode[100];
	int max;
public:
	Mode_Value();
	void setMode(int);
	void getMaxValue();
};

Mode_Value::Mode_Value(){
	max = 0;
	for(int i = 0; i < 100; i ++)
		mode[i] = 0;
}

void Mode_Value::setMode(int n){
	if(++mode[n - 1] > max)
		max = mode[n - 1];
}

void Mode_Value::getMaxValue(){
	for(int i = 0; i < 100; i ++){
		if(mode[i] == max)
			cout << i + 1 << endl;
	}
}

int main(){
	int a;
	Mode_Value m;
	while(scanf("%d",&a) != EOF)
		m.setMode(a);
	m.getMaxValue();
	return 0;
}

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

int main()
{
	int t,mc=0;
	map<int,int> m;
	while(cin >> t)
	{
		if(!(m.insert(pair<int,int>(t,1)).second))
		{
			m[t]++;
		}
		mc = (m[t]>mc ? m[t] : mc);
	}
	
	map<int,int>::iterator it;
	for(it=m.begin(); it!=m.end(); it++)
	{
		if(mc==it->second)
		{
			cout << it->first << endl;
		}
	}
}

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

using namespace std;

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

C++: #include <stdio.h>
#include <map>
using namespace std;
int main() {map<int,int>RB;int i,j;map<int,int>::iterator it;while(scanf("%d",&i)!=EOF) {if (RB.count(i)) RB[i]++; else RB[i]=1;}
for (j=0,it=RB.begin();it!=RB.end();it++) if (j<(it->second)) j=it->second;for (it=RB.begin();it!=RB.end();it++) if ((it->second)==j) printf("%d\n",it->first);return 0;}

C++: #include<iostream>
#include<stdio.h>
#include<math.h>
using namespace std;
int main() {
	int num[100], max = 0, n;
	for (int w = 0; w < 100; w++) {
		num[w] = 0;
	}
	while (cin >> n) {
		if (n == 0)break;
		num[n - 1]++;
		if (num[n - 1] > max)max = num[n - 1];
	}
	for (int w = 0; w < 100; w++) {
		if (num[w] == max)cout << w + 1 << endl;
	}
	return 0;
}

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

using namespace std;

int main(void){
	
	int n,m=0;
	map<int,int> a;
	vector<int> ans;

	for(int i=0;i<=100;i++){
		a.insert(map<int,int>::value_type(i,0));
	}

	while(cin>>n){
		a[n]++;
	}
	
	for(int i=0;i<=100;i++){
		m=max(a[i],m);
	}
	
	for(int i=0;i<=100;i++){
		if(m==a[i]){
			ans.push_back(i);
		}
	}
	
	sort(ans.begin(),ans.end());
	
	for(int i=0;i<ans.size();i++){
		cout<<ans[i]<<endl;
	}
}

C++: #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main(){
	int n,num[110]={},x,ans1=0,ans2=0;
	cin >> n;
	for(int i=0;i<n;i++){
		cin >> x;
		num[x]++;
	}
	for(int i=1;i<=100;i++){
		if(num[i]>ans2){
			ans1 = i;
			ans2 = num[i];
		}
	}
	cout << ans1 << endl;
	return 0;
}

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

int main(){
  int x, maxx = 0;
  int cnt[102];
  vector<int> v;

  memset(cnt, 0, sizeof(cnt));

  while(cin >> x){
    cnt[x]++;
    if(maxx < cnt[x]){
      maxx = cnt[x];
      v.clear();
      v.push_back(x);
    }
    else if(maxx == cnt[x]){
      v.push_back(x);
    }
  }

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

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

C++: /*****include*****/
#include <iostream>
#include <fstream>
#include <string>

/*****デバッグ定義*****/
//#define DEBUG
/*****マクロ定義*****/

/*****名前空間*****/
using namespace std;

/*****グローバル変数置き場*****/

/*****その他関数置き場*****/

/*****main関数*****/
int main(){
	/*****ファイルオープン*****/
#ifdef DEBUG
	ofstream fout("output.txt");
	ifstream fin("input.txt");
	if(!fout || !fin){
		cout << "Can't open the file.\n";
		return 0;
	}
#endif
	/*****変数置き場*****/
	int num;
	int appear[101];
	int max;
	/*****処理部*****/
	max = 0;
	for(int i=0;i<101;i++)	appear[i] = 0;
	while(1){
		cin >> num;
		if(cin.eof())	break;
		//cin >> num;
		appear[num] += 1;
	}
	cout << endl;
	for(int i=0;i<101;i++)
		if(appear[i] > max){
			max = appear[i];
		}
	int ret = 0;
	for(int i=0;i<101;i++){
		if(appear[i] == max)
			cout << i;
		if(ret==0)	ret = 1;
		else		cout << endl;
	}
	/*****処理終了後*****/
#ifdef DEBUG
	fout.close();
	fin.close();
#endif
	return 0;
}

C++: #include<iostream>

using namespace std;

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

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

int main(){
	const int limit = 101;
	int x;
	int integers[limit];
	for(int i = 1; i < limit; i++)
		integers[i] = 0;
	while(cin >> x) integers[x]++;
	int kmax = 0;
	for(int i = 1; i < limit; i++)
		kmax = max(kmax, integers[i]);
	for(int j = 1; j < limit; j++)
		if(integers[j] == kmax)
			cout << j << endl;
	return 0;
}

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

int main()
{
	int count = 0;
	int _in;
	int in[100] = {};
	
	while(scanf("%d",&_in)+1){
		++in[_in];	
	}
	
	_in = max(in[0],in[99]);
	for(int i=0;i<100;++i){
		if(in[i] == _in){
			cout << i << endl;
		}
	}
	
	return 0;
}

C++: #include <iostream>
#include <string>
using namespace std;
int main(){
int a[100];
int b;
b=0;
while(b<100){
a[b]=0;
b=b+1;}
int n;
while(cin >>n){
a[n]=a[n]+1;}
int c;
c=0;
b=0;
while(b<100){
if(a[b]>c){c=a[b];}
b=b+1;}
b=0;
while(b<100){
if(c==a[b]){cout <<b<<endl;}
b=b+1;}
}

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

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

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

  
}

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


int main(){

	int n,max=0,x[100]={0};
	int x_max;
	
	while (scanf("%d",&n)!=EOF) {
		x[n-1]++;
	}
	
	for (int i=0; i<100; i++) {
		if (max<x[i]) {
			max=x[i];
			x_max=i;
		}
	}
	cout << x_max+1 << endl;
	
	for (int i=x_max+1; i<100; i++) {
		if (x[x_max]==x[i]) {
			cout << i+1 <<endl;
		}
	}
		
	return 0;
}