arr = []
while n = gets.to_i
  break if n == 0
  arr << n
end

count_hash = {}
1.upto(100){ |i| count_hash[i] = 0 }

max = 0
arr.each do |i|
  count_hash[i] += 1
  max = count_hash[i] if count_hash[i] > max
end

puts count_hash.select { |key, value| value == max }.keys