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> map = new HashMap<>();
        for (int i = 0; i < n; i++) {
            String s = sc.next();
            if (map.keySet().contains(s)) {
                map.put(s, map.get(s) + 1);
            } else {
                map.put(s, 1);
            }
        }
        int max = 0;
        for (Map.Entry<String, Integer> entry : map.entrySet()) {
            max = Math.max(max, entry.getValue());
        }
        Map<String, Integer> sorted = new TreeMap<>(map);
        for (Map.Entry<String, Integer> entry : sorted.entrySet()) {
            if (entry.getValue() != max) {
                continue;
            }
            System.out.println(entry.getKey());
        }
        sc.close();
    }
} 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> map = new HashMap<>();
        for (int i = 0; i < n; i++) {
            String s = sc.next();
            if (map.keySet().contains(s)) {
                map.put(s, map.get(s) + 1);
            } else {
                map.put(s, 1);
            }
        }
        int max = 0;
        for (Map.Entry<String, Integer> entry : map.entrySet()) {
            max = Math.max(max, entry.getValue());
        }
        Map<String, Integer> sorted = new TreeMap<>(map);
        for (Map.Entry<String, Integer> entry : sorted.entrySet()) {
            if (entry.getValue() != max) {
                continue;
            }
            System.out.println(entry.getKey());
        }
        sc.close();
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Map<String, Integer> map = new HashMap<>();
        for (int i = 0; i < n; i++) {
            String s = sc.next();
            if (map.keySet().contains(s)) {
                map.put(s, map.get(s) + 1);
            } else {
                map.put(s, 1);
            }
        }
        int max = 0;
        for (Map.Entry<String, Integer> entry : map.entrySet()) {
            max = Math.max(max, entry.getValue());
        }
        Map<String, Integer> sorted = new TreeMap<>(map);
        for (Map.Entry<String, Integer> entry : sorted.entrySet()) {
            if (entry.getValue() != max) {
                continue;
            }
            System.out.println(entry.getKey());
        }
        sc.close();
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Map<String, Integer> map = new HashMap<>();
        for (int i = 0; i < n; i++) {
            String s = sc.next();
            if (map.keySet().contains(s)) {
                map.put(s, map.get(s) + 1);
            } else {
                map.put(s, 1);
            }
        }
        int max = 0;
        for (Map.Entry<String, Integer> entry : map.entrySet()) {
            max = Math.max(max, entry.getValue());
        }
        Map<String, Integer> sorted = new TreeMap<>(map);
        for (Map.Entry<String, Integer> entry : sorted.entrySet()) {
            if (entry.getValue() != max) {
                continue;
            }
            System.out.println(entry.getKey());
        }
        sc.close();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc Map<String, Integer> map = new HashMap<>(); map new HashMap<>() for (int i = 0; i < n; i++) {
            String s = sc.next();
            if (map.keySet().contains(s)) {
                map.put(s, map.get(s) + 1);
            } else {
                map.put(s, 1);
            }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            String s = sc.next();
            if (map.keySet().contains(s)) {
                map.put(s, map.get(s) + 1);
            } else {
                map.put(s, 1);
            }
        } {
            String s = sc.next();
            if (map.keySet().contains(s)) {
                map.put(s, map.get(s) + 1);
            } else {
                map.put(s, 1);
            }
        } String s = sc.next(); s sc.next() sc.next sc if (map.keySet().contains(s)) {
                map.put(s, map.get(s) + 1);
            } else {
                map.put(s, 1);
            } map.keySet().contains(s) map.keySet().contains map.keySet() map.keySet map s {
                map.put(s, map.get(s) + 1);
            } map.put(s, map.get(s) + 1) map.put map s map.get(s) + 1 map.get(s) map.get map s 1 {
                map.put(s, 1);
            } map.put(s, 1) map.put map s 1 int max = 0; max 0 for (Map.Entry<String, Integer> entry : map.entrySet()) {
            max = Math.max(max, entry.getValue());
        } Map.Entry<String, Integer> entry map.entrySet() map.entrySet map {
            max = Math.max(max, entry.getValue());
        } {
            max = Math.max(max, entry.getValue());
        } max = Math.max(max, entry.getValue()) max Math.max(max, entry.getValue()) Math.max Math max entry.getValue() entry.getValue entry Map<String, Integer> sorted = new TreeMap<>(map); sorted new TreeMap<>(map) for (Map.Entry<String, Integer> entry : sorted.entrySet()) {
            if (entry.getValue() != max) {
                continue;
            }
            System.out.println(entry.getKey());
        } Map.Entry<String, Integer> entry sorted.entrySet() sorted.entrySet sorted {
            if (entry.getValue() != max) {
                continue;
            }
            System.out.println(entry.getKey());
        } {
            if (entry.getValue() != max) {
                continue;
            }
            System.out.println(entry.getKey());
        } if (entry.getValue() != max) {
                continue;
            } entry.getValue() != max entry.getValue() entry.getValue entry max {
                continue;
            } continue; System.out.println(entry.getKey()) System.out.println System.out System System.out entry.getKey() entry.getKey entry sc.close() sc.close sc 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> map = new HashMap<>();
        for (int i = 0; i < n; i++) {
            String s = sc.next();
            if (map.keySet().contains(s)) {
                map.put(s, map.get(s) + 1);
            } else {
                map.put(s, 1);
            }
        }
        int max = 0;
        for (Map.Entry<String, Integer> entry : map.entrySet()) {
            max = Math.max(max, entry.getValue());
        }
        Map<String, Integer> sorted = new TreeMap<>(map);
        for (Map.Entry<String, Integer> entry : sorted.entrySet()) {
            if (entry.getValue() != max) {
                continue;
            }
            System.out.println(entry.getKey());
        }
        sc.close();
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Map<String, Integer> map = new HashMap<>();
        for (int i = 0; i < n; i++) {
            String s = sc.next();
            if (map.keySet().contains(s)) {
                map.put(s, map.get(s) + 1);
            } else {
                map.put(s, 1);
            }
        }
        int max = 0;
        for (Map.Entry<String, Integer> entry : map.entrySet()) {
            max = Math.max(max, entry.getValue());
        }
        Map<String, Integer> sorted = new TreeMap<>(map);
        for (Map.Entry<String, Integer> entry : sorted.entrySet()) {
            if (entry.getValue() != max) {
                continue;
            }
            System.out.println(entry.getKey());
        }
        sc.close();
    }
} 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> map = new HashMap<>();
        for (int i = 0; i < n; i++) {
            String s = sc.next();
            if (map.keySet().contains(s)) {
                map.put(s, map.get(s) + 1);
            } else {
                map.put(s, 1);
            }
        }
        int max = 0;
        for (Map.Entry<String, Integer> entry : map.entrySet()) {
            max = Math.max(max, entry.getValue());
        }
        Map<String, Integer> sorted = new TreeMap<>(map);
        for (Map.Entry<String, Integer> entry : sorted.entrySet()) {
            if (entry.getValue() != max) {
                continue;
            }
            System.out.println(entry.getKey());
        }
        sc.close();
    }
}