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) { int i=0; int j=0; Scanner in = new Scanner(System.in); int n = in.nextInt(); int[] types = new int[n]; ArrayList list1 = new ArrayList(); for(int types_i=0; types_i < n; types_i++){ types[types_i] = in.nextInt(); } // your code goes herefor ( i = 0; i < n; i++) for ( i = 0; i < n; i++) { for ( j = i + 1; j < n; j++) { if (types[i] == types[j]) { list1.add(types[i]); } } } System.out.println(list1.get(0)); } }