#include<iostream>
#include<cstdio>
using namespace std;
int main(){
  int date[1000],higher[1000],high[1000]={0},t=0,bell=0,hess=0,aizu=0,riri=0;
  while(scanf("%d",&date[t])!=EOF){
    high[date[t]]++;
    t++;
  }
  for(int i=0;i<t;i++){
    if(bell<high[i]){
      higher[0]=i;
      bell=high[i];
      riri=i;
    }
  }
  for(int i=0;i<t;i++){
    if(higher[hess]==high[i] && i!=riri){
      hess++;
      higher[hess]=i;
    }
  }
  for(int i=0;i<=hess;i++){
    cout << higher[i] << endl;
  }
  return (0);
}