import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) { BufferedReader buff = new BufferedReader(new InputStreamReader(System.in)); try { buff.readLine(); String[] box = buff.readLine().split(" "); int[] count = new int[6]; for(int i = 0; i < box.length; ++i){ count[Integer.parseInt(box[i])-1]++; } int ans = 0, max = 0; for(int i = 0; i < 6; ++i){ if(count[i] >= max){ ans = i+1; max = count[i]; } } System.out.println(ans); } catch (NumberFormatException e) { e.getStackTrace(); } catch (IOException e) { e.getStackTrace(); } catch (Exception e) { e.getStackTrace(); } } }