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();

        Map<String, Integer> wordmap = new TreeMap<>();
        int max = 0;
        for (int i=0;i<N;i++) {
            String S_n = sc.next();
            if (wordmap.containsKey(S_n)) {
                int count = wordmap.get(S_n);
                wordmap.put(S_n, count + 1);
                if (max <= count) max = count + 1;
            } else {
                wordmap.put(S_n, 1);
                if (max == 0) max = 1;
            }
        }

        for (String key : wordmap.keySet()) {
            if (wordmap.get(key) == 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();

        Map<String, Integer> wordmap = new TreeMap<>();
        int max = 0;
        for (int i=0;i<N;i++) {
            String S_n = sc.next();
            if (wordmap.containsKey(S_n)) {
                int count = wordmap.get(S_n);
                wordmap.put(S_n, count + 1);
                if (max <= count) max = count + 1;
            } else {
                wordmap.put(S_n, 1);
                if (max == 0) max = 1;
            }
        }

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

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

        Map<String, Integer> wordmap = new TreeMap<>();
        int max = 0;
        for (int i=0;i<N;i++) {
            String S_n = sc.next();
            if (wordmap.containsKey(S_n)) {
                int count = wordmap.get(S_n);
                wordmap.put(S_n, count + 1);
                if (max <= count) max = count + 1;
            } else {
                wordmap.put(S_n, 1);
                if (max == 0) max = 1;
            }
        }

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

    } main {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();

        Map<String, Integer> wordmap = new TreeMap<>();
        int max = 0;
        for (int i=0;i<N;i++) {
            String S_n = sc.next();
            if (wordmap.containsKey(S_n)) {
                int count = wordmap.get(S_n);
                wordmap.put(S_n, count + 1);
                if (max <= count) max = count + 1;
            } else {
                wordmap.put(S_n, 1);
                if (max == 0) max = 1;
            }
        }

        for (String key : wordmap.keySet()) {
            if (wordmap.get(key) == 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 Map<String, Integer> wordmap = new TreeMap<>(); wordmap new TreeMap<>() int max = 0; max 0 for (int i=0;i<N;i++) {
            String S_n = sc.next();
            if (wordmap.containsKey(S_n)) {
                int count = wordmap.get(S_n);
                wordmap.put(S_n, count + 1);
                if (max <= count) max = count + 1;
            } else {
                wordmap.put(S_n, 1);
                if (max == 0) max = 1;
            }
        } int i=0; int i=0; i 0 i<N i N i++ i++ i {
            String S_n = sc.next();
            if (wordmap.containsKey(S_n)) {
                int count = wordmap.get(S_n);
                wordmap.put(S_n, count + 1);
                if (max <= count) max = count + 1;
            } else {
                wordmap.put(S_n, 1);
                if (max == 0) max = 1;
            }
        } {
            String S_n = sc.next();
            if (wordmap.containsKey(S_n)) {
                int count = wordmap.get(S_n);
                wordmap.put(S_n, count + 1);
                if (max <= count) max = count + 1;
            } else {
                wordmap.put(S_n, 1);
                if (max == 0) max = 1;
            }
        } String S_n = sc.next(); S_n sc.next() sc.next sc if (wordmap.containsKey(S_n)) {
                int count = wordmap.get(S_n);
                wordmap.put(S_n, count + 1);
                if (max <= count) max = count + 1;
            } else {
                wordmap.put(S_n, 1);
                if (max == 0) max = 1;
            } wordmap.containsKey(S_n) wordmap.containsKey wordmap S_n {
                int count = wordmap.get(S_n);
                wordmap.put(S_n, count + 1);
                if (max <= count) max = count + 1;
            } int count = wordmap.get(S_n); count wordmap.get(S_n) wordmap.get wordmap S_n wordmap.put(S_n, count + 1) wordmap.put wordmap S_n count + 1 count 1 if (max <= count) max = count + 1; max <= count max count max = count + 1 max count + 1 count 1 {
                wordmap.put(S_n, 1);
                if (max == 0) max = 1;
            } wordmap.put(S_n, 1) wordmap.put wordmap S_n 1 if (max == 0) max = 1; max == 0 max 0 max = 1 max 1 for (String key : wordmap.keySet()) {
            if (wordmap.get(key) == max) System.out.println(key);
        } String key wordmap.keySet() wordmap.keySet wordmap {
            if (wordmap.get(key) == max) System.out.println(key);
        } {
            if (wordmap.get(key) == max) System.out.println(key);
        } if (wordmap.get(key) == max) System.out.println(key); wordmap.get(key) == max wordmap.get(key) wordmap.get wordmap key 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();

        Map<String, Integer> wordmap = new TreeMap<>();
        int max = 0;
        for (int i=0;i<N;i++) {
            String S_n = sc.next();
            if (wordmap.containsKey(S_n)) {
                int count = wordmap.get(S_n);
                wordmap.put(S_n, count + 1);
                if (max <= count) max = count + 1;
            } else {
                wordmap.put(S_n, 1);
                if (max == 0) max = 1;
            }
        }

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

    }
} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();

        Map<String, Integer> wordmap = new TreeMap<>();
        int max = 0;
        for (int i=0;i<N;i++) {
            String S_n = sc.next();
            if (wordmap.containsKey(S_n)) {
                int count = wordmap.get(S_n);
                wordmap.put(S_n, count + 1);
                if (max <= count) max = count + 1;
            } else {
                wordmap.put(S_n, 1);
                if (max == 0) max = 1;
            }
        }

        for (String key : wordmap.keySet()) {
            if (wordmap.get(key) == 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();

        Map<String, Integer> wordmap = new TreeMap<>();
        int max = 0;
        for (int i=0;i<N;i++) {
            String S_n = sc.next();
            if (wordmap.containsKey(S_n)) {
                int count = wordmap.get(S_n);
                wordmap.put(S_n, count + 1);
                if (max <= count) max = count + 1;
            } else {
                wordmap.put(S_n, 1);
                if (max == 0) max = 1;
            }
        }

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

    }
}