using System; using System.Collections.Generic; using System.IO; using System.Linq; class Solution { static void Main(String[] args) { int n = Convert.ToInt32(Console.ReadLine()); string[] types_temp = Console.ReadLine().Split(' '); int[] types = Array.ConvertAll(types_temp, Int32.Parse); int[] x = new int[6]; int max = 0; int maxi = 9; for (int i = 0; i < n; i++) { x[types[i]]++; if (x[types[i]] > max) max = x[types[i]]; } for (int i = 5; i > 0; i--) if (x[i] >= max) maxi = i; Console.WriteLine(maxi.ToString()); } }