#!/bin/ruby n = gets.strip.to_i types = gets.strip types = types.split(' ').map(&:to_i) count = Array.new(5, 0) types.each do |t| count[t-1] += 1 end max_index = 0 max_value = count[0] count.each_with_index do |c, i| if max_value < c max_value = c max_index = i end end puts max_index + 1