import java.util.Map;
import java.util.Scanner;
import java.util.TreeMap;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        TreeMap<String, Integer> map = new TreeMap<>();
        int max = 0;
        for(int i = 0; i < N; i++) {
            String key = sc.next();
            if(map.containsKey(key)) {
                int val = map.get(key);
                map.put(key, ++val);
            } else {
                map.put(key, 1);
            }
            int val = map.get(key);
            max = Math.max(val, max);
        }
        for(Map.Entry<String, Integer> entry : map.entrySet()) {
            int val = entry.getValue();
            String key = entry.getKey();
            if(val == max) System.out.println(key);
        }
    }
} import java.util.Map; Map java.util import java.util.Scanner; Scanner java.util import java.util.TreeMap; TreeMap java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        TreeMap<String, Integer> map = new TreeMap<>();
        int max = 0;
        for(int i = 0; i < N; i++) {
            String key = sc.next();
            if(map.containsKey(key)) {
                int val = map.get(key);
                map.put(key, ++val);
            } else {
                map.put(key, 1);
            }
            int val = map.get(key);
            max = Math.max(val, max);
        }
        for(Map.Entry<String, Integer> entry : map.entrySet()) {
            int val = entry.getValue();
            String key = entry.getKey();
            if(val == max) System.out.println(key);
        }
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        TreeMap<String, Integer> map = new TreeMap<>();
        int max = 0;
        for(int i = 0; i < N; i++) {
            String key = sc.next();
            if(map.containsKey(key)) {
                int val = map.get(key);
                map.put(key, ++val);
            } else {
                map.put(key, 1);
            }
            int val = map.get(key);
            max = Math.max(val, max);
        }
        for(Map.Entry<String, Integer> entry : map.entrySet()) {
            int val = entry.getValue();
            String key = entry.getKey();
            if(val == max) System.out.println(key);
        }
    } main {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        TreeMap<String, Integer> map = new TreeMap<>();
        int max = 0;
        for(int i = 0; i < N; i++) {
            String key = sc.next();
            if(map.containsKey(key)) {
                int val = map.get(key);
                map.put(key, ++val);
            } else {
                map.put(key, 1);
            }
            int val = map.get(key);
            max = Math.max(val, max);
        }
        for(Map.Entry<String, Integer> entry : map.entrySet()) {
            int val = entry.getValue();
            String key = entry.getKey();
            if(val == max) System.out.println(key);
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc TreeMap<String, Integer> map = new TreeMap<>(); map new TreeMap<>() int max = 0; max 0 for(int i = 0; i < N; i++) {
            String key = sc.next();
            if(map.containsKey(key)) {
                int val = map.get(key);
                map.put(key, ++val);
            } else {
                map.put(key, 1);
            }
            int val = map.get(key);
            max = Math.max(val, max);
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            String key = sc.next();
            if(map.containsKey(key)) {
                int val = map.get(key);
                map.put(key, ++val);
            } else {
                map.put(key, 1);
            }
            int val = map.get(key);
            max = Math.max(val, max);
        } {
            String key = sc.next();
            if(map.containsKey(key)) {
                int val = map.get(key);
                map.put(key, ++val);
            } else {
                map.put(key, 1);
            }
            int val = map.get(key);
            max = Math.max(val, max);
        } String key = sc.next(); key sc.next() sc.next sc if(map.containsKey(key)) {
                int val = map.get(key);
                map.put(key, ++val);
            } else {
                map.put(key, 1);
            } map.containsKey(key) map.containsKey map key {
                int val = map.get(key);
                map.put(key, ++val);
            } int val = map.get(key); val map.get(key) map.get map key map.put(key, ++val) map.put map key ++val val {
                map.put(key, 1);
            } map.put(key, 1) map.put map key 1 int val = map.get(key); val map.get(key) map.get map key max = Math.max(val, max) max Math.max(val, max) Math.max Math val max for(Map.Entry<String, Integer> entry : map.entrySet()) {
            int val = entry.getValue();
            String key = entry.getKey();
            if(val == max) System.out.println(key);
        } Map.Entry<String, Integer> entry map.entrySet() map.entrySet map {
            int val = entry.getValue();
            String key = entry.getKey();
            if(val == max) System.out.println(key);
        } {
            int val = entry.getValue();
            String key = entry.getKey();
            if(val == max) System.out.println(key);
        } int val = entry.getValue(); val entry.getValue() entry.getValue entry String key = entry.getKey(); key entry.getKey() entry.getKey entry if(val == max) System.out.println(key); val == max val max System.out.println(key) System.out.println System.out System System.out key String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        TreeMap<String, Integer> map = new TreeMap<>();
        int max = 0;
        for(int i = 0; i < N; i++) {
            String key = sc.next();
            if(map.containsKey(key)) {
                int val = map.get(key);
                map.put(key, ++val);
            } else {
                map.put(key, 1);
            }
            int val = map.get(key);
            max = Math.max(val, max);
        }
        for(Map.Entry<String, Integer> entry : map.entrySet()) {
            int val = entry.getValue();
            String key = entry.getKey();
            if(val == max) System.out.println(key);
        }
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        TreeMap<String, Integer> map = new TreeMap<>();
        int max = 0;
        for(int i = 0; i < N; i++) {
            String key = sc.next();
            if(map.containsKey(key)) {
                int val = map.get(key);
                map.put(key, ++val);
            } else {
                map.put(key, 1);
            }
            int val = map.get(key);
            max = Math.max(val, max);
        }
        for(Map.Entry<String, Integer> entry : map.entrySet()) {
            int val = entry.getValue();
            String key = entry.getKey();
            if(val == max) System.out.println(key);
        }
    }
} Main
import java.util.Map;
import java.util.Scanner;
import java.util.TreeMap;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        TreeMap<String, Integer> map = new TreeMap<>();
        int max = 0;
        for(int i = 0; i < N; i++) {
            String key = sc.next();
            if(map.containsKey(key)) {
                int val = map.get(key);
                map.put(key, ++val);
            } else {
                map.put(key, 1);
            }
            int val = map.get(key);
            max = Math.max(val, max);
        }
        for(Map.Entry<String, Integer> entry : map.entrySet()) {
            int val = entry.getValue();
            String key = entry.getKey();
            if(val == max) System.out.println(key);
        }
    }
}
