#!/usr/local/bin/ruby
num = Hash.new(0)
max = 0
while (n=gets.to_i)!=0
#while (n=gets.to_i) != true
 num[n] += 1
end
num.to_a.sort{|p,q| -(p[1]<=>q[1]) }.each do |key,value|
 if value >= max
  max = value
  puts key
 else
  break
 end
end