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 b1 = 0; int b2 = 0; int b3 = 0; int b4 = 0; int b5 = 0; for(int types_i=0; types_i < n; types_i++){ int bird = in.nextInt(); if (bird == 1) b1++; else if(bird == 2) b2++; else if(bird == 3) b3++; else if(bird == 4) b4++; else if(bird == 5) b5++; } //Put values into hashmap HashMap mapValues = new HashMap<>(5); mapValues.put(1,b1); mapValues.put(2,b2); mapValues.put(3,b3); mapValues.put(4,b4); mapValues.put(5,b5); //Find the max value int max = 0; for (int i = 1;i<=5;i++){ if (mapValues.get(i) > max) max = mapValues.get(i); } ArrayList maxValues = new ArrayList<>(); for (int i = 1;i<=5;i++){ if (max == mapValues.get(i)) maxValues.add(i); } int min = 10000; for (int i = 0;i