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

class Main {
    public static void main(String[] args) {
        Scanner stdIn = new Scanner(System.in);
        TreeMap<String, Integer> tm = new TreeMap<String, Integer>();
        int n = Integer.parseInt(stdIn.next());
        String s;
        for (int i = 0; i < n; i++) {
            s = stdIn.next();
            int count = 1;
            if (tm.containsKey(s)) {
                count += tm.get(s);
            }
            tm.put(s, count);
        }

        int maxValue = 0;
        for (int value : tm.values()) {
            if (value > maxValue) {
                maxValue = value;
            }
        }

        for (String key : tm.keySet()) {
            if (tm.get(key) == maxValue) {
                System.out.println(key);
            }
        }
    }
} import java.util.TreeMap; TreeMap java.util import java.util.Scanner; Scanner java.util class Main {
    public static void main(String[] args) {
        Scanner stdIn = new Scanner(System.in);
        TreeMap<String, Integer> tm = new TreeMap<String, Integer>();
        int n = Integer.parseInt(stdIn.next());
        String s;
        for (int i = 0; i < n; i++) {
            s = stdIn.next();
            int count = 1;
            if (tm.containsKey(s)) {
                count += tm.get(s);
            }
            tm.put(s, count);
        }

        int maxValue = 0;
        for (int value : tm.values()) {
            if (value > maxValue) {
                maxValue = value;
            }
        }

        for (String key : tm.keySet()) {
            if (tm.get(key) == maxValue) {
                System.out.println(key);
            }
        }
    }
} Main public static void main(String[] args) {
        Scanner stdIn = new Scanner(System.in);
        TreeMap<String, Integer> tm = new TreeMap<String, Integer>();
        int n = Integer.parseInt(stdIn.next());
        String s;
        for (int i = 0; i < n; i++) {
            s = stdIn.next();
            int count = 1;
            if (tm.containsKey(s)) {
                count += tm.get(s);
            }
            tm.put(s, count);
        }

        int maxValue = 0;
        for (int value : tm.values()) {
            if (value > maxValue) {
                maxValue = value;
            }
        }

        for (String key : tm.keySet()) {
            if (tm.get(key) == maxValue) {
                System.out.println(key);
            }
        }
    } main {
        Scanner stdIn = new Scanner(System.in);
        TreeMap<String, Integer> tm = new TreeMap<String, Integer>();
        int n = Integer.parseInt(stdIn.next());
        String s;
        for (int i = 0; i < n; i++) {
            s = stdIn.next();
            int count = 1;
            if (tm.containsKey(s)) {
                count += tm.get(s);
            }
            tm.put(s, count);
        }

        int maxValue = 0;
        for (int value : tm.values()) {
            if (value > maxValue) {
                maxValue = value;
            }
        }

        for (String key : tm.keySet()) {
            if (tm.get(key) == maxValue) {
                System.out.println(key);
            }
        }
    } Scanner stdIn = new Scanner(System.in); stdIn new Scanner(System.in) TreeMap<String, Integer> tm = new TreeMap<String, Integer>(); tm new TreeMap<String, Integer>() int n = Integer.parseInt(stdIn.next()); n Integer.parseInt(stdIn.next()) Integer.parseInt Integer stdIn.next() stdIn.next stdIn String s; s for (int i = 0; i < n; i++) {
            s = stdIn.next();
            int count = 1;
            if (tm.containsKey(s)) {
                count += tm.get(s);
            }
            tm.put(s, count);
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            s = stdIn.next();
            int count = 1;
            if (tm.containsKey(s)) {
                count += tm.get(s);
            }
            tm.put(s, count);
        } {
            s = stdIn.next();
            int count = 1;
            if (tm.containsKey(s)) {
                count += tm.get(s);
            }
            tm.put(s, count);
        } s = stdIn.next() s stdIn.next() stdIn.next stdIn int count = 1; count 1 if (tm.containsKey(s)) {
                count += tm.get(s);
            } tm.containsKey(s) tm.containsKey tm s {
                count += tm.get(s);
            } count += tm.get(s) count tm.get(s) tm.get tm s tm.put(s, count) tm.put tm s count int maxValue = 0; maxValue 0 for (int value : tm.values()) {
            if (value > maxValue) {
                maxValue = value;
            }
        } int value tm.values() tm.values tm {
            if (value > maxValue) {
                maxValue = value;
            }
        } {
            if (value > maxValue) {
                maxValue = value;
            }
        } if (value > maxValue) {
                maxValue = value;
            } value > maxValue value maxValue {
                maxValue = value;
            } maxValue = value maxValue value for (String key : tm.keySet()) {
            if (tm.get(key) == maxValue) {
                System.out.println(key);
            }
        } String key tm.keySet() tm.keySet tm {
            if (tm.get(key) == maxValue) {
                System.out.println(key);
            }
        } {
            if (tm.get(key) == maxValue) {
                System.out.println(key);
            }
        } if (tm.get(key) == maxValue) {
                System.out.println(key);
            } tm.get(key) == maxValue tm.get(key) tm.get tm key maxValue {
                System.out.println(key);
            } System.out.println(key) System.out.println System.out System System.out key String[] args args
import java.util.TreeMap;
import java.util.Scanner;

class Main {
    public static void main(String[] args) {
        Scanner stdIn = new Scanner(System.in);
        TreeMap<String, Integer> tm = new TreeMap<String, Integer>();
        int n = Integer.parseInt(stdIn.next());
        String s;
        for (int i = 0; i < n; i++) {
            s = stdIn.next();
            int count = 1;
            if (tm.containsKey(s)) {
                count += tm.get(s);
            }
            tm.put(s, count);
        }

        int maxValue = 0;
        for (int value : tm.values()) {
            if (value > maxValue) {
                maxValue = value;
            }
        }

        for (String key : tm.keySet()) {
            if (tm.get(key) == maxValue) {
                System.out.println(key);
            }
        }
    }
}