Go: package main

import (
	"fmt"
	"sort"
)

func main() {
	var max int

	numbers := map[int]int{}
	for {
		var a int
		_, err := fmt.Scan(&a)
		if err != nil {
			break
		}
		numbers[a]++
		if numbers[a] >= max {
			max = numbers[a]
		}
	}

	var modes []int
	for a, b := range numbers {
		if b == max {
			modes = append(modes, a)
		}
	}

	sort.Ints(modes)
	for _, mode := range modes {
		fmt.Println(mode)
	}
}

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

#define INPUT_FROM_FILE (0) 
#if INPUT_FROM_FILE
#include <fstream>
#endif

int main(int argc, char **argv){
	int n;
	std::vector<int> hist(101, 0);

#if INPUT_FROM_FILE
	std::ifstream ifs("test.txt");
	//FILE *fp = fopen("test.txt", "r");
#endif

#if INPUT_FROM_FILE
	while(ifs >> n){
#else
	while(std::cin >> n){
#endif
		hist[n]++;
	}

	int max_val = 0;
	for(int i = 1; i < hist.size(); i++){
		max_val = std::max(max_val, hist[i]);
	}
	
	for(int i = 1; i <hist.size(); i++){
		if(hist[i] == max_val){
			std::cout << i << std::endl;
		}
	}
	return 0;
}

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

C++: #define scanf_s scanf
//#define gets_s gets
#include <stdio.h>
#include <string>
#include <iostream>
#include <math.h>
using namespace std;
#define MAX 50//00
#define MIN -100001
#define _MAX 100
#define g 9.8
#define d 4.9
int main(void)
{
	int a[_MAX] = { 0 }, x, max = 0;
	while (scanf_s("%d", &x) != EOF) {
		++a[x - 1];
		if (a[x - 1] > max) max = a[x - 1];
	}
	for (int i = 0; i < _MAX; ++i) {
		if (a[i] == max) {
			printf("%d\n", i + 1);
		}
	}s
}

C++: #include <cstdio>
#include <cstring>
#include <algorithm>
#include <string>
#include <cmath>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <iostream>


using namespace std;

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

	return 0;
}

C++: #include <iostream>
#include <map>
#include <algorithm>
using namespace std;
int main( void )
{
  int d,n=0;
  map<int,int> m;
  while( 1 ){
    cin>>d;
    if( cin.eof() ) break;
    if( m.find( d ) == m.end() ) m[d]=0;
    m[d]++;
  }
  for( map<int,int>::iterator it = m.begin(); it != m.end(); ++it )
    if( it->second > n ) n = it->second;
  for( map<int,int>::iterator it = m.begin(); it != m.end(); ++it )
    if( it->second == n ) cout << it->first << endl;
  return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <utility>
#define INF 1000000000
#define mod 1000000007
#define rep(i,n) for(int i=0;i<(n);i++)
#define REP(i,a,b) for(int i=(a);i<(b);i++)
#define all(x) (x).begin(),x.end()
using namespace std;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
bool debug=false;

int main(){
  int x[101];
  int n;
  while(cin>>n) x[n]++;
  int maxi=-INF;
  rep(i,101)if(maxi<x[i])maxi=x[i];
  rep(i,101)if(maxi==x[i])cout<<x[i]<<endl;
  return 0;
}

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

int last[101];

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

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

using namespace std;

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

	while (cin >> num){
		list[num - 1]++;
		for (int i = 0; i < 100; i++){
			if (max <= list[i]){
				max = list[i];
			}
		}
		for (int j = 0; j < 100; j++){
			if (list[j] == max){
				cout << j + 1 << endl;
			}
		}
	}
	return 0;
}

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

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

C++: #include <stdio.h>
#include <string.h>

int i, n, max;
int m[101];

int main(void)
{
  memset(m,0,sizeof(m));
  while(scanf("%d",&n) == 1)
    m[n]++;

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

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

C++: #include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace std;
 
int main()
{
    vector<int> num(101, 0);
    int maxNum = 0;
 
    for(;;){
        int a;
        if(!(cin >> a))
            break;
        maxNum = max(maxNum, ++num[a]);
    }
 
    for(int i=1; i<=100; ++i){
        if(num[i] == maxNum)
            cout << i << endl;
    }
}

C++: #define _USE_MATH_DEFINES

#include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
#include <cmath>
#include <algorithm>
#include <utility>
#include <vector>
#include <numeric>

using namespace std;

int main()
{
	vector<int> a(100);

	int n;
	for (; cin >> n;)
	{
		a.at(n - 1)++;
	}

	vector<int> b = a;
	sort(b.begin(), b.end());

	for (int i = 0; i < a.size(); i++)
	{
		if (a.at(i) == b.back())
		{
			cout << i + 1 << endl;
		}
	}
}

C++: #include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
#define loop(i,x,n) for(int i=(x);i<(n);i++)
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define mp make_pair
#define fir first
#define sec second
#define ub upper_bound
#define lb lower_bound
#define int long long
using namespace std;
const int MOD=1000000007;
const int INF=1000000009;

signed main(){
  vector<int> v(101);
  int n;
  while(cin>>n)v[n]++;
  auto p= *max_element(v.begin(),v.end());
  rep(i,101)if(v[i]==p)cout<<i<<endl;
  return 0;
}

C++: #include "bits/stdc++.h"

#define ALL(a) (a).begin(),(a).end()
#define SORT(c) sort((c).begin(),(c).end())
#define DESCSORT(c) sort(c.begin(), c.end(), greater<int>())

using namespace std;

using LL = long long int;
using LD = long double;

using pii = pair<int, int>;
using pll = pair<LL, LL>;
using pdd = pair<double, double>;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vl = vector<LL>;
using vvl = vector<vl>;
using vvvl = vector<vvl>;
using vd = vector<double>;
using vvd = vector<vd>;
using vs = vector<string>;
using vb = vector<bool>;
using vvb = vector<vb>;

const int INF = (1 << 30) - 1;
const LL INF64 = ((LL)1 << 62) - 1;
const double PI = 3.1415926535897932384626433832795;

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

int gcd(int x, int y) { return y ? gcd(y, x % y) : x; }
LL gcd(LL x, LL y) { return y ? gcd(y, x % y) : x; }

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);

	vi cnt(101);

	int n, ma = 0;
	while (cin >> n) {
		if (n == 0) break;
		cnt[n]++;
		ma = max(ma, cnt[n]);
	}

	for (int i = 0; i < 101; i++) {
		if (cnt[i] == ma) {
			cout << i << endl;
		}
	}
	return 0;
}

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

int main(void)
{
	int a, maxim=-1, num[100] = { 0 };

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

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

int num[10];
int big = 0;
int input;
int main(){
	for(int i=0; i < 10; i++) num[i]=0;
	while(scanf("%d", &input) != EOF) 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;
		}
	}
}