import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        HashMap<String,Integer> hash = new HashMap<>();
        int n =sc.nextInt();
        for (int i=0;i<n;i++){
            String s = sc.next();
            if (hash.containsKey(s)){
                hash.put(s,hash.get(s)+1);
            }else {
                hash.put(s,1);
            }
        }
        int max = Collections.max(hash.values());
        ArrayList<String> st  = new ArrayList<>();
        for (Map.Entry entry : hash.entrySet()){
            if ((int)entry.getValue()==max)st.add((String) entry.getKey());
        }
        Collections.sort(st);
        for (int i=0;i<st.size();i++)System.out.println(st.get(i));
    }
    static int factorial(int num){
        if (num==1||num==0)return 1;
        else return num*factorial(num-1);
    }
    static int arraySum(int[] array){
        int ans = 0;
        for (int value : array) ans += value;
        return ans;
    }
    static int combination(int a, int b){
        return factorial(a)/(factorial(b)*factorial(a-b));
    }
    static double log(double base,double antilogarithm){
        return Math.log(antilogarithm)/Math.log(base);
    }


} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        HashMap<String,Integer> hash = new HashMap<>();
        int n =sc.nextInt();
        for (int i=0;i<n;i++){
            String s = sc.next();
            if (hash.containsKey(s)){
                hash.put(s,hash.get(s)+1);
            }else {
                hash.put(s,1);
            }
        }
        int max = Collections.max(hash.values());
        ArrayList<String> st  = new ArrayList<>();
        for (Map.Entry entry : hash.entrySet()){
            if ((int)entry.getValue()==max)st.add((String) entry.getKey());
        }
        Collections.sort(st);
        for (int i=0;i<st.size();i++)System.out.println(st.get(i));
    }
    static int factorial(int num){
        if (num==1||num==0)return 1;
        else return num*factorial(num-1);
    }
    static int arraySum(int[] array){
        int ans = 0;
        for (int value : array) ans += value;
        return ans;
    }
    static int combination(int a, int b){
        return factorial(a)/(factorial(b)*factorial(a-b));
    }
    static double log(double base,double antilogarithm){
        return Math.log(antilogarithm)/Math.log(base);
    }


} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        HashMap<String,Integer> hash = new HashMap<>();
        int n =sc.nextInt();
        for (int i=0;i<n;i++){
            String s = sc.next();
            if (hash.containsKey(s)){
                hash.put(s,hash.get(s)+1);
            }else {
                hash.put(s,1);
            }
        }
        int max = Collections.max(hash.values());
        ArrayList<String> st  = new ArrayList<>();
        for (Map.Entry entry : hash.entrySet()){
            if ((int)entry.getValue()==max)st.add((String) entry.getKey());
        }
        Collections.sort(st);
        for (int i=0;i<st.size();i++)System.out.println(st.get(i));
    } main {
        Scanner sc = new Scanner(System.in);
        HashMap<String,Integer> hash = new HashMap<>();
        int n =sc.nextInt();
        for (int i=0;i<n;i++){
            String s = sc.next();
            if (hash.containsKey(s)){
                hash.put(s,hash.get(s)+1);
            }else {
                hash.put(s,1);
            }
        }
        int max = Collections.max(hash.values());
        ArrayList<String> st  = new ArrayList<>();
        for (Map.Entry entry : hash.entrySet()){
            if ((int)entry.getValue()==max)st.add((String) entry.getKey());
        }
        Collections.sort(st);
        for (int i=0;i<st.size();i++)System.out.println(st.get(i));
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) HashMap<String,Integer> hash = new HashMap<>(); hash new HashMap<>() int n =sc.nextInt(); n sc.nextInt() sc.nextInt sc for (int i=0;i<n;i++){
            String s = sc.next();
            if (hash.containsKey(s)){
                hash.put(s,hash.get(s)+1);
            }else {
                hash.put(s,1);
            }
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
            String s = sc.next();
            if (hash.containsKey(s)){
                hash.put(s,hash.get(s)+1);
            }else {
                hash.put(s,1);
            }
        } {
            String s = sc.next();
            if (hash.containsKey(s)){
                hash.put(s,hash.get(s)+1);
            }else {
                hash.put(s,1);
            }
        } String s = sc.next(); s sc.next() sc.next sc if (hash.containsKey(s)){
                hash.put(s,hash.get(s)+1);
            }else {
                hash.put(s,1);
            } hash.containsKey(s) hash.containsKey hash s {
                hash.put(s,hash.get(s)+1);
            } hash.put(s,hash.get(s)+1) hash.put hash s hash.get(s)+1 hash.get(s) hash.get hash s 1 {
                hash.put(s,1);
            } hash.put(s,1) hash.put hash s 1 int max = Collections.max(hash.values()); max Collections.max(hash.values()) Collections.max Collections hash.values() hash.values hash ArrayList<String> st  = new ArrayList<>(); st new ArrayList<>() for (Map.Entry entry : hash.entrySet()){
            if ((int)entry.getValue()==max)st.add((String) entry.getKey());
        } Map.Entry entry hash.entrySet() hash.entrySet hash {
            if ((int)entry.getValue()==max)st.add((String) entry.getKey());
        } {
            if ((int)entry.getValue()==max)st.add((String) entry.getKey());
        } if ((int)entry.getValue()==max)st.add((String) entry.getKey()); (int)entry.getValue()==max (int)entry.getValue() entry.getValue entry max st.add((String) entry.getKey()) st.add st (String) entry.getKey() entry.getKey entry Collections.sort(st) Collections.sort Collections st for (int i=0;i<st.size();i++)System.out.println(st.get(i)); int i=0; int i=0; i 0 i<st.size() i st.size() st.size st i++ i++ i System.out.println(st.get(i)); System.out.println(st.get(i)) System.out.println System.out System System.out st.get(i) st.get st i String[] args args static int factorial(int num){
        if (num==1||num==0)return 1;
        else return num*factorial(num-1);
    } factorial {
        if (num==1||num==0)return 1;
        else return num*factorial(num-1);
    } if (num==1||num==0)return 1;
        else return num*factorial(num-1); num==1||num==0 num==1 num 1 num==0 num 0 return 1; 1 return num*factorial(num-1); num*factorial(num-1) num factorial(num-1) factorial num-1 num 1 int num num static int arraySum(int[] array){
        int ans = 0;
        for (int value : array) ans += value;
        return ans;
    } arraySum {
        int ans = 0;
        for (int value : array) ans += value;
        return ans;
    } int ans = 0; ans 0 for (int value : array) ans += value; int value array ans += value; ans += value ans value return ans; ans int[] array array static int combination(int a, int b){
        return factorial(a)/(factorial(b)*factorial(a-b));
    } combination {
        return factorial(a)/(factorial(b)*factorial(a-b));
    } return factorial(a)/(factorial(b)*factorial(a-b)); factorial(a)/(factorial(b)*factorial(a-b)) factorial(a) factorial a (factorial(b)*factorial(a-b)) factorial(b) factorial b factorial(a-b) factorial a-b a b int a a int b b static double log(double base,double antilogarithm){
        return Math.log(antilogarithm)/Math.log(base);
    } log {
        return Math.log(antilogarithm)/Math.log(base);
    } return Math.log(antilogarithm)/Math.log(base); Math.log(antilogarithm)/Math.log(base) Math.log(antilogarithm) Math.log Math antilogarithm Math.log(base) Math.log Math base double base base double antilogarithm antilogarithm public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        HashMap<String,Integer> hash = new HashMap<>();
        int n =sc.nextInt();
        for (int i=0;i<n;i++){
            String s = sc.next();
            if (hash.containsKey(s)){
                hash.put(s,hash.get(s)+1);
            }else {
                hash.put(s,1);
            }
        }
        int max = Collections.max(hash.values());
        ArrayList<String> st  = new ArrayList<>();
        for (Map.Entry entry : hash.entrySet()){
            if ((int)entry.getValue()==max)st.add((String) entry.getKey());
        }
        Collections.sort(st);
        for (int i=0;i<st.size();i++)System.out.println(st.get(i));
    }
    static int factorial(int num){
        if (num==1||num==0)return 1;
        else return num*factorial(num-1);
    }
    static int arraySum(int[] array){
        int ans = 0;
        for (int value : array) ans += value;
        return ans;
    }
    static int combination(int a, int b){
        return factorial(a)/(factorial(b)*factorial(a-b));
    }
    static double log(double base,double antilogarithm){
        return Math.log(antilogarithm)/Math.log(base);
    }


} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        HashMap<String,Integer> hash = new HashMap<>();
        int n =sc.nextInt();
        for (int i=0;i<n;i++){
            String s = sc.next();
            if (hash.containsKey(s)){
                hash.put(s,hash.get(s)+1);
            }else {
                hash.put(s,1);
            }
        }
        int max = Collections.max(hash.values());
        ArrayList<String> st  = new ArrayList<>();
        for (Map.Entry entry : hash.entrySet()){
            if ((int)entry.getValue()==max)st.add((String) entry.getKey());
        }
        Collections.sort(st);
        for (int i=0;i<st.size();i++)System.out.println(st.get(i));
    }
    static int factorial(int num){
        if (num==1||num==0)return 1;
        else return num*factorial(num-1);
    }
    static int arraySum(int[] array){
        int ans = 0;
        for (int value : array) ans += value;
        return ans;
    }
    static int combination(int a, int b){
        return factorial(a)/(factorial(b)*factorial(a-b));
    }
    static double log(double base,double antilogarithm){
        return Math.log(antilogarithm)/Math.log(base);
    }


} Main
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        HashMap<String,Integer> hash = new HashMap<>();
        int n =sc.nextInt();
        for (int i=0;i<n;i++){
            String s = sc.next();
            if (hash.containsKey(s)){
                hash.put(s,hash.get(s)+1);
            }else {
                hash.put(s,1);
            }
        }
        int max = Collections.max(hash.values());
        ArrayList<String> st  = new ArrayList<>();
        for (Map.Entry entry : hash.entrySet()){
            if ((int)entry.getValue()==max)st.add((String) entry.getKey());
        }
        Collections.sort(st);
        for (int i=0;i<st.size();i++)System.out.println(st.get(i));
    }
    static int factorial(int num){
        if (num==1||num==0)return 1;
        else return num*factorial(num-1);
    }
    static int arraySum(int[] array){
        int ans = 0;
        for (int value : array) ans += value;
        return ans;
    }
    static int combination(int a, int b){
        return factorial(a)/(factorial(b)*factorial(a-b));
    }
    static double log(double base,double antilogarithm){
        return Math.log(antilogarithm)/Math.log(base);
    }


}
