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 <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main(){
	int n;
	int all[100];
	for(int i=0; i<100; i++) all[i] = 0;
	while(cin>>n) all[n-1]++;
	int m = 0;
	for(int i=0; i<100; i++) m = max(m, all[i]);
	vector<int> ans;
	for(int i=0; i<100; i++){
		if(m==all[i]) ans.push_back(i+1);
	}
	for(int i=0; i<ans.size(); i++) cout<<ans[i]<<endl;
	return 0;
}

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

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

using namespace std;

int main (void) {
    int t[10] = {0}, m = 0;
    while (1) {
        int n;
        cin >> n;
        if (cin.eof()) break;
        t[n - 1]++;
        m = max(m, t[n - 1]);
    }
    for (int i = 0; i < 10; i++) {
        if (t[i] == m) {
            cout << (i + 1) << endl;
        }
    }
    return 0;
}

C++: #include<stdio.h>
#include<iostream>
using namespace std;
int main(void)
{
	int a[101]={0},i,n,s=0;
	while(cin>>n){
		a[n]++;
		if(a[n]>s){
			s=a[n];
		}
	}
	for(i=100;i>0;i--){
		if(s==a[i]){
		cout<<i<<endl;
		}
	}
	return 0;
}

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

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

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

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,j,temp;
  int flag;

  while(scanf("%d",&n)!=EOF) {
    //for(j=0;j<12;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++) {
    for(j=0;j<s-i-1;j++) {
      if(mode[j]>mode[j+1]) {
	temp=mode[j];
	mode[j]=mode[j+1];
	mode[j+1]=temp;
      }
    }
  }

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

  

  return 0;

}

C++: #include <bits/stdc++.h>
using namespace std;
int main(){
  int n,a[101]={0},k=0;
  while(cin>>n){
    a[n]++;
    k=max(a[n],k);
  }
  for(int i=1;i<101;i++)if(a[i]==k)cout<<i<<endl;
}