#!/usr/local/bin/ruby
num = Hash.new(0);
max = 0
while (n=gets.to_i)!=0
#while (n=gets)
 num[n.to_i] += 1
end
v = num.values.max
res = []
num.keys.each do |k|
 res << k if num[k] ==v
end
puts res.sort