import java.util.Arrays;
import java.util.HashMap;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        // ABC155C - Poll

        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();

        String[] s = new String[n];
        int max = 1;
        HashMap<String, Integer> map = new HashMap();
        for (int i = 0; i < n; i++) {
            s[i] = sc.next();
            if (map.containsKey(s[i])) {
                int v = map.get(s[i]) + 1;
                map.put(s[i], v);
                if (v > max) max = v;
            } else {
                map.put(s[i], 1);
            }
        }

        Arrays.sort(s);

        for (int i = 0; i < n; i++) {
            int v = map.get(s[i]);
            if (v == max) {
                System.out.println(s[i]);
            }
            i += (v - 1);
        }

    }
} import java.util.Arrays; Arrays java.util import java.util.HashMap; HashMap java.util import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
        // ABC155C - Poll

        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();

        String[] s = new String[n];
        int max = 1;
        HashMap<String, Integer> map = new HashMap();
        for (int i = 0; i < n; i++) {
            s[i] = sc.next();
            if (map.containsKey(s[i])) {
                int v = map.get(s[i]) + 1;
                map.put(s[i], v);
                if (v > max) max = v;
            } else {
                map.put(s[i], 1);
            }
        }

        Arrays.sort(s);

        for (int i = 0; i < n; i++) {
            int v = map.get(s[i]);
            if (v == max) {
                System.out.println(s[i]);
            }
            i += (v - 1);
        }

    }
} Main public static void main(String[] args) {
        // ABC155C - Poll

        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();

        String[] s = new String[n];
        int max = 1;
        HashMap<String, Integer> map = new HashMap();
        for (int i = 0; i < n; i++) {
            s[i] = sc.next();
            if (map.containsKey(s[i])) {
                int v = map.get(s[i]) + 1;
                map.put(s[i], v);
                if (v > max) max = v;
            } else {
                map.put(s[i], 1);
            }
        }

        Arrays.sort(s);

        for (int i = 0; i < n; i++) {
            int v = map.get(s[i]);
            if (v == max) {
                System.out.println(s[i]);
            }
            i += (v - 1);
        }

    } main {
        // ABC155C - Poll

        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();

        String[] s = new String[n];
        int max = 1;
        HashMap<String, Integer> map = new HashMap();
        for (int i = 0; i < n; i++) {
            s[i] = sc.next();
            if (map.containsKey(s[i])) {
                int v = map.get(s[i]) + 1;
                map.put(s[i], v);
                if (v > max) max = v;
            } else {
                map.put(s[i], 1);
            }
        }

        Arrays.sort(s);

        for (int i = 0; i < n; i++) {
            int v = map.get(s[i]);
            if (v == max) {
                System.out.println(s[i]);
            }
            i += (v - 1);
        }

    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc String[] s = new String[n]; s new String[n] n int max = 1; max 1 HashMap<String, Integer> map = new HashMap(); map new HashMap() for (int i = 0; i < n; i++) {
            s[i] = sc.next();
            if (map.containsKey(s[i])) {
                int v = map.get(s[i]) + 1;
                map.put(s[i], v);
                if (v > max) max = v;
            } else {
                map.put(s[i], 1);
            }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            s[i] = sc.next();
            if (map.containsKey(s[i])) {
                int v = map.get(s[i]) + 1;
                map.put(s[i], v);
                if (v > max) max = v;
            } else {
                map.put(s[i], 1);
            }
        } {
            s[i] = sc.next();
            if (map.containsKey(s[i])) {
                int v = map.get(s[i]) + 1;
                map.put(s[i], v);
                if (v > max) max = v;
            } else {
                map.put(s[i], 1);
            }
        } s[i] = sc.next() s[i] s i sc.next() sc.next sc if (map.containsKey(s[i])) {
                int v = map.get(s[i]) + 1;
                map.put(s[i], v);
                if (v > max) max = v;
            } else {
                map.put(s[i], 1);
            } map.containsKey(s[i]) map.containsKey map s[i] s i {
                int v = map.get(s[i]) + 1;
                map.put(s[i], v);
                if (v > max) max = v;
            } int v = map.get(s[i]) + 1; v map.get(s[i]) + 1 map.get(s[i]) map.get map s[i] s i 1 map.put(s[i], v) map.put map s[i] s i v if (v > max) max = v; v > max v max max = v max v {
                map.put(s[i], 1);
            } map.put(s[i], 1) map.put map s[i] s i 1 Arrays.sort(s) Arrays.sort Arrays s for (int i = 0; i < n; i++) {
            int v = map.get(s[i]);
            if (v == max) {
                System.out.println(s[i]);
            }
            i += (v - 1);
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            int v = map.get(s[i]);
            if (v == max) {
                System.out.println(s[i]);
            }
            i += (v - 1);
        } {
            int v = map.get(s[i]);
            if (v == max) {
                System.out.println(s[i]);
            }
            i += (v - 1);
        } int v = map.get(s[i]); v map.get(s[i]) map.get map s[i] s i if (v == max) {
                System.out.println(s[i]);
            } v == max v max {
                System.out.println(s[i]);
            } System.out.println(s[i]) System.out.println System.out System System.out s[i] s i i += (v - 1) i (v - 1) v 1 String[] args args public class Main {

    public static void main(String[] args) {
        // ABC155C - Poll

        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();

        String[] s = new String[n];
        int max = 1;
        HashMap<String, Integer> map = new HashMap();
        for (int i = 0; i < n; i++) {
            s[i] = sc.next();
            if (map.containsKey(s[i])) {
                int v = map.get(s[i]) + 1;
                map.put(s[i], v);
                if (v > max) max = v;
            } else {
                map.put(s[i], 1);
            }
        }

        Arrays.sort(s);

        for (int i = 0; i < n; i++) {
            int v = map.get(s[i]);
            if (v == max) {
                System.out.println(s[i]);
            }
            i += (v - 1);
        }

    }
} public class Main {

    public static void main(String[] args) {
        // ABC155C - Poll

        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();

        String[] s = new String[n];
        int max = 1;
        HashMap<String, Integer> map = new HashMap();
        for (int i = 0; i < n; i++) {
            s[i] = sc.next();
            if (map.containsKey(s[i])) {
                int v = map.get(s[i]) + 1;
                map.put(s[i], v);
                if (v > max) max = v;
            } else {
                map.put(s[i], 1);
            }
        }

        Arrays.sort(s);

        for (int i = 0; i < n; i++) {
            int v = map.get(s[i]);
            if (v == max) {
                System.out.println(s[i]);
            }
            i += (v - 1);
        }

    }
} Main
import java.util.Arrays;
import java.util.HashMap;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        // ABC155C - Poll

        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();

        String[] s = new String[n];
        int max = 1;
        HashMap<String, Integer> map = new HashMap();
        for (int i = 0; i < n; i++) {
            s[i] = sc.next();
            if (map.containsKey(s[i])) {
                int v = map.get(s[i]) + 1;
                map.put(s[i], v);
                if (v > max) max = v;
            } else {
                map.put(s[i], 1);
            }
        }

        Arrays.sort(s);

        for (int i = 0; i < n; i++) {
            int v = map.get(s[i]);
            if (v == max) {
                System.out.println(s[i]);
            }
            i += (v - 1);
        }

    }
}