n=gets.to_i l=gets.split.map &:hex p l.max_by{|i|[i,l.count(i)]}