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]; for(int types_i=0; types_i < n; types_i++){ types[types_i] = in.nextInt(); } int o = 0; int t = 0; int th = 0; int f = 0; int fv = 0; for (int x = 0; x < n; x++){ if (types[x] == 1) o += 1; else if (types[x] == 2) t += 1; else if (types[x] == 3) th += 1; else if (types[x] == 4) f += 1; else fv += 1; } int s; int a; if(o > t){ s = o; a = 1; } else if (t > o) { s = t; a = 2; } else { s = o; a = 1; } if(th > s){ s = th; a = 3; } if (f > s){ s = f; a = 4; } if (fv > s){ s=fv; a = 5; } System.out.println("" + a); } }