a = []

loop do
	s = gets
	if !s then break; end
	a.push(s.to_i)
end

ary = []

for i in a.min..a.max do
	if !ary.max or a.count(i) >= ary.max()
		if !ary.max or a.count(i) > ary.max() then ary = []; end
		ary.push(i)
	end
end

ary.each do |v|
	puts v
end