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[] defaults= new int[5]{5,4,3,2,1,} ; int currentMax = 0; int maxType = 0; int temp; foreach(int defaultValue in defaults) { temp = types.Where(ex=>ex == defaultValue).Count(); if(temp >= currentMax) { currentMax = temp; maxType = defaultValue; } } Console.WriteLine(maxType); } }