using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace lecture { class Program { public static void Main(String[] args) { int N = int.Parse(Console.ReadLine()); int[] L = Console.ReadLine().Trim().Split(' ').Select(x => int.Parse(x)).ToArray(); int [] counts= new int[N]; for (int i = 0; i < L.Length; i++) { int j = L[i]; counts[j]++; } int max = 0; int index = 0; for (int i = L.Length-1; i >= 1; i--) { if(max < counts[i]){ max = counts[i]; index = i; } } Console.WriteLine(index); } } }