import java.util.*;
public class Main {
    public static void main(String args []){
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        Map<String,Integer> Num = new HashMap<>();
        for(int i=0;i<N;i++){
            String s = sc.next();
            if(Num.get(s)==null) Num.put(s,1);
            else Num.replace(s,Num.get(s)+1);
        }
        int max = Collections.max(Num.values());
        ArrayList<String> OPT = new ArrayList<>(Num.keySet());
        Collections.sort(OPT);
        for(String s:OPT) if(Num.get(s)==max) System.out.println(s);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String args []){
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        Map<String,Integer> Num = new HashMap<>();
        for(int i=0;i<N;i++){
            String s = sc.next();
            if(Num.get(s)==null) Num.put(s,1);
            else Num.replace(s,Num.get(s)+1);
        }
        int max = Collections.max(Num.values());
        ArrayList<String> OPT = new ArrayList<>(Num.keySet());
        Collections.sort(OPT);
        for(String s:OPT) if(Num.get(s)==max) System.out.println(s);
    }
} Main public static void main(String args []){
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        Map<String,Integer> Num = new HashMap<>();
        for(int i=0;i<N;i++){
            String s = sc.next();
            if(Num.get(s)==null) Num.put(s,1);
            else Num.replace(s,Num.get(s)+1);
        }
        int max = Collections.max(Num.values());
        ArrayList<String> OPT = new ArrayList<>(Num.keySet());
        Collections.sort(OPT);
        for(String s:OPT) if(Num.get(s)==max) System.out.println(s);
    } main {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        Map<String,Integer> Num = new HashMap<>();
        for(int i=0;i<N;i++){
            String s = sc.next();
            if(Num.get(s)==null) Num.put(s,1);
            else Num.replace(s,Num.get(s)+1);
        }
        int max = Collections.max(Num.values());
        ArrayList<String> OPT = new ArrayList<>(Num.keySet());
        Collections.sort(OPT);
        for(String s:OPT) if(Num.get(s)==max) System.out.println(s);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc Map<String,Integer> Num = new HashMap<>(); Num new HashMap<>() for(int i=0;i<N;i++){
            String s = sc.next();
            if(Num.get(s)==null) Num.put(s,1);
            else Num.replace(s,Num.get(s)+1);
        } int i=0; int i=0; i 0 i<N i N i++ i++ i {
            String s = sc.next();
            if(Num.get(s)==null) Num.put(s,1);
            else Num.replace(s,Num.get(s)+1);
        } {
            String s = sc.next();
            if(Num.get(s)==null) Num.put(s,1);
            else Num.replace(s,Num.get(s)+1);
        } String s = sc.next(); s sc.next() sc.next sc if(Num.get(s)==null) Num.put(s,1);
            else Num.replace(s,Num.get(s)+1); Num.get(s)==null Num.get(s) Num.get Num s null Num.put(s,1) Num.put Num s 1 Num.replace(s,Num.get(s)+1) Num.replace Num s Num.get(s)+1 Num.get(s) Num.get Num s 1 int max = Collections.max(Num.values()); max Collections.max(Num.values()) Collections.max Collections Num.values() Num.values Num ArrayList<String> OPT = new ArrayList<>(Num.keySet()); OPT new ArrayList<>(Num.keySet()) Collections.sort(OPT) Collections.sort Collections OPT for(String s:OPT) if(Num.get(s)==max) System.out.println(s); String s OPT if(Num.get(s)==max) System.out.println(s); if(Num.get(s)==max) System.out.println(s); Num.get(s)==max Num.get(s) Num.get Num s max System.out.println(s) System.out.println System.out System System.out s String args [] args public class Main {
    public static void main(String args []){
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        Map<String,Integer> Num = new HashMap<>();
        for(int i=0;i<N;i++){
            String s = sc.next();
            if(Num.get(s)==null) Num.put(s,1);
            else Num.replace(s,Num.get(s)+1);
        }
        int max = Collections.max(Num.values());
        ArrayList<String> OPT = new ArrayList<>(Num.keySet());
        Collections.sort(OPT);
        for(String s:OPT) if(Num.get(s)==max) System.out.println(s);
    }
} public class Main {
    public static void main(String args []){
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        Map<String,Integer> Num = new HashMap<>();
        for(int i=0;i<N;i++){
            String s = sc.next();
            if(Num.get(s)==null) Num.put(s,1);
            else Num.replace(s,Num.get(s)+1);
        }
        int max = Collections.max(Num.values());
        ArrayList<String> OPT = new ArrayList<>(Num.keySet());
        Collections.sort(OPT);
        for(String s:OPT) if(Num.get(s)==max) System.out.println(s);
    }
} Main
import java.util.*;
public class Main {
    public static void main(String args []){
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        Map<String,Integer> Num = new HashMap<>();
        for(int i=0;i<N;i++){
            String s = sc.next();
            if(Num.get(s)==null) Num.put(s,1);
            else Num.replace(s,Num.get(s)+1);
        }
        int max = Collections.max(Num.values());
        ArrayList<String> OPT = new ArrayList<>(Num.keySet());
        Collections.sort(OPT);
        for(String s:OPT) if(Num.get(s)==max) System.out.println(s);
    }
}