N = gets.chomp.to_i Ls = gets.chomp.split.map(&:to_i) puts Ls.tally.sort_by { [_2, _1] }.last.first