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<algorithm>
#define N 101
using namespace std;

int main(){

  int i, m, a[N] = {};
  while(cin >> i)
    a[i]++;

  for(int j = 1; j < N; j++) 
    m = max(m,a[j]);

  for(int k = 1; k < N; k++)
    if(a[k] == max) 
      cout << k << "\n";
  
}

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

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

}

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

int cnt[100];
int main(){
    int n,ma=0;

    while(cin>>n)ma=max(ma,++cnt[--n]);

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

   return 0;
}

C++: #include <iostream>
#include <map>
#include <set>

int main()
{
	std::map<int, int> counter;
	int number;
	while (std::cin >> number) {
		counter[number]++;
	}

	int max_count = 0;
	std::set<int> max_numbers;
	for (std::map<int, int>::iterator i = counter.begin(); i != counter.end(); ++i) {
		if (i->second >= max_count) {
			if (i->second > max_count) {
				max_count = i->second;
				max_numbers.clear();
			}
			max_numbers.insert(i->first);
		}
	}

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

	return 0;
}

C++: #include <stdio.h>

int main()
{
	int i;
	int seed,max = 0;
	int data[100] = { 0 };
	int maxnum[100];
	while ((scanf("%d", &seed)) != EOF)
	{
		data[seed-1] += 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 <bits/stdc++.h>
using namespace std;

int num[101];

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

  return 0;
}

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

class Dat
{
public:
  int num, frq;
  Dat():num(0), frq(0) {}
};

class GreaterFrq
{
public:
  bool operator()(const Dat& lhs, const Dat& rhs)
  {
    if (lhs.frq == rhs.frq)
      return lhs.num < rhs.num;
    return lhs.frq > rhs.frq;
  }
};

int main()
{
  int in;
  vector<Dat> dat(100+1);
  while (cin >> in) {
    dat[in].num = in;
    ++dat[in].frq;
  }

  sort(dat.begin(), dat.end(), GreaterFrq());

  int f = dat.front().frq;
  for (int i = 0; i < dat.size(); ++i) {
    if (f == dat[i].frq)
      cout << dat[i].num << endl;
  }

  return 0;

}

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<bits/stdc++.h>
using namespace std;
static const int MAX_N = 100;

int a[MAX_N];

int main(void){
	for(int i = 0; i < MAX_N; i++){
		a[i] = 0;
	}

	int input;
	while(scanf("%d", &input) != EOF){
		a[input]++;
	}

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

C++: #include<stdio.h>

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

C++: #include <stdio.h>
#include <algorithm>
#include <functional>
using namespace std;

int main(){
	int a[100],b[100],buf,i;
	for(i = 0;i < 100;i++) a[i] = 0;
	while(scanf("%d",&buf) != EOF){
		a[buf - 1]++;
	}
	for(i = 0;i < 100;i++){
		b[i] = a[i];
	}
	sort(a,a + 100,greater<int>());
	for(i = 0;i < 100;i++){
		if(b[i] == a[0]) printf("%d\n",i + 1);
	}
	return 0;
}

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

int main(){
  int hist[100];
  for(int i=0; i<100;i++) hist[i] = 0;
 
  int n;
  while(cin >> n) hist[n]++;
  
  int maxv = 0;
  for(int i=0;i<100;i++){
    if(hist[i] >  maxv) maxv = hist[i];
  }
  
  for(int i=0;i<100;i++){
    if(maxv == hist[i]) cout << i << endl;
  }
  return 0;
}

C++: #include <stdio.h>

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

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

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

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

using namespace std;

int main() {
  char *line = NULL;
  size_t buffer_size = 0;
  int frequencies[101] = {};
  int max_frequency = 0;
  while (getline(&line, &buffer_size, stdin) > 0) {
    int n;
    sscanf(line, "%d", &n);
    max_frequency = max(max_frequency, ++frequencies[n]);
  }
  free(line);

  for (int i = 1; i < 101; ++i) {
    if (frequencies[i] == max_frequency) {
      printf("%d\n", i);
    }
  }

  return 0;
}

C++: #include <iostream>

using namespace std;

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

C++: #include <functional>
#include <algorithm>
#include <iostream>
#include <numeric>
#include <iomanip>
#include <utility>
#include <cstdlib>
#include <sstream>
#include <bitset>
#include <vector>
#include <cstdio>
#include <ctime>
#include <queue>
#include <deque>
#include <cmath>
#include <stack>
#include <list>
#include <map>
#include <set>

using namespace std;

typedef vector<int> vi;
typedef pair<int,int> pii;
typedef long long ll;

#define dump(x)  cerr << #x << " = " << (x) << endl
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(a)  (a).begin(),(a).end()
#define pb push_back


int main() {
    int n;
    int times[100]={};

    while(cin>>n){
        times[n]++;
    }
    int maxi=-1;
    rep(i,100+1){
        maxi=max(maxi,times[i]);
    }
    rep(i,100+1){
        if(times[i]==maxi){
            cout<<i<<endl;
        }
    }

    return 0;
}