import java.util.*;

public class Main {
    public static void main(String[] args) {
        HashMap<String, Integer> si = new HashMap<String, Integer>();

        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        sc.nextLine();

        for (int i = 0; i < N; i++) {
            String s;
            s = sc.next();
            si.put(s,si.getOrDefault(s,0)+1);
        }


        Iterator it = si.entrySet().iterator();
        ArrayList arr = new ArrayList();
        int currentMax = 0;

        while(it.hasNext()) {
            Map.Entry<String,Integer> set = (Map.Entry<String, Integer>) it.next();

            if (set.getValue()>currentMax) {
                arr.clear();
                arr.add(set.getKey());
                currentMax = set.getValue();
            }

            else if (set.getValue()==currentMax) {
                arr.add(set.getKey());
            }

            else {
            }
        }
        Collections.sort(arr);
        for (int i = 0; i < arr.size(); i++) {
            System.out.println(arr.get(i));
        }
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        HashMap<String, Integer> si = new HashMap<String, Integer>();

        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        sc.nextLine();

        for (int i = 0; i < N; i++) {
            String s;
            s = sc.next();
            si.put(s,si.getOrDefault(s,0)+1);
        }


        Iterator it = si.entrySet().iterator();
        ArrayList arr = new ArrayList();
        int currentMax = 0;

        while(it.hasNext()) {
            Map.Entry<String,Integer> set = (Map.Entry<String, Integer>) it.next();

            if (set.getValue()>currentMax) {
                arr.clear();
                arr.add(set.getKey());
                currentMax = set.getValue();
            }

            else if (set.getValue()==currentMax) {
                arr.add(set.getKey());
            }

            else {
            }
        }
        Collections.sort(arr);
        for (int i = 0; i < arr.size(); i++) {
            System.out.println(arr.get(i));
        }
    }
} Main public static void main(String[] args) {
        HashMap<String, Integer> si = new HashMap<String, Integer>();

        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        sc.nextLine();

        for (int i = 0; i < N; i++) {
            String s;
            s = sc.next();
            si.put(s,si.getOrDefault(s,0)+1);
        }


        Iterator it = si.entrySet().iterator();
        ArrayList arr = new ArrayList();
        int currentMax = 0;

        while(it.hasNext()) {
            Map.Entry<String,Integer> set = (Map.Entry<String, Integer>) it.next();

            if (set.getValue()>currentMax) {
                arr.clear();
                arr.add(set.getKey());
                currentMax = set.getValue();
            }

            else if (set.getValue()==currentMax) {
                arr.add(set.getKey());
            }

            else {
            }
        }
        Collections.sort(arr);
        for (int i = 0; i < arr.size(); i++) {
            System.out.println(arr.get(i));
        }
    } main {
        HashMap<String, Integer> si = new HashMap<String, Integer>();

        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        sc.nextLine();

        for (int i = 0; i < N; i++) {
            String s;
            s = sc.next();
            si.put(s,si.getOrDefault(s,0)+1);
        }


        Iterator it = si.entrySet().iterator();
        ArrayList arr = new ArrayList();
        int currentMax = 0;

        while(it.hasNext()) {
            Map.Entry<String,Integer> set = (Map.Entry<String, Integer>) it.next();

            if (set.getValue()>currentMax) {
                arr.clear();
                arr.add(set.getKey());
                currentMax = set.getValue();
            }

            else if (set.getValue()==currentMax) {
                arr.add(set.getKey());
            }

            else {
            }
        }
        Collections.sort(arr);
        for (int i = 0; i < arr.size(); i++) {
            System.out.println(arr.get(i));
        }
    } HashMap<String, Integer> si = new HashMap<String, Integer>(); si new HashMap<String, Integer>() Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc sc.nextLine() sc.nextLine sc for (int i = 0; i < N; i++) {
            String s;
            s = sc.next();
            si.put(s,si.getOrDefault(s,0)+1);
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            String s;
            s = sc.next();
            si.put(s,si.getOrDefault(s,0)+1);
        } {
            String s;
            s = sc.next();
            si.put(s,si.getOrDefault(s,0)+1);
        } String s; s s = sc.next() s sc.next() sc.next sc si.put(s,si.getOrDefault(s,0)+1) si.put si s si.getOrDefault(s,0)+1 si.getOrDefault(s,0) si.getOrDefault si s 0 1 Iterator it = si.entrySet().iterator(); it si.entrySet().iterator() si.entrySet().iterator si.entrySet() si.entrySet si ArrayList arr = new ArrayList(); arr new ArrayList() int currentMax = 0; currentMax 0 while(it.hasNext()) {
            Map.Entry<String,Integer> set = (Map.Entry<String, Integer>) it.next();

            if (set.getValue()>currentMax) {
                arr.clear();
                arr.add(set.getKey());
                currentMax = set.getValue();
            }

            else if (set.getValue()==currentMax) {
                arr.add(set.getKey());
            }

            else {
            }
        } it.hasNext() it.hasNext it {
            Map.Entry<String,Integer> set = (Map.Entry<String, Integer>) it.next();

            if (set.getValue()>currentMax) {
                arr.clear();
                arr.add(set.getKey());
                currentMax = set.getValue();
            }

            else if (set.getValue()==currentMax) {
                arr.add(set.getKey());
            }

            else {
            }
        } Map.Entry<String,Integer> set = (Map.Entry<String, Integer>) it.next(); set (Map.Entry<String, Integer>) it.next() it.next it if (set.getValue()>currentMax) {
                arr.clear();
                arr.add(set.getKey());
                currentMax = set.getValue();
            }

            else if (set.getValue()==currentMax) {
                arr.add(set.getKey());
            }

            else {
            } set.getValue()>currentMax set.getValue() set.getValue set currentMax {
                arr.clear();
                arr.add(set.getKey());
                currentMax = set.getValue();
            } arr.clear() arr.clear arr arr.add(set.getKey()) arr.add arr set.getKey() set.getKey set currentMax = set.getValue() currentMax set.getValue() set.getValue set if (set.getValue()==currentMax) {
                arr.add(set.getKey());
            }

            else {
            } set.getValue()==currentMax set.getValue() set.getValue set currentMax {
                arr.add(set.getKey());
            } arr.add(set.getKey()) arr.add arr set.getKey() set.getKey set {
            } Collections.sort(arr) Collections.sort Collections arr for (int i = 0; i < arr.size(); i++) {
            System.out.println(arr.get(i));
        } int i = 0; int i = 0; i 0 i < arr.size() i arr.size() arr.size arr i++ i++ i {
            System.out.println(arr.get(i));
        } {
            System.out.println(arr.get(i));
        } System.out.println(arr.get(i)) System.out.println System.out System System.out arr.get(i) arr.get arr i String[] args args public class Main {
    public static void main(String[] args) {
        HashMap<String, Integer> si = new HashMap<String, Integer>();

        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        sc.nextLine();

        for (int i = 0; i < N; i++) {
            String s;
            s = sc.next();
            si.put(s,si.getOrDefault(s,0)+1);
        }


        Iterator it = si.entrySet().iterator();
        ArrayList arr = new ArrayList();
        int currentMax = 0;

        while(it.hasNext()) {
            Map.Entry<String,Integer> set = (Map.Entry<String, Integer>) it.next();

            if (set.getValue()>currentMax) {
                arr.clear();
                arr.add(set.getKey());
                currentMax = set.getValue();
            }

            else if (set.getValue()==currentMax) {
                arr.add(set.getKey());
            }

            else {
            }
        }
        Collections.sort(arr);
        for (int i = 0; i < arr.size(); i++) {
            System.out.println(arr.get(i));
        }
    }
} public class Main {
    public static void main(String[] args) {
        HashMap<String, Integer> si = new HashMap<String, Integer>();

        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        sc.nextLine();

        for (int i = 0; i < N; i++) {
            String s;
            s = sc.next();
            si.put(s,si.getOrDefault(s,0)+1);
        }


        Iterator it = si.entrySet().iterator();
        ArrayList arr = new ArrayList();
        int currentMax = 0;

        while(it.hasNext()) {
            Map.Entry<String,Integer> set = (Map.Entry<String, Integer>) it.next();

            if (set.getValue()>currentMax) {
                arr.clear();
                arr.add(set.getKey());
                currentMax = set.getValue();
            }

            else if (set.getValue()==currentMax) {
                arr.add(set.getKey());
            }

            else {
            }
        }
        Collections.sort(arr);
        for (int i = 0; i < arr.size(); i++) {
            System.out.println(arr.get(i));
        }
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) {
        HashMap<String, Integer> si = new HashMap<String, Integer>();

        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        sc.nextLine();

        for (int i = 0; i < N; i++) {
            String s;
            s = sc.next();
            si.put(s,si.getOrDefault(s,0)+1);
        }


        Iterator it = si.entrySet().iterator();
        ArrayList arr = new ArrayList();
        int currentMax = 0;

        while(it.hasNext()) {
            Map.Entry<String,Integer> set = (Map.Entry<String, Integer>) it.next();

            if (set.getValue()>currentMax) {
                arr.clear();
                arr.add(set.getKey());
                currentMax = set.getValue();
            }

            else if (set.getValue()==currentMax) {
                arr.add(set.getKey());
            }

            else {
            }
        }
        Collections.sort(arr);
        for (int i = 0; i < arr.size(); i++) {
            System.out.println(arr.get(i));
        }
    }
}
