import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        String[] array = new String[n];

        for (int i = 0; i < n; i++) {
            array[i] = sc.next();
        }

        HashMap <String, Integer> map = new HashMap<>();

        for (int i = 0; i < n; i++) {
            if (map.containsKey(array[i])){
                int value = map.get(array[i]);
                map.put(array[i], value + 1);
            } else {
                map.put(array[i], 1);
            }
        }

        int max = Collections.max(map.values());

        List<String> list = new ArrayList<String>();

        for (String key : map.keySet()) {
            if (map.get(key) == max){
                list.add(key);
            }
        }

        Collections.sort(list);

        for (int i = 0; i < list.size(); i++) {
            System.out.println(list.get(i));
        }
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        String[] array = new String[n];

        for (int i = 0; i < n; i++) {
            array[i] = sc.next();
        }

        HashMap <String, Integer> map = new HashMap<>();

        for (int i = 0; i < n; i++) {
            if (map.containsKey(array[i])){
                int value = map.get(array[i]);
                map.put(array[i], value + 1);
            } else {
                map.put(array[i], 1);
            }
        }

        int max = Collections.max(map.values());

        List<String> list = new ArrayList<String>();

        for (String key : map.keySet()) {
            if (map.get(key) == max){
                list.add(key);
            }
        }

        Collections.sort(list);

        for (int i = 0; i < list.size(); i++) {
            System.out.println(list.get(i));
        }
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        String[] array = new String[n];

        for (int i = 0; i < n; i++) {
            array[i] = sc.next();
        }

        HashMap <String, Integer> map = new HashMap<>();

        for (int i = 0; i < n; i++) {
            if (map.containsKey(array[i])){
                int value = map.get(array[i]);
                map.put(array[i], value + 1);
            } else {
                map.put(array[i], 1);
            }
        }

        int max = Collections.max(map.values());

        List<String> list = new ArrayList<String>();

        for (String key : map.keySet()) {
            if (map.get(key) == max){
                list.add(key);
            }
        }

        Collections.sort(list);

        for (int i = 0; i < list.size(); i++) {
            System.out.println(list.get(i));
        }
    } main {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        String[] array = new String[n];

        for (int i = 0; i < n; i++) {
            array[i] = sc.next();
        }

        HashMap <String, Integer> map = new HashMap<>();

        for (int i = 0; i < n; i++) {
            if (map.containsKey(array[i])){
                int value = map.get(array[i]);
                map.put(array[i], value + 1);
            } else {
                map.put(array[i], 1);
            }
        }

        int max = Collections.max(map.values());

        List<String> list = new ArrayList<String>();

        for (String key : map.keySet()) {
            if (map.get(key) == max){
                list.add(key);
            }
        }

        Collections.sort(list);

        for (int i = 0; i < list.size(); i++) {
            System.out.println(list.get(i));
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc String[] array = new String[n]; array new String[n] n for (int i = 0; i < n; i++) {
            array[i] = sc.next();
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            array[i] = sc.next();
        } {
            array[i] = sc.next();
        } array[i] = sc.next() array[i] array i sc.next() sc.next sc HashMap <String, Integer> map = new HashMap<>(); map new HashMap<>() for (int i = 0; i < n; i++) {
            if (map.containsKey(array[i])){
                int value = map.get(array[i]);
                map.put(array[i], value + 1);
            } else {
                map.put(array[i], 1);
            }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            if (map.containsKey(array[i])){
                int value = map.get(array[i]);
                map.put(array[i], value + 1);
            } else {
                map.put(array[i], 1);
            }
        } {
            if (map.containsKey(array[i])){
                int value = map.get(array[i]);
                map.put(array[i], value + 1);
            } else {
                map.put(array[i], 1);
            }
        } if (map.containsKey(array[i])){
                int value = map.get(array[i]);
                map.put(array[i], value + 1);
            } else {
                map.put(array[i], 1);
            } map.containsKey(array[i]) map.containsKey map array[i] array i {
                int value = map.get(array[i]);
                map.put(array[i], value + 1);
            } int value = map.get(array[i]); value map.get(array[i]) map.get map array[i] array i map.put(array[i], value + 1) map.put map array[i] array i value + 1 value 1 {
                map.put(array[i], 1);
            } map.put(array[i], 1) map.put map array[i] array i 1 int max = Collections.max(map.values()); max Collections.max(map.values()) Collections.max Collections map.values() map.values map List<String> list = new ArrayList<String>(); list new ArrayList<String>() for (String key : map.keySet()) {
            if (map.get(key) == max){
                list.add(key);
            }
        } String key map.keySet() map.keySet map {
            if (map.get(key) == max){
                list.add(key);
            }
        } {
            if (map.get(key) == max){
                list.add(key);
            }
        } if (map.get(key) == max){
                list.add(key);
            } map.get(key) == max map.get(key) map.get map key max {
                list.add(key);
            } list.add(key) list.add list key Collections.sort(list) Collections.sort Collections list for (int i = 0; i < list.size(); i++) {
            System.out.println(list.get(i));
        } int i = 0; int i = 0; i 0 i < list.size() i list.size() list.size list i++ i++ i {
            System.out.println(list.get(i));
        } {
            System.out.println(list.get(i));
        } System.out.println(list.get(i)) System.out.println System.out System System.out list.get(i) list.get list i String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        String[] array = new String[n];

        for (int i = 0; i < n; i++) {
            array[i] = sc.next();
        }

        HashMap <String, Integer> map = new HashMap<>();

        for (int i = 0; i < n; i++) {
            if (map.containsKey(array[i])){
                int value = map.get(array[i]);
                map.put(array[i], value + 1);
            } else {
                map.put(array[i], 1);
            }
        }

        int max = Collections.max(map.values());

        List<String> list = new ArrayList<String>();

        for (String key : map.keySet()) {
            if (map.get(key) == max){
                list.add(key);
            }
        }

        Collections.sort(list);

        for (int i = 0; i < list.size(); i++) {
            System.out.println(list.get(i));
        }
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        String[] array = new String[n];

        for (int i = 0; i < n; i++) {
            array[i] = sc.next();
        }

        HashMap <String, Integer> map = new HashMap<>();

        for (int i = 0; i < n; i++) {
            if (map.containsKey(array[i])){
                int value = map.get(array[i]);
                map.put(array[i], value + 1);
            } else {
                map.put(array[i], 1);
            }
        }

        int max = Collections.max(map.values());

        List<String> list = new ArrayList<String>();

        for (String key : map.keySet()) {
            if (map.get(key) == max){
                list.add(key);
            }
        }

        Collections.sort(list);

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

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        String[] array = new String[n];

        for (int i = 0; i < n; i++) {
            array[i] = sc.next();
        }

        HashMap <String, Integer> map = new HashMap<>();

        for (int i = 0; i < n; i++) {
            if (map.containsKey(array[i])){
                int value = map.get(array[i]);
                map.put(array[i], value + 1);
            } else {
                map.put(array[i], 1);
            }
        }

        int max = Collections.max(map.values());

        List<String> list = new ArrayList<String>();

        for (String key : map.keySet()) {
            if (map.get(key) == max){
                list.add(key);
            }
        }

        Collections.sort(list);

        for (int i = 0; i < list.size(); i++) {
            System.out.println(list.get(i));
        }
    }
}
