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

int main(){

  int num[100],n;
  int a=0;

  for(int i=0;i<100;i++)
    num[i] = 0;

  while(cin >> n)
    num[n]++;

  for(int i=0;i<100;i++)
    a = max(a,num[i]);

  for(int i=0;i<100;i++)
    if(a==num[i])
      cout << i << endl;

  return 0;
}

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

typedef pair<int , int > P;
P data[101];
int in;

int main(void)
{

	for(int i = 0; i <= 100; i++)
		data[i].second = i;
	while(cin >> in, !cin.eof()){
		data[in].first++;
	}

	sort(data,data+101);
	int def = data[100].first;
	for(int i = 0; i <= 100; i++)
		if(data[i].first == def)
		cout << data[i].second << endl;

	return 0;
}

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

typedef pair<int, int> P;
typedef stack<int> S;

bool pairCompare(const P& firstElem, const P& secomdElem)
{
	return firstElem.second < secomdElem.second;
}

int main(void)
{
	vector<P> v;
	for (int i = 0; i < 100; i++) v.push_back(P(i, 0));
	int num;
	while (cin >> num && num) v[num].second++;
	stable_sort(v.begin(), v.end(), pairCompare);
	int i = v.size() - 1;
	S s;
	while (v[v.size() - 1].second == v[i].second) {s.push(v[i].first); i--;}
	while (s.size()) {cout << s.top() << endl; s.pop();}
	
	return 0;
}

C++: #include <sstream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
#include <utility>
#include <set>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
using namespace std;
#define INF 100000000
#define MAXN 110
typedef long long ll;
 
int a[MAXN];
 
int main(void) {
    int n;
    while (cin >> n) a[n]++;
    int ma = 0;
    for (int i = 0; i <= 100; i++) ma = max(ma, a[i]);
    vector<int> ans;
    for (int i = 0; i <= 100; i++) {
        if (a[i] == ma) ans.push_back(i);
    }
    for (int i = 0; i < ans.size(); i++) {
        cout << ans[i] << endl;
    }
    return 0;
}

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

using namespace std;

struct cell{
	int no;
	int n;
};

bool compare(const cell& left, const cell& right)
{
  return left.n > right.n ;
}

#define MAX 100

