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

int main(){
  int i,a[100];
  while(cin >> i) a[i-1]++;
  int m = max(a[100]);
  while(int j = 0; j <100; j++){
    if(a[j] == m) cout << j + 1 << "\n";
  }
}

C++: #include<iostream>
#include<vector>
#include<algorithm>
int main(){
	int max=0,count=0;
	std::vector<int> vec(100);
	std::vector<int> vec2(100);
	std::vector<int> vec3;
	while(1){
		for(int i=0;i<100;i++){
			std::cin>>vec[i];
			//if(vec[i]==0)break;
			vec2[vec[i]]++;
			if(vec2[vec[i]]>max)max=vec2[vec[i]];
			count++;
		}
		if(std::cin.eof())break;
	}
	for(int i=0;i<count;i++){
		if(vec2[vec[i]]==max){
			vec3.push_back(vec[i]);
			vec2[vec[i]]=0;
		}
	}
	sort(vec3.begin(),vec3.end());
	for(int i=0;i<vec3.size();i++)std::cout<<vec3[i]<<std::endl;
	return 0;
}

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

int main(){
	int n;
	vector<pair<int,int> > rank(101);
	for(int i=0; i<101; i++ ) rank[i] = make_pair(0,i);
	while( cin >> n ){
		rank[n].first++;
	}
	sort(rank.begin(), rank.end(),greater<pair<int,int> >());
	vector<int> ans;
	ans.push_back(rank[0].second); 
	for(int i=1; rank[i-1].second>rank[i].second; i++) ans.push_back(rank[i].second);
	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 a[101] = { 0 };
	int k;
	int mex = 0;
	while (cin >> k) {
		a[k]++;
		if (mex < a[k]) {
			mex = a[k];
			//cout << "mex??´??°" << k << endl;
		}
	}
	for (int i = 1; i <= 100; i++) {
		if (a[i] == mex) {
			cout << i << endl;
		}
	}
    return 0;
}

C++: // 2011/07/01 Tazoe

#include <iostream>
using namespace std;

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

	while(true){
		int num;
		cin >> num;
		if(cin.eof())
			break;

		cnt[num]++;
	}

	int max = 0;
	for(int i=1; i<=100; i++)
		if(cnt[i]>max)
			max = cnt[i];

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

	return 0;
}

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

C++: #include <algorithm>
#include <cmath>
#include <climits>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <cassert>
#include <functional>

using namespace std;

#define LOG(...) printf(__VA_ARGS__)
//#define LOG(...)
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define REP(i,n) for(int i=0;i<(int)(n);++i)
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define RSORT(c) sort((c).rbegin(),(c).rend())
#define CLR(a) memset((a), 0 ,sizeof(a))

typedef long long ll;
typedef unsigned long long ull;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vb> vvb;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

const int dx[] = { -1, 0, 1, 0 }; const int dy[] = { 0, 1, 0, -1 };

int main() {
	int a[100] = { 0 };
	int n;
	while (cin >> n)
		a[n - 1]++;

	int ma = 0;
	REP(i, 100){
		ma = max(ma, a[i]);
	}
	REP(i, 100){
		if (a[i] == ma)
			cout << (i + 1) << endl;
	}
	return 0;
}

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

using namespace std;
int main(){
	int a[101]={0},n=0,saidai[100]={0},m=0;
	while(cin>>n){
		a[n]++;
	}
	for(int i=1;i<101;i++){
		if(saidai[m]<a[i]){
			for(int x=0;x<=m;x++){
				saidai[x]=0;
				m=0;
			}
			saidai[m]=i;
		}
		else if(saidai[m]==a[i]){
			saidai[m+1]=saidai[m];
			saidai[m]=i;
			m++;
		}
	}
	sort(saidai,saidai+100);
	for(int i=0;i<=100;i++){
		if(saidai[i]!=0){
			cout<<saidai[i]<<endl;
		}
	}
	return 0;
}

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

int main() {
  int r[100];
  for (int i=0; i<100; i++) r[i] = 0;
  int n;
  while (cin >> n) {r[n-1]++; if(n==0)break;}
  int maxValue = -1;
  for (int i=0; i<100; i++) if (r[i] > maxValue) maxValue = r[i];
  for (int i=0; i<100; i++) if (r[i] == maxValue) cout << i+1 << endl;
  return 0;
}

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

int main()
{
	int val;
	int cnt[101] = {};
	while (cin >> val) {
		cnt[val]++;
	}
	vector<int> v;
	int ma = 0;
	for (int i = 1; i <= 100; i++) {
		if (cnt[i] > ma) {
			ma = cnt[i];
			v.clear();
			v.push_back(i);
		}
		else if (cnt[i] == ma) {
			v.push_back(i);
		}
	}
	for (auto va : v) {
		cout << va << endl;
	}
	return 0;
}

C++: #include<iostream>
#include<vector>
#include<cstdio>
using namespace std;
int main()
{
  int n;
  int count[100] = { 0 };
  int ans[100] = { 0 };
  int bigcnt = 0;

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

  for(int i = 0;i < 100;i++){
    if(bigcnt < count[i]){
      bigcnt = count[i];
    }
  }
  
  int j = 0;

  for(int i = 0;i < 100;i++){
    if(bigcnt == count[i]){
      ans[j] = i+1;
      j++;
    }
  }
  
  for(int i = 0;i < j;i++){
    cout << ans[i] << endl;
  }
  
}

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

using namespace std;

int main()
{
  int val;
  int count[101];

  fill(count, count+101, 0);

  while(cin>>val){
    ++count[val];
  }

  val = 0;
  for(int i = 1; i < 101; ++i)
    val = max(val, count[i]);

  for(int i = 1; i < 101; ++i)
    if(count[i] == val)
      cout << i << endl;

  return 0;
}

C++: #include <bits/stdc++.h>

using namespace std;

int a[101];

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

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

using namespace std;

int n;
int count[100];
int max_number=0;

int main(){
	memset(count,0,sizeof(count));
	while(cin >> n){
		count[n - 1] += 1;
	}

	//?????§?????°????????????
	for(int i=0;i<100;i++){
		if(count[i] > max_number){
			max_number = count[i];
		}
	}

	//????????????
	for(int i=0;i<100;i++){
		if(count[i] == max_number){
			cout << i+1 << endl;
		}
	}
}

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

using namespace std;

int main(){

	int n;
	map<int,int> m;
	while(cin>>n){
		m[n]++;
	}

	int maxCnt=0;
	int maxVal=0;

	vector<int> maxValList;
	for(map<int,int>::iterator it = m.begin(); it != m.end(); it++){
		if(maxCnt<it->second){
			maxCnt=it->second;
			maxVal=it->first;
			maxValList.clear();
			maxValList.push_back(it->first);
		}
		else if(maxCnt==it->second){
			maxValList.push_back(it->first);
		}
	}
	sort(maxValList.begin(),maxValList.end());
	for(int i = 0; i < maxValList.size(); i++){
		cout<<maxValList[i]<<endl;
	}


	return 0;
}