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 int[] count = { 0, 0, 0, 0, 0 }; for (int i = 0; i < n; i++) { if (types[i] == 1) count[0]++; else if (types[i] == 2) count[1]++; else if (types[i] == 3) count[2]++; else if (types[i] == 4) count[3]++; else if (types[i] == 5) count[4]++; } int max = count[0]; int type = 1; for(int i = 0; i < 5; i++) { if (max < count[i]) { max = count[i]; type = i + 1; } else if (max == count[i]) { if (type > i) type = i + 1; } } Console.WriteLine(type); } }