import java.io.*;
import java.util.*;

public class Main {

    public static void main(final String[] args) throws Exception {
        final Scanner sc = new Scanner(System.in);
        long N;
        N = sc.nextLong();
        String[] S = new String[(int)(N)];
        for(int i = 0 ; i < N ; i++){
                S[i] = sc.next();
        }

        final Solver solver = new Solver();
        solver.solve(N, S);
    }
}

class Solver {
    public void solve(long N, String[] S) {

        int max = 0;
        TreeMap<String, Integer> dict = new TreeMap<>();
        for (String s : S) {
            if (dict.containsKey(s)) {
                dict.put(s, dict.get(s) + 1);
            }
            else {
                dict.put(s, 1);
            }

            if (max < dict.get(s)) {
                max = dict.get(s);
            }
        }

        for (final String key : dict.navigableKeySet()) {
            final int v = dict.get(key);
            if (v == max) {
                System.out.println(key);
            }
        }
    }
}
 import java.io.*; io.* java import java.util.*; util.* java public class Main {

    public static void main(final String[] args) throws Exception {
        final Scanner sc = new Scanner(System.in);
        long N;
        N = sc.nextLong();
        String[] S = new String[(int)(N)];
        for(int i = 0 ; i < N ; i++){
                S[i] = sc.next();
        }

        final Solver solver = new Solver();
        solver.solve(N, S);
    }
} Main public static void main(final String[] args) throws Exception {
        final Scanner sc = new Scanner(System.in);
        long N;
        N = sc.nextLong();
        String[] S = new String[(int)(N)];
        for(int i = 0 ; i < N ; i++){
                S[i] = sc.next();
        }

        final Solver solver = new Solver();
        solver.solve(N, S);
    } main {
        final Scanner sc = new Scanner(System.in);
        long N;
        N = sc.nextLong();
        String[] S = new String[(int)(N)];
        for(int i = 0 ; i < N ; i++){
                S[i] = sc.next();
        }

        final Solver solver = new Solver();
        solver.solve(N, S);
    } final Scanner sc = new Scanner(System.in); sc new Scanner(System.in) long N; N N = sc.nextLong() N sc.nextLong() sc.nextLong sc String[] S = new String[(int)(N)]; S new String[(int)(N)] (int)(N) for(int i = 0 ; i < N ; i++){
                S[i] = sc.next();
        } int i = 0 ; int i = 0 ; i 0 i < N i N i++ i++ i {
                S[i] = sc.next();
        } {
                S[i] = sc.next();
        } S[i] = sc.next() S[i] S i sc.next() sc.next sc final Solver solver = new Solver(); solver new Solver() solver.solve(N, S) solver.solve solver N S final String[] args args class Solver {
    public void solve(long N, String[] S) {

        int max = 0;
        TreeMap<String, Integer> dict = new TreeMap<>();
        for (String s : S) {
            if (dict.containsKey(s)) {
                dict.put(s, dict.get(s) + 1);
            }
            else {
                dict.put(s, 1);
            }

            if (max < dict.get(s)) {
                max = dict.get(s);
            }
        }

        for (final String key : dict.navigableKeySet()) {
            final int v = dict.get(key);
            if (v == max) {
                System.out.println(key);
            }
        }
    }
} Solver public void solve(long N, String[] S) {

        int max = 0;
        TreeMap<String, Integer> dict = new TreeMap<>();
        for (String s : S) {
            if (dict.containsKey(s)) {
                dict.put(s, dict.get(s) + 1);
            }
            else {
                dict.put(s, 1);
            }

            if (max < dict.get(s)) {
                max = dict.get(s);
            }
        }

        for (final String key : dict.navigableKeySet()) {
            final int v = dict.get(key);
            if (v == max) {
                System.out.println(key);
            }
        }
    } solve {

        int max = 0;
        TreeMap<String, Integer> dict = new TreeMap<>();
        for (String s : S) {
            if (dict.containsKey(s)) {
                dict.put(s, dict.get(s) + 1);
            }
            else {
                dict.put(s, 1);
            }

            if (max < dict.get(s)) {
                max = dict.get(s);
            }
        }

        for (final String key : dict.navigableKeySet()) {
            final int v = dict.get(key);
            if (v == max) {
                System.out.println(key);
            }
        }
    } int max = 0; max 0 TreeMap<String, Integer> dict = new TreeMap<>(); dict new TreeMap<>() for (String s : S) {
            if (dict.containsKey(s)) {
                dict.put(s, dict.get(s) + 1);
            }
            else {
                dict.put(s, 1);
            }

            if (max < dict.get(s)) {
                max = dict.get(s);
            }
        } String s S {
            if (dict.containsKey(s)) {
                dict.put(s, dict.get(s) + 1);
            }
            else {
                dict.put(s, 1);
            }

            if (max < dict.get(s)) {
                max = dict.get(s);
            }
        } {
            if (dict.containsKey(s)) {
                dict.put(s, dict.get(s) + 1);
            }
            else {
                dict.put(s, 1);
            }

            if (max < dict.get(s)) {
                max = dict.get(s);
            }
        } if (dict.containsKey(s)) {
                dict.put(s, dict.get(s) + 1);
            }
            else {
                dict.put(s, 1);
            } dict.containsKey(s) dict.containsKey dict s {
                dict.put(s, dict.get(s) + 1);
            } dict.put(s, dict.get(s) + 1) dict.put dict s dict.get(s) + 1 dict.get(s) dict.get dict s 1 {
                dict.put(s, 1);
            } dict.put(s, 1) dict.put dict s 1 if (max < dict.get(s)) {
                max = dict.get(s);
            } max < dict.get(s) max dict.get(s) dict.get dict s {
                max = dict.get(s);
            } max = dict.get(s) max dict.get(s) dict.get dict s for (final String key : dict.navigableKeySet()) {
            final int v = dict.get(key);
            if (v == max) {
                System.out.println(key);
            }
        } final String key dict.navigableKeySet() dict.navigableKeySet dict {
            final int v = dict.get(key);
            if (v == max) {
                System.out.println(key);
            }
        } {
            final int v = dict.get(key);
            if (v == max) {
                System.out.println(key);
            }
        } final int v = dict.get(key); v dict.get(key) dict.get dict key if (v == max) {
                System.out.println(key);
            } v == max v max {
                System.out.println(key);
            } System.out.println(key) System.out.println System.out System System.out key long N N String[] S S public class Main {

    public static void main(final String[] args) throws Exception {
        final Scanner sc = new Scanner(System.in);
        long N;
        N = sc.nextLong();
        String[] S = new String[(int)(N)];
        for(int i = 0 ; i < N ; i++){
                S[i] = sc.next();
        }

        final Solver solver = new Solver();
        solver.solve(N, S);
    }
} public class Main {

    public static void main(final String[] args) throws Exception {
        final Scanner sc = new Scanner(System.in);
        long N;
        N = sc.nextLong();
        String[] S = new String[(int)(N)];
        for(int i = 0 ; i < N ; i++){
                S[i] = sc.next();
        }

        final Solver solver = new Solver();
        solver.solve(N, S);
    }
} Main
import java.io.*;
import java.util.*;

public class Main {

    public static void main(final String[] args) throws Exception {
        final Scanner sc = new Scanner(System.in);
        long N;
        N = sc.nextLong();
        String[] S = new String[(int)(N)];
        for(int i = 0 ; i < N ; i++){
                S[i] = sc.next();
        }

        final Solver solver = new Solver();
        solver.solve(N, S);
    }
}

class Solver {
    public void solve(long N, String[] S) {

        int max = 0;
        TreeMap<String, Integer> dict = new TreeMap<>();
        for (String s : S) {
            if (dict.containsKey(s)) {
                dict.put(s, dict.get(s) + 1);
            }
            else {
                dict.put(s, 1);
            }

            if (max < dict.get(s)) {
                max = dict.get(s);
            }
        }

        for (final String key : dict.navigableKeySet()) {
            final int v = dict.get(key);
            if (v == max) {
                System.out.println(key);
            }
        }
    }
}

