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); // your code goes here const int TYPECOUNT = 5; int[] typeCount = new int[TYPECOUNT]; int MaxTypeID = 0; //Console.WriteLine(n + " , " + types[2]); for (int i = 0; i < n; i++) { typeCount[types[i] -1 ]++; } for (int i = 0; i < typeCount.Length; i++) { //Console.WriteLine("Index "+ (i+1) +" - "+typeCount[i]); if(typeCount[i] > typeCount[MaxTypeID]) { MaxTypeID = i; } if(typeCount[i] == typeCount[MaxTypeID]) { if (i < MaxTypeID) { MaxTypeID = i; } } } //Console.WriteLine("count - " + typeCount[MaxTypeID]); Console.WriteLine(MaxTypeID + 1); } }