#include<cstdio>
#include<iostream>
int main(void){
  
  int a[100];
  int i;
 
  for(i=0;i<100;i++)
    a[i]=i+1;
  
  int j;
  int n;
  int count[100]={0};
  int max=0;
  
  for(j=0;j<100;j++){
    scanf("%d",&n);
    if(n==0)
      break;
    
    for(i=0;i<100;i++){
      if(a[i]==n){
	count[i]++;
      }
      if(count[i]>max){
	max=count[i];
      }
    }
  }

  for(i=0;i<100;i++){
    if(count[i]==max){
      printf("%d\n",a[i]);
    }
  }
  return 0;
}