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 amount = in.nextInt(); ArrayList typeList = new ArrayList<>(); for(int i = 0; i < amount; i++) typeList.add(0); for(int i = 0; i < amount; i++) { int type = in.nextInt(); typeList.set(type - 1, typeList.get(type - 1) + 1); } System.out.println(typeList.indexOf(Collections.max(typeList)) + 1); } }