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 <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <string>
#define REP(i, n) for(int i = 0;i < n;i++)
#define ll long long
#define INF 114514
using namespace std;




int main(){
	int a[100000] = { 0 }, n, max = 0, f = 0;
	//vector<int>v(10000);
	while (cin >> n) {
		a[n]++;
	}
	for (int i = 1; i <= 100; i++) {
		if (a[n] < max) max = a[n];
	}
	for (int i = 1; i <= 100; i++) {
		if (a[i] == max) {
			v[f] = i;
			f++;
		}
	}
	for (int i = 1; i <= 100; i++) {
		cout << i << endl;
	}
	return 0;
}

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

int main(){
  int n,m;
  int a[100]={0};
  while(cin>>n) a[n-1]++;
  m = *max_element(a,a+100);
  for(int i=0;i<10;i++){
    if(m==a[i]) cout<<i+1<<endl;
  }
  return 0;
}

C++: #include <iostream>

using namespace std;

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

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

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

C++: #include<stdio.h> 
short f[100];short ans=0;short n;int main(){while(scanf("%d",&n)!=EOF){f[n-1]++;if(f[ans]<f[n-1])ans=n-1;}for(n=0;n<100;n++)if(f[n]==f[ans])printf("%d\n",n+1);}

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

int main()
{
  int cnt[101] = {0};
  int data, ma = 0;
  priority_queue<int, vector<int>, greater<int> > q;
  while( cin >> data ) {
    cnt[data]++;
    ma = max(ma, cnt[data]);
  }

  for(int i=1; i<=100; i++) {
    if( cnt[i] == ma ) {
      q.push( i );
    }
  }

  while( !q.empty() ) {
    cout << q.top() << endl;
    q.pop();
  }
}

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

using namespace std;

int main(void){

  int p[14][14] = {0};
  int x,y,size;
  char ten,tenten;
 back:;
  while( cin >> x >> ten >> y >> tenten >> size ){
    x++;x++;
    y++;y++;
    switch(size){
    case 3:
      p[x-2][y]++;
      p[x+2][y]++;
      p[x][y-2]++;
      p[x][y+2]++;
    case 2:
      p[x+1][y+1]++;
      p[x-1][y-1]++;
      p[x+1][y-1]++;
      p[x-1][y+1]++;
    case 1:
      p[x][y+1]++;
      p[x][y-1]++;
      p[x-1][y]++;
      p[x+1][y]++;
      p[x][y]++;
    }
  }
  
  int cnt = 0;
  int m = 0;
  for( int i = 2 ; i < 12 ; i++ ){
    for( int j = 2 ; j < 12 ; j++ ){
      if( p[i][j] == 0 ) cnt++;
      m = max( m , p[i][j] );
    }
  }
  cout << cnt << endl << m << endl;
  return 0;
}

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

int main(){
  int n;
  complex<int> c;
  vector< complex<int> > v;
  vector<int> srt;

  while( cin>>n ){
    if( v.size()==0 ){
      c.real() = n;
      c.imag() = 1;
      v.push_back( c );
      //      cout << "push_back : "<< n << endl;
    }else{
      for( unsigned int i=0;i<v.size();i++ ){
	if( v[i].real()==n ){
	  //	  cout << "coindance : "<<n << endl;
	  v[i].imag()++;
	  break;
	}
	if( i==v.size()-1 ){
	  c.real() = n; c.imag()=1;
	  v.push_back( c );
	  //	  cout << "push_back : "<< n << endl;
	  break;
	}
      }
    }
  }

  int mx = -1;
  for( unsigned int i=0;i<v.size();i++ ){
    //    cout << v[i].real()<<" "<<v[i].imag() << endl;
    mx = max( v[i].imag(), mx );
  }

  srt.clear();
  for( unsigned int i=0;i<v.size();i++ ){
    if( v[i].imag()==mx )
      srt.push_back( v[i].real() );
  }

  sort( srt.begin(), srt.end() );
  for( unsigned int i=0;i<srt.size();i++ )
    cout << srt[i] << endl;

  return 0;
}

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


//0028
int main(){
	int x,max_freq=0;
	int digit[101]={0};
	

	while(cin >> x ){
		
		max_freq = max(max_freq, ++digit[x]);
		
	}
		for(int i=0; i<101; ++i){
			if(digit[i]==max_freq){
				cout << i << endl;
			}
		}


}

C++: #include <iostream>
#include <utility>
#include <vector>
#include <algorithm>
using namespace std;
typedef pair<int,int> P;

bool comp(const P& a, const P& b) {
	if (a.first != b.first) return (a.first > b.first);
	return (a.second < b.second);
}

int main() {
	vector<P> seq;
	int n;
	while (cin >> n) {
		bool inserted = false;
		for (int i = 0; i < seq.size(); i++) {
			if (seq[i].second == n) {
				seq[i].first++;
				inserted = true;
			}
		}
		if (!inserted)
			seq.push_back(P(1, n));
	}

	sort(seq.begin(), seq.end(), comp);

	int m = seq[0].first;
	for (int i = 0; seq[i].first == m; i++)
		cout << seq[i].second << endl;
	
	return 0;
}

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

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

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

int main(){
	int n[101], k, max=0;
	string ans;

	for (int i = 0; i < 101; i++) {
		n[i] = 0;
	}

	while(true){
		cin >> k;
		if (cin.eof()) { break; }
		n[k]++;
	}
	for(int i = 0;i<101;i++){
		if(max == n[i]){
			ans += "\n";
			ans += to_string(i);
		}
		else if (max < n[i]){
			ans = to_string(i);
			max = n[i];
		}
	}
	cout << ans << endl;
	return 0;
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
	int N[101] = {};
	vector<int> vM;
	vM.reserve(100);
	int c = 0, k;
	while(cin >> k){
		++N[k];
		if(N[k] > c){
			c = N[k];
			vM.clear();
			vM.push_back(k);
		} else if( N[k] == c)
			vM.push_back(k);
	}
	sort(vM.begin(), vM.end());
	for(int i = 0; i < vM.size(); ++i)
		cout << vM[i] << "\n";
	return 0;
}

C++: #include <stdio.h>

int main()
{
	int i;
	int seed,max = 0;
	int data[100] = { 0 };
	int maxnum[100];
	while ((scanf_s("%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 <iostream>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <string>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)

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