#include <bits/stdc++.h>
#include <stdio.h>
#include <numeric>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define repone(i,n) for(int i=1;i<(int)(n);++i)
#define repo(i,o,n) for(int i=o;i<(int)(n);++i)
#define Rep(j,n) for(int j=0;j<(int)(n);++j)
#define Repo(j,o,n) for(int j=o;j<(int)(n);++j)
#define Repone(j,n) for(int j=1;j<(int)(n);++j)
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
#define int long long
#define pb(a) push_back(a)
#define pbpair(a,b) push_back(make_pair(a,b))
#define MOD 1000000007
#define INF 9223372036854775807
#define pairint pair<int,int>
typedef pair< int , int> P;
int gcd( int x, int y ){
   return y ? gcd(y, x%y) : x;
 }
bool pairCompare(const P& firstElof, const P& secondElof)
{
  if(firstElof.second!= secondElof.second)    return firstElof.second> secondElof.second;
  else return firstElof.first< secondElof.first;
}
signed main() {
int x=0,y=0,z=0,w=0,n=0,m=0;
std::vector< pairint > v(101);
string k;
while(std::cin >> x){
v[x].first=x;
v[x].second++;
}
sort(all(v),pairCompare);
std::cout << v[0].first << '\n';
repone(i,101){
  if(v[0].second==v[i].second){
    std::cout << v[i].first << '\n';
  }else {
    return 0;
  }
}
}

