using System; using System.Collections.Generic; using System.Linq; namespace lecture { class MainClass { public static void Main(string[] args) { int N = int.Parse(Console.ReadLine()); int[] L = Console.ReadLine().Trim().Split(' ').Select(x => int.Parse(x)).ToArray(); // わざと1つ多めに宣言する 1〜6を使いたい int[] counts = new int[7]; // それぞれの数字が何個あるかカウントする for (int i = 0; i < L.Length; i++) { int j = L[i]; counts[ j ]++; } // カウントした最大値の数字を出力する // counts[1] -> 2 // counts[2] -> 1 // counts[3] -> 2 // counts[4] -> 0 // counts[5] -> 0 // counts[6] -> 0 int max = 0; for (int i = 1; i <= 6;i++){ if (max < counts[i]){ max = counts[i]; } } int index = 0; for (int i = 1; i <= 6;i++){ if (counts[i] == max){ index = i; } } Console.WriteLine(index); } } }