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) throws IOException { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(in.readLine()); int[] types = new int[5]; StringTokenizer st = new StringTokenizer(in.readLine()); for(int types_i=0; types_i < n; types_i++){ types[Integer.parseInt(st.nextToken())-1]++; } int b=0; int t=0; for(int i=0;i<5;i++){ if(types[i]>b){ b=types[i]; t=i+1; } } System.out.println(t); } }