import java.util.*;
import java.util.stream.Collectors;

public class Main {

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

        final int N = sc.nextInt();

        int max = 0;
        final Map<String, Integer> M = new HashMap<>();
        for (int i = 0; i < N; i++) {
            final String S = sc.next();
            if (!M.containsKey(S)) M.put(S, 0);
            M.put(S, M.get(S) + 1);
            max = Math.max(max, M.get(S));
        }

        List<String> sortedKeyList = M.keySet().stream().sorted().collect(Collectors.toList());

        for (String key : sortedKeyList) {
            if (M.get(key) == max) System.out.println(key);
        }
    }
} import java.util.*; util.* java import java.util.stream.Collectors; Collectors java.util.stream public class Main {

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

        final int N = sc.nextInt();

        int max = 0;
        final Map<String, Integer> M = new HashMap<>();
        for (int i = 0; i < N; i++) {
            final String S = sc.next();
            if (!M.containsKey(S)) M.put(S, 0);
            M.put(S, M.get(S) + 1);
            max = Math.max(max, M.get(S));
        }

        List<String> sortedKeyList = M.keySet().stream().sorted().collect(Collectors.toList());

        for (String key : sortedKeyList) {
            if (M.get(key) == max) System.out.println(key);
        }
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        final int N = sc.nextInt();

        int max = 0;
        final Map<String, Integer> M = new HashMap<>();
        for (int i = 0; i < N; i++) {
            final String S = sc.next();
            if (!M.containsKey(S)) M.put(S, 0);
            M.put(S, M.get(S) + 1);
            max = Math.max(max, M.get(S));
        }

        List<String> sortedKeyList = M.keySet().stream().sorted().collect(Collectors.toList());

        for (String key : sortedKeyList) {
            if (M.get(key) == max) System.out.println(key);
        }
    } main {
        Scanner sc = new Scanner(System.in);

        final int N = sc.nextInt();

        int max = 0;
        final Map<String, Integer> M = new HashMap<>();
        for (int i = 0; i < N; i++) {
            final String S = sc.next();
            if (!M.containsKey(S)) M.put(S, 0);
            M.put(S, M.get(S) + 1);
            max = Math.max(max, M.get(S));
        }

        List<String> sortedKeyList = M.keySet().stream().sorted().collect(Collectors.toList());

        for (String key : sortedKeyList) {
            if (M.get(key) == max) System.out.println(key);
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) final int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int max = 0; max 0 final Map<String, Integer> M = new HashMap<>(); M new HashMap<>() for (int i = 0; i < N; i++) {
            final String S = sc.next();
            if (!M.containsKey(S)) M.put(S, 0);
            M.put(S, M.get(S) + 1);
            max = Math.max(max, M.get(S));
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            final String S = sc.next();
            if (!M.containsKey(S)) M.put(S, 0);
            M.put(S, M.get(S) + 1);
            max = Math.max(max, M.get(S));
        } {
            final String S = sc.next();
            if (!M.containsKey(S)) M.put(S, 0);
            M.put(S, M.get(S) + 1);
            max = Math.max(max, M.get(S));
        } final String S = sc.next(); S sc.next() sc.next sc if (!M.containsKey(S)) M.put(S, 0); !M.containsKey(S) M.containsKey(S) M.containsKey M S M.put(S, 0) M.put M S 0 M.put(S, M.get(S) + 1) M.put M S M.get(S) + 1 M.get(S) M.get M S 1 max = Math.max(max, M.get(S)) max Math.max(max, M.get(S)) Math.max Math max M.get(S) M.get M S List<String> sortedKeyList = M.keySet().stream().sorted().collect(Collectors.toList()); sortedKeyList M.keySet().stream().sorted().collect(Collectors.toList()) M.keySet().stream().sorted().collect M.keySet().stream().sorted() M.keySet().stream().sorted M.keySet().stream() M.keySet().stream M.keySet() M.keySet M Collectors.toList() Collectors.toList Collectors for (String key : sortedKeyList) {
            if (M.get(key) == max) System.out.println(key);
        } String key sortedKeyList {
            if (M.get(key) == max) System.out.println(key);
        } {
            if (M.get(key) == max) System.out.println(key);
        } if (M.get(key) == max) System.out.println(key); M.get(key) == max M.get(key) M.get M 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);

        final int N = sc.nextInt();

        int max = 0;
        final Map<String, Integer> M = new HashMap<>();
        for (int i = 0; i < N; i++) {
            final String S = sc.next();
            if (!M.containsKey(S)) M.put(S, 0);
            M.put(S, M.get(S) + 1);
            max = Math.max(max, M.get(S));
        }

        List<String> sortedKeyList = M.keySet().stream().sorted().collect(Collectors.toList());

        for (String key : sortedKeyList) {
            if (M.get(key) == max) System.out.println(key);
        }
    }
} public class Main {

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

        final int N = sc.nextInt();

        int max = 0;
        final Map<String, Integer> M = new HashMap<>();
        for (int i = 0; i < N; i++) {
            final String S = sc.next();
            if (!M.containsKey(S)) M.put(S, 0);
            M.put(S, M.get(S) + 1);
            max = Math.max(max, M.get(S));
        }

        List<String> sortedKeyList = M.keySet().stream().sorted().collect(Collectors.toList());

        for (String key : sortedKeyList) {
            if (M.get(key) == max) System.out.println(key);
        }
    }
} Main
import java.util.*;
import java.util.stream.Collectors;

public class Main {

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

        final int N = sc.nextInt();

        int max = 0;
        final Map<String, Integer> M = new HashMap<>();
        for (int i = 0; i < N; i++) {
            final String S = sc.next();
            if (!M.containsKey(S)) M.put(S, 0);
            M.put(S, M.get(S) + 1);
            max = Math.max(max, M.get(S));
        }

        List<String> sortedKeyList = M.keySet().stream().sorted().collect(Collectors.toList());

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