#encoding:utf-8 No.0028 2014.12.10
num = Array.new(100,0)

while gets
  if $_.to_i == 0
    break
  end
  num[$_.to_i] += 1
end

num.each_with_index do |item,idx|
  if item == num.max
    puts idx
  end
end