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[] type = new int[5]; int maxValue=0, result=1; for(int i=0; i < n; i++){ int val = in.nextInt(); type[val-1]++; maxValue = Math.max(maxValue,type[val-1]); //get the maxValue } in.close(); for (int k=0;k<5;k++){ if (type[k]==maxValue){ result = k+1; break; //already found the minimum index where maxValue = type[k]; } } System.out.println(result); } }