int main()
{
	vector<cell> data(MAX);
	int a;
	int i;

	for (i = 0; i < MAX; i++) {
		data[i].no = i+1;
		data[i].n = 0;
	}

	while (cin>>a) {
		data[a-1].n ++;
	}

	sort(data.begin(), data.end(), compare);

	cout<<data[0].no<<endl;
	for (i = 1; i < MAX; i++) {
		if (data[i-1].n != data[i].n) break;
		cout<<data[i].no<<endl;
	}

	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main() {
  vector<int> cnt(100, 0);
  vector<int>::iterator itr = cnt.begin();
  int buf;

  while(cin >> buf) {
	cnt[buf - 1]++;
  }
  for(;;) {
	itr = find(itr, cnt.end(), *max_element(cnt.begin(), cnt.end()));
	if(itr == cnt.end()) break;
	cout << itr - cnt.begin() + 1<< endl;
	++itr;
  }
  return 0;
}

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

int main(){
	int a[110], i=1, b[110];
	vector<int> ans;
	for(int i=0 ; i<110 ; i++){
		b[i] = 0;
	}

	while(cin >> a[i]){
		if(i==100 || a[i]==-1)break;

		b[ a[i] ]++;
	}
	int num = 0;
	for(int i=1 ; i<=100 ; i++){
		if( num < b[i] ){
			ans.clear();
			num = b[i];
			ans.push_back(i);
		}
		else if( num == b[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 <stdio.h>
int main(){
char ch;
int num,max;
int p[10]={0};
int q[2][10]={0};
while(scanf("%d",&num) != EOF)    
{         
	p[num] += 1;     
}   

max=0;
for(int i=0;i<10;i++){
if(max<p[i])max=p[i];
}
for(int i=0;i<10;i++){
if(max==p[i])printf("%d\n",i);
}

return 0;
}

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

int main(){

int numbers[100] , x ,y;
y = max(numbers[x]);

while ( cin >> x ){
numbers[x - 1]++;
}

while ( y != 1 ){
cout << numbers[x] << endl;
}

return 0;
}

C++: #define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES

#include "bits/stdc++.h"
#define REP(i,a,b) for(int i=a;i<b;++i)
#define rep(i,n) REP(i,0,n)
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define ALL(a) begin(a),end(a)
#define ifnot(a) if(not (a))
#define dump(x)  cerr << #x << " = " << (x) << endl
using namespace std;

// #define int ll
#ifdef _MSC_VER
const bool test = true;
#else 
const bool test = false;
#endif

int dx[] = { 0,1,0,-1 };
int dy[] = { 1,0,-1,0 };
#define INF (1 << 28)
ull mod = (int)1e9 + 7;
//.....................
const int MAX = (int)2e5 + 5;

int main() {
	map<int, int> m;
	int v;
	while (cin >> v) {
		m[v]++;
	}
	vector<pair<int,int>> vec;
	for (auto p : m) {
		vec.push_back({ p.second, p.first });
	}
	sort(ALL(vec));
	rep(i,vec.size()) {
		if (vec[i].first == vec.back().first) {
			cout << vec[i].second << endl;
		}
	}
	return 0;
}

C++: #include<bits/stdc++.h>
#define rep(i,n) for(int i=0; i<n; i++)
#define INF 1000000
using namespace std;
int main(){
    vector<int> vec(101,0);
    int n;
    while(cin >> n){
        vec[n]++;
        int tmp = 0;
        rep(i,vec.size()){
            tmp = max(tmp,vec[i]);
        }
        rep(i,vec.size()){
            if(tmp == vec[i]) cout << i << endl;
        }
    }
    return 0;
}

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

int main()
{
  int n,m=0;
  int c[MAX]={};

  while(cin>>n)c[n]++;
  for(int i=0;i<MAX;i++)m=max(m,c[i]);
  for(int i=1;i<MAX;i++)if(m==c[i])cout<<i<<endl;
  
  return 0;
}

C++: #include <cstdio>
#include <algorithm>
using namespace std;
int m[101];
int main() {
  int a, mv = 0;
  while (~scanf("%d", &a)) {
    m[a]++;
    mv = max(m[a], mv);
  }
  for (int i = 1; i < 101; ++i) {
    if (m[i] == mv) printf("%d\n", i);
  }
}

C++: #include <stdio.h>

struct freqency {
  
  int num;
  int freq;

}f[1000];

int main(void) {

  int n;

  int size=0;
  int max_freq=0;

  int mode[1000];
  int s=0;

  int i;
  int flag;
  int j;

  while(scanf("%d",&n)!=EOF) {
  //for(j=0;j<10;j++) {
    scanf("%d",&n);
    flag=0;

    for(i=0;i<size;i++) {

      if(f[i].num==n) {
	flag=1;
	f[i].freq++;
      }

    }

    if(flag==0) {
	f[size].num=n;
	f[size].freq=1;
	size++;
    }

  }
  
  //for(j=0;j<10;j++) printf("%d %d\n",f[j].num,f[j].freq);

  for(i=0;i<size;i++) {

    if(max_freq<=f[i].freq) {
      max_freq=f[i].freq;
      mode[s]=f[i].num;
      s++;
    }

  }

  for(i=0;i<s;i++) {
    printf("%d\n",mode[i]);
  }

  return 0;

}

C++: #include <iostream>
#include <cmath>
#include <vector>
#include <cstdio>
#include <algorithm>
using namespace std;
int main ()
{
	int a[110]={};
	int x;
	while(scanf("%d",&x)!=EOF)a[x]++;
	int m=-1;
	for(int i=1;i<=100;i++)m=max(m,a[i]);

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

	return 0;
}

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