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 c1,c2,c3,c4,c5,max; c1=c2=c3=c4=c5=0; for(int types_i=0; types_i < n; types_i++){ types[types_i] = in.nextInt(); } for(int types_i=0; types_i < n; types_i++){ if(types[types_i]==1) c1++; else if(types[types_i]==2) c2++; else if(types[types_i]==3) c3++; else if(types[types_i]==4) c4++; else if(types[types_i]==5) c5++; } max=c1>c2?c1:c2; max=max>c3?max:c3; max=max>c4?max:c4; max=max>c5?max:c5; if(max==c1) System.out.println(""+1); else if(max==c2) System.out.println(""+2); else if(max==c3) System.out.println(""+3); else if(max==c4) System.out.println(""+4); else System.out.println(""+5); // your code goes here } }