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[] typeCount = new int[6]; for (int i = 0; i < typeCount.Length; i++) { typeCount[i] = 0; }//{ {1, 0}, {2, 0} {3, 0}, {4, 0}, {5, 0} }; // your code goes here for (int i = 0; i < n; i++) { typeCount[types[i]]++; } Console.WriteLine(Array.IndexOf(typeCount, typeCount.Max())); } }