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 <string>
#include <vector>
#include <algorithm>
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <queue>
#include <map>
#define INF 100000000
#define rep(i,a) for(int i=0;i<(a);i++)

using namespace std;
typedef long long ll;


int main(){
    queue<int> ans;
    int ma=-1;
    map<int,int> map;
    map.clear();
    int tmp;
    while(cin>>tmp){
        map[tmp]++;
    }
    rep(i,map.size()){
        if(ma<map[i])
        
    }
}

C++: #include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <algorithm>
using namespace std;

int main() {
  int a[101] = {0};
  int max = 0, n;

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

}

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

int num[10];
int big = 0;
int input;
int main(){
	for(int i=0; i < 10; i++) num[i]=0;
	while(cin >> input) 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;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(void){
	int n;
	int box[101];
	int i;
	int MAX;
	for(i=1;i<=100;i++)	box[i]=0;
	while(1){
		cin>>n;
		if(cin.eof()==1)	break;
		box[n]++;
	}
	MAX=-1;
	for(i=1;i<=100;i++)		MAX=max(MAX,box[i]);
	for(i=1;i<=100;i++)		if(MAX==box[i])	cout<<i<<endl;
	return 0;
}

C++: #include<iostream>
#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(cin >> input) 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;
}

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

C++: #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <time.h>
#include <math.h>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <algorithm>
#include <iterator>
#include <sstream>
#include <string>
#include <bitset>
using namespace std;
#define FOR(I,F,N) for(int I = F; I < (int)(N); I++)
#define rep(i, n) FOR(i, 0, n)
#define FIN(V) cout<<V<<endl
#define pb push_back
#define INF (1 << 30)
typedef pair<int, int> P;
typedef long long ll;
typedef priority_queue<int> pq;
int StrToInt(string);
string IntToStr(int);
int dx[4] = {1, -1, 0, 0};
int dy[4] = {0, 0, 1, -1};

int main(void){
	int n;
	vector<int> v(101, 0);
	while(cin >> n){
		v[n]++;
	}
	int mx = 0;
	rep(i,v.size()){
		if(v[i] > mx)mx = v[i];
	}
	rep(i,v.size()){
		if(v[i] == mx)FIN(i+1);
	}

	return 0;
}

C++: #include <stdio.h>
#include <math.h>
#include <iostream>

using namespace std;

int main() {

	int counter[10] = {0};
	int a;
	int MAX = 0;
	int i = 0;
	
	while (cin >> a) {
		counter[a]++;
	}

	for (int j = 1; j < 10; j++) {
		MAX = max(MAX, counter[j]);
	}

	for (int k = 1; k < 10; k++) {
		if (MAX == counter[k]) {
			cout << k << endl;
		}
	}

	return 0;
}

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

int main(){
	int value[100], x, max=0;
        string max_is = "";
	
	for(int j=0; j<100; j++){
		value[j] = 0;
	}
	
	while(cin>>x){
		value[x-1]++;
	}
	
	for(int i=0; i<100; i++){
		if(max<value[i]){
			max = value[i]; 
			max_is = "";
			max_is = to_string(i+1);
		}else if(max == value[i]){
			max_is = max_is + "\n" + to_string(i+1);
		}
	}

	cout << max_is << endl;

	return 0;
}