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(); Integer[] types = new Integer[n]; int count =0; int type=0; for(int types_i=0; types_i < n; types_i++){ types[types_i] = in.nextInt(); } List list = Arrays.asList(types); for(int i=0;i<5;i++) { int x = Collections.frequency(list, i+1); if(x!=0 && x>count) { count=x; type =i+1; }else if(x==count && type!=0&& x!=0) { type=type; } } System.out.print(type); // your code goes here } }