N = gets.chomp.to_i Ls = gets.chomp.split.map(&:to_i).tally puts Ls.sort.reverse.to_h.key(Ls.values.max)