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[] ntype = Array.ConvertAll(types_temp,Int32.Parse); // your code goes here int cnt1 = 0,cnt2 = 0,cnt3 = 0,cnt4 = 0,cnt5 = 0; while (!(n >= 5 && n <= 200000)) { n = Convert.ToInt32(Console.ReadLine()); } int[] tmp = new int[5]; for (int i = 0; i < ntype.Length; i++){ if (ntype[i] == 1){ cnt1 = cnt1 + 1; tmp[0] = cnt1; } else if (ntype[i] == 2){ cnt2 = cnt2 + 1; tmp[1] = cnt2; } else if (ntype[i] == 3){ cnt3 = cnt3 + 1; tmp[2] = cnt3; } else if (ntype[i] == 4){ cnt4 = cnt4 + 1; tmp[3] = cnt4; } else if (ntype[i] == 5){ cnt5 = cnt5 + 1; tmp[4] = cnt5; } } int max = tmp.Max(); int index = tmp.ToList().IndexOf(max); Console.WriteLine(index+1); } }