using System; namespace yukicoder { class Program { static void Main(string[] args) { int a = int.Parse(Console.ReadLine()); string[] s = Console.ReadLine().Split(' '); int b; int ans = 0; int[] c = new int[10]; for(int i = 0; i < a; i++) { b = int.Parse(s[i]); for(int j = 1; j <= 10; j++) { if (b == j) { c[j - 1]++; } } } for(int x = 0; x <= 8; x++) { if (c[x] > c[x + 1]) { ans = x+1; } else if (c[x + 1] > c[x]) { ans = x + 1; } } Console.WriteLine(ans); } } }