import java.util.Collections; import java.util.Comparator; import java.util.HashMap; import java.util.LinkedList; import java.util.Scanner; public class Main{ public static void main(String args[])throws Exception{ Scanner sc=new Scanner(System.in); HashMapmap=new HashMap(); int n=Integer.parseInt(sc.nextLine()); for(int i=0;iqueue=new LinkedList(map.values()); Collections.sort(queue,new Comparator(){ public int compare(A a1,A a2){ if(a1.num != a2.num) return a1.num-a2.num; else return a1.value-a2.value; } }); System.out.println(queue.getLast().value); } } class A{ int num; int value; public A(int value){ this.value=value; this.num=1; } public String toString(){ return this.value+":"+this.num; } }