import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        HashMap<String, Integer> map = new HashMap<>();
        for (int i = 0; i < n; i++) {
            String s = sc.next();
            if (map.containsKey(s)) {
                map.put(s, map.get(s) + 1);
            } else {
                map.put(s, 1);
            }
        }
        int max = 0;
        ArrayList<String> list = new ArrayList<>();
        for (Map.Entry<String, Integer> entry : map.entrySet()) {
            int x = entry.getValue();
            if (max < x) {
                list.clear();
                list.add(entry.getKey());
                max = x;
            } else if (max == x) {
                list.add(entry.getKey());
            }
        }
        Collections.sort(list);
        StringBuilder sb = new StringBuilder();
        for (String s : list) {
            sb.append(s).append("\n");
        }
        System.out.print(sb);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        HashMap<String, Integer> map = new HashMap<>();
        for (int i = 0; i < n; i++) {
            String s = sc.next();
            if (map.containsKey(s)) {
                map.put(s, map.get(s) + 1);
            } else {
                map.put(s, 1);
            }
        }
        int max = 0;
        ArrayList<String> list = new ArrayList<>();
        for (Map.Entry<String, Integer> entry : map.entrySet()) {
            int x = entry.getValue();
            if (max < x) {
                list.clear();
                list.add(entry.getKey());
                max = x;
            } else if (max == x) {
                list.add(entry.getKey());
            }
        }
        Collections.sort(list);
        StringBuilder sb = new StringBuilder();
        for (String s : list) {
            sb.append(s).append("\n");
        }
        System.out.print(sb);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        HashMap<String, Integer> map = new HashMap<>();
        for (int i = 0; i < n; i++) {
            String s = sc.next();
            if (map.containsKey(s)) {
                map.put(s, map.get(s) + 1);
            } else {
                map.put(s, 1);
            }
        }
        int max = 0;
        ArrayList<String> list = new ArrayList<>();
        for (Map.Entry<String, Integer> entry : map.entrySet()) {
            int x = entry.getValue();
            if (max < x) {
                list.clear();
                list.add(entry.getKey());
                max = x;
            } else if (max == x) {
                list.add(entry.getKey());
            }
        }
        Collections.sort(list);
        StringBuilder sb = new StringBuilder();
        for (String s : list) {
            sb.append(s).append("\n");
        }
        System.out.print(sb);
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        HashMap<String, Integer> map = new HashMap<>();
        for (int i = 0; i < n; i++) {
            String s = sc.next();
            if (map.containsKey(s)) {
                map.put(s, map.get(s) + 1);
            } else {
                map.put(s, 1);
            }
        }
        int max = 0;
        ArrayList<String> list = new ArrayList<>();
        for (Map.Entry<String, Integer> entry : map.entrySet()) {
            int x = entry.getValue();
            if (max < x) {
                list.clear();
                list.add(entry.getKey());
                max = x;
            } else if (max == x) {
                list.add(entry.getKey());
            }
        }
        Collections.sort(list);
        StringBuilder sb = new StringBuilder();
        for (String s : list) {
            sb.append(s).append("\n");
        }
        System.out.print(sb);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc HashMap<String, Integer> map = new HashMap<>(); map new HashMap<>() for (int i = 0; i < n; i++) {
            String s = sc.next();
            if (map.containsKey(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.containsKey(s)) {
                map.put(s, map.get(s) + 1);
            } else {
                map.put(s, 1);
            }
        } {
            String s = sc.next();
            if (map.containsKey(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.containsKey(s)) {
                map.put(s, map.get(s) + 1);
            } else {
                map.put(s, 1);
            } map.containsKey(s) map.containsKey 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 ArrayList<String> list = new ArrayList<>(); list new ArrayList<>() for (Map.Entry<String, Integer> entry : map.entrySet()) {
            int x = entry.getValue();
            if (max < x) {
                list.clear();
                list.add(entry.getKey());
                max = x;
            } else if (max == x) {
                list.add(entry.getKey());
            }
        } Map.Entry<String, Integer> entry map.entrySet() map.entrySet map {
            int x = entry.getValue();
            if (max < x) {
                list.clear();
                list.add(entry.getKey());
                max = x;
            } else if (max == x) {
                list.add(entry.getKey());
            }
        } {
            int x = entry.getValue();
            if (max < x) {
                list.clear();
                list.add(entry.getKey());
                max = x;
            } else if (max == x) {
                list.add(entry.getKey());
            }
        } int x = entry.getValue(); x entry.getValue() entry.getValue entry if (max < x) {
                list.clear();
                list.add(entry.getKey());
                max = x;
            } else if (max == x) {
                list.add(entry.getKey());
            } max < x max x {
                list.clear();
                list.add(entry.getKey());
                max = x;
            } list.clear() list.clear list list.add(entry.getKey()) list.add list entry.getKey() entry.getKey entry max = x max x if (max == x) {
                list.add(entry.getKey());
            } max == x max x {
                list.add(entry.getKey());
            } list.add(entry.getKey()) list.add list entry.getKey() entry.getKey entry Collections.sort(list) Collections.sort Collections list StringBuilder sb = new StringBuilder(); sb new StringBuilder() for (String s : list) {
            sb.append(s).append("\n");
        } String s list {
            sb.append(s).append("\n");
        } {
            sb.append(s).append("\n");
        } sb.append(s).append("\n") sb.append(s).append sb.append(s) sb.append sb s "\n" System.out.print(sb) System.out.print System.out System System.out sb String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        HashMap<String, Integer> map = new HashMap<>();
        for (int i = 0; i < n; i++) {
            String s = sc.next();
            if (map.containsKey(s)) {
                map.put(s, map.get(s) + 1);
            } else {
                map.put(s, 1);
            }
        }
        int max = 0;
        ArrayList<String> list = new ArrayList<>();
        for (Map.Entry<String, Integer> entry : map.entrySet()) {
            int x = entry.getValue();
            if (max < x) {
                list.clear();
                list.add(entry.getKey());
                max = x;
            } else if (max == x) {
                list.add(entry.getKey());
            }
        }
        Collections.sort(list);
        StringBuilder sb = new StringBuilder();
        for (String s : list) {
            sb.append(s).append("\n");
        }
        System.out.print(sb);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        HashMap<String, Integer> map = new HashMap<>();
        for (int i = 0; i < n; i++) {
            String s = sc.next();
            if (map.containsKey(s)) {
                map.put(s, map.get(s) + 1);
            } else {
                map.put(s, 1);
            }
        }
        int max = 0;
        ArrayList<String> list = new ArrayList<>();
        for (Map.Entry<String, Integer> entry : map.entrySet()) {
            int x = entry.getValue();
            if (max < x) {
                list.clear();
                list.add(entry.getKey());
                max = x;
            } else if (max == x) {
                list.add(entry.getKey());
            }
        }
        Collections.sort(list);
        StringBuilder sb = new StringBuilder();
        for (String s : list) {
            sb.append(s).append("\n");
        }
        System.out.print(sb);
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        HashMap<String, Integer> map = new HashMap<>();
        for (int i = 0; i < n; i++) {
            String s = sc.next();
            if (map.containsKey(s)) {
                map.put(s, map.get(s) + 1);
            } else {
                map.put(s, 1);
            }
        }
        int max = 0;
        ArrayList<String> list = new ArrayList<>();
        for (Map.Entry<String, Integer> entry : map.entrySet()) {
            int x = entry.getValue();
            if (max < x) {
                list.clear();
                list.add(entry.getKey());
                max = x;
            } else if (max == x) {
                list.add(entry.getKey());
            }
        }
        Collections.sort(list);
        StringBuilder sb = new StringBuilder();
        for (String s : list) {
            sb.append(s).append("\n");
        }
        System.out.print(sb);
    }
}