import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int[] types = new int[n]; for(int types_i=0; types_i < n; types_i++){ types[types_i] = in.nextInt(); } // your code goes here /* use switch/case to tally the total number * of each type of bird */ int[] tally = new int[5]; for(int tally_i=0; tally_i < n; tally_i++){ switch (types[tally_i]){ case 1: tally[0]++; break; case 2: tally[1]++; break; case 3: tally[2]++; break; case 4: tally[3]++; break; case 5: tally[4]++; break; } } /* find the type with the greatest total * and assign to variable 'max' */ int max = tally[0]; for(int max_i = 1; max_i < 5; max_i++){ if(tally[max_i] > max){ max = tally[max_i]; } } /* find the first type whose tally * matches variable 'max' */ int ans = 0; while(tally[ans] != max){ ans++; } System.out.println(ans + 1); } }