import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { static int NUM_TYPES = 5; 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(); } /* add up the sum for each type */ int[] sum = new int[NUM_TYPES]; for(int i=0; i < n; i++){ sum[types[i]-1]++; } int highest = 0; int tally = 0; for(int j = sum.length-1; j >= 0; j--) { if (sum[j] >= tally) { tally = sum[j]; highest = j; } } System.out.println(highest+1); } }