import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { public static void findMostOccurence(int n, int[] types) { Map occurences = new HashMap<>(); for (int i = 0; i < n; i++) { int type = types[i]; Integer count = occurences.get(type); if (count == null) { occurences.put(type, 1); } else { occurences.put(type, count + 1); } } int max = Collections.max(occurences.values()); for (int i = 1; i <= 5; i++) { Integer count = occurences.get(i); if (count != null && count == max) { System.out.print(i); break; } } } 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(); } findMostOccurence(n, types); } }