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 <stdio.h>
#include<math.h>
#include <string.h>
#include <ctype.h>

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

return 0;
}

C++: // Bowen Yu
// NYU - Progteam

#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <sstream>
#include <complex>
#include <ctime>
#include <cassert>
#include <functional>

using namespace std;

typedef long long ll;
typedef vector<int> VI;
typedef pair<int, int> PII;

#define REP(i,s,t) for(int i=(s);i<(t);i++)
#define FILL(x,v) memset(x,v,sizeof(x))

const int INF = (int)1E9;
#define MAXN 100005

char str[MAXN];
int main() {
  int x, max = 0;
  set<int> maxS;
  map<int,int> m;
  while (cin >> x) {
    if ( m.find(x) == m.end() ) {
      m[x] = 1;
    } else {
      m[x] = m[x] + 1;
    }

    if (m[x] > max) {
      max = m[x];
      maxS.clear();
      maxS.insert(x);
    } else if (m[x] >= max) {
      maxS.insert(x);
    }
  }

  for (set<int>::iterator it=maxS.begin(); it!=maxS.end(); ++it)
    cout << *it << endl;

  return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <math.h>

//#define PI 3.141592653589

using namespace std;



int main()
{
	int dic[101];
	int data;
	int max_data = 0;
	
	for (int i=0; i<10; i++) dic[i] = 0;
	while (cin >> data)
	{
		dic[data]++;
		max_data = max(max_data, dic[data]);
	}
	for (int i=0; i<10; i++)
	{
		if (dic[i] == max_data)
		{
			cout << i << endl;
		}
	}
	
	return 0;
}

C++: #include<iostream>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
using namespace std;
int main(){
  int out[101]={0};
  int in;
  while(cin>>in)out[in]++;
  int max1=0;
  rep(i,101)max1=max(max1,out[i]);
  rep(i,101)if(max1==out[i])cout<<i<<endl;
}

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

using namespace std;

struct DATA{
  int number;
  int count;
};

void PushWordCount(int, vector<DATA>&);
bool Compare(const int&, const int&);

int main(){
  int i, n, max = 0;
  vector<int> Max;
  vector<DATA> data;

  while(cin >> n)
    PushWordCount(n, data);

  for(i=0; i<data.size(); ++i){
    if(data[i].count == max){
      Max.push_back(data[i].number);
    }else if(data[i].count > max){
      Max.clear();
      Max.push_back(data[i].number);
      max = data[i].count;
    }
  }
  sort(Max.begin(), Max.end());

  for(i=0; i<Max.size(); ++i)
    cout << Max[i] << endl;

  return 0;
}

void PushWordCount(int n, vector<DATA>& data){
  int isFound = 0;
  DATA newdata;
  vector<DATA>::iterator iter = data.begin();

  while(iter != data.end()){
    if(iter->number == n){
      isFound = 1;
      ++iter->count;
      break;
    }
    ++iter;
  }
  if(isFound == 0){
    newdata.number = n;
    newdata.count = 1;
    data.push_back(newdata);
  }
}

C++: #include <bits/stdc++.h>

using namespace std;

int main()
{    
    int N, mx = 0; 
    map<int, int> mp;
    while (cin >> N) {
        mx = max(mx, ++mp[N]);
    }
    for (auto &v: mp) {
        if (v.second == mx) {
            cout << v.first << endl;
        }
    }        
    return 0;
}

C++: #include <iostream>

using namespace std;

int main()
{
	int counter[101];
	for(auto& i : counter)
		i = 0;

	{
		size_t input;
		while(cin >> input)
			counter[input]++;
	}

	int max = 0;
	for(auto& i : counter)
		if(max < i)
			max = i;

	for(int i = 1; i < 101; i++)
		if(counter[i] == max)
			cout << i << endl;

	return 0;
}

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

int main(){
    int hindo[100] = {0};
    int max = 0;
    int n;

    while(cin >> n){
        hindo[n-1]++;
    }

    for(int i=0; i<100; i++){
        if(max < hindo[i]){
            max = hindo[i];
        }
    }

    for(int i=0; i<100; i++){
        if(max == hindo[i]){
            cout << i+1 << endl;
        }
    }
    return 0;
}

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

using namespace std;

int main() {
  map<int, int> num;

  int n = 0;
  while(cin >> n){
    //if(n == -1) break;
    num[n]++;
  }

  int max = 0;
  int max_i = 0;
  map<int, int>::iterator it = num.begin();
  for(; it != num.end(); it++) {
    if(it->second > max_i) {
      max = it->first;
      max_i = it->second;
    }
  }

  for(it = num.begin(); it != num.end(); it++) {
    if(max_i == it->second) {
      cout << it->first << endl;
    }
  }

  return 0;
}

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

C++: #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main(){
	int n;
	while(cin >> n){
		int num[110]={},x,ans1=0,ans2=0;
		for(int i=0;i<n;i++){
			cin >> x;
			num[x]++;
		}
		for(int i=1;i<=100;i++){
			if(num[i]>ans2){
				ans1 = i;
				ans2 = num[i];
			}
		}
		cout << ans1 << endl;
	}
	return 0;
}

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

C++: #include <iostream>

using namespace std;
#define rep2(x,from,to) for(int x=(from); x<(to); (x)++)
#define rep(x,to) rep2(x,0,to)
int main() {
	int n, a[101];
	while(cin >> n) {
		a[n]++;
	}
	int max = 0;
	rep(i,100) {
		if(max < a[i]) max = a[i];
	}
	rep(i,100) {
		if(a[i] == max) {
			cout << i << endl;
		}
	}
	return 0;
}

C++: 
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <stack>
#include <cctype>
#include <complex>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <cassert>

using namespace std;


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

int main(){
	cout.setf(ios::fixed);
	cout.precision(10);
	solve();

	return 0;
}

C++: 
#include<iostream>
#include<algorithm>
using namespace std;
int main(){
int a[10000]={0};
int s,sai,ans=0,c=0,i;
while(cin>>s){
a[s]++;
c++;
}
for(i=0;i<c;i++){
if(a[i]>ans){
ans=a[i];
sai=i;
}
}
cout<<sai<<endl<<ans<<endl;
return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<vector>
#include<functional>
using namespace std;
int main(){
	int i=0;
	vector<int> a(101),b(101);
	while(cin>>a[i]){
		i++;
	}
	for(int j=1;j<=100;j++){
	b[j-1] = count(a.begin(),a.end(),j);
	}
	int p = *max_element(b.begin(),b.end()) ;

	for(int j=0;j<=100;j++){	
	if(b[j] == p )cout<< j+1<<endl;
	}
		//for(int j=1;j<=100;j++) cout<<j<<"="<<b[j-1]<<endl;
}