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]; int[] typeCount = new int[5]; for(int cnt_i=0; cnt_i < typeCount.length; cnt_i++){ typeCount[cnt_i] = 0; } for(int types_i=0; types_i < n; types_i++){ types[types_i] = in.nextInt(); typeCount[types[types_i]-1]++; } int result = 0; int tmp = 0; for(int cnt_i=(typeCount.length-1); cnt_i >= 0 ; cnt_i--){ if (tmp <= typeCount[cnt_i]) { tmp = typeCount[cnt_i]; result = cnt_i+1; } } System.out.println(result); } }