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

class Solver {
    public void Solve() {
        int n = sc.nextInt();
        String[] str = new String[n];
        for (int i = 0; i < str.length; i++) {
            str[i] = sc.next();
        }
        Arrays.sort(str);
        int max = 0;
        String s = "";
        int cnt = 0;
        for (int i = 0; i < str.length; i++) {
            if (s.equals(str[i])) {
                cnt++;
                max = Math.max(max, cnt);
            } else {
                s = str[i];
                cnt = 0;
            }
        }
        s = "";
        for (int i = 0; i < str.length; i++) {
            if (s.equals(str[i])) {
                cnt++;
            } else {
                s = str[i];
                cnt = 0;
            }
            if (cnt == max) {
                System.out.println(str[i]);
                cnt = 0;
            }
        }
    }

    Scanner sc;

    Solver(Scanner in) {
        this.sc = in;
    }
}

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        Solver s = new Solver(sc);
        s.Solve();
        sc.close();
    }
} import java.util.Scanner; Scanner java.util import java.util.Arrays; Arrays java.util class Solver {
    public void Solve() {
        int n = sc.nextInt();
        String[] str = new String[n];
        for (int i = 0; i < str.length; i++) {
            str[i] = sc.next();
        }
        Arrays.sort(str);
        int max = 0;
        String s = "";
        int cnt = 0;
        for (int i = 0; i < str.length; i++) {
            if (s.equals(str[i])) {
                cnt++;
                max = Math.max(max, cnt);
            } else {
                s = str[i];
                cnt = 0;
            }
        }
        s = "";
        for (int i = 0; i < str.length; i++) {
            if (s.equals(str[i])) {
                cnt++;
            } else {
                s = str[i];
                cnt = 0;
            }
            if (cnt == max) {
                System.out.println(str[i]);
                cnt = 0;
            }
        }
    }

    Scanner sc;

    Solver(Scanner in) {
        this.sc = in;
    }
} Solver Scanner sc; sc public void Solve() {
        int n = sc.nextInt();
        String[] str = new String[n];
        for (int i = 0; i < str.length; i++) {
            str[i] = sc.next();
        }
        Arrays.sort(str);
        int max = 0;
        String s = "";
        int cnt = 0;
        for (int i = 0; i < str.length; i++) {
            if (s.equals(str[i])) {
                cnt++;
                max = Math.max(max, cnt);
            } else {
                s = str[i];
                cnt = 0;
            }
        }
        s = "";
        for (int i = 0; i < str.length; i++) {
            if (s.equals(str[i])) {
                cnt++;
            } else {
                s = str[i];
                cnt = 0;
            }
            if (cnt == max) {
                System.out.println(str[i]);
                cnt = 0;
            }
        }
    } Solve {
        int n = sc.nextInt();
        String[] str = new String[n];
        for (int i = 0; i < str.length; i++) {
            str[i] = sc.next();
        }
        Arrays.sort(str);
        int max = 0;
        String s = "";
        int cnt = 0;
        for (int i = 0; i < str.length; i++) {
            if (s.equals(str[i])) {
                cnt++;
                max = Math.max(max, cnt);
            } else {
                s = str[i];
                cnt = 0;
            }
        }
        s = "";
        for (int i = 0; i < str.length; i++) {
            if (s.equals(str[i])) {
                cnt++;
            } else {
                s = str[i];
                cnt = 0;
            }
            if (cnt == max) {
                System.out.println(str[i]);
                cnt = 0;
            }
        }
    } int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc String[] str = new String[n]; str new String[n] n for (int i = 0; i < str.length; i++) {
            str[i] = sc.next();
        } int i = 0; int i = 0; i 0 i < str.length i str.length str str.length i++ i++ i {
            str[i] = sc.next();
        } {
            str[i] = sc.next();
        } str[i] = sc.next() str[i] str i sc.next() sc.next sc Arrays.sort(str) Arrays.sort Arrays str int max = 0; max 0 String s = ""; s "" int cnt = 0; cnt 0 for (int i = 0; i < str.length; i++) {
            if (s.equals(str[i])) {
                cnt++;
                max = Math.max(max, cnt);
            } else {
                s = str[i];
                cnt = 0;
            }
        } int i = 0; int i = 0; i 0 i < str.length i str.length str str.length i++ i++ i {
            if (s.equals(str[i])) {
                cnt++;
                max = Math.max(max, cnt);
            } else {
                s = str[i];
                cnt = 0;
            }
        } {
            if (s.equals(str[i])) {
                cnt++;
                max = Math.max(max, cnt);
            } else {
                s = str[i];
                cnt = 0;
            }
        } if (s.equals(str[i])) {
                cnt++;
                max = Math.max(max, cnt);
            } else {
                s = str[i];
                cnt = 0;
            } s.equals(str[i]) s.equals s str[i] str i {
                cnt++;
                max = Math.max(max, cnt);
            } cnt++ cnt max = Math.max(max, cnt) max Math.max(max, cnt) Math.max Math max cnt {
                s = str[i];
                cnt = 0;
            } s = str[i] s str[i] str i cnt = 0 cnt 0 s = "" s "" for (int i = 0; i < str.length; i++) {
            if (s.equals(str[i])) {
                cnt++;
            } else {
                s = str[i];
                cnt = 0;
            }
            if (cnt == max) {
                System.out.println(str[i]);
                cnt = 0;
            }
        } int i = 0; int i = 0; i 0 i < str.length i str.length str str.length i++ i++ i {
            if (s.equals(str[i])) {
                cnt++;
            } else {
                s = str[i];
                cnt = 0;
            }
            if (cnt == max) {
                System.out.println(str[i]);
                cnt = 0;
            }
        } {
            if (s.equals(str[i])) {
                cnt++;
            } else {
                s = str[i];
                cnt = 0;
            }
            if (cnt == max) {
                System.out.println(str[i]);
                cnt = 0;
            }
        } if (s.equals(str[i])) {
                cnt++;
            } else {
                s = str[i];
                cnt = 0;
            } s.equals(str[i]) s.equals s str[i] str i {
                cnt++;
            } cnt++ cnt {
                s = str[i];
                cnt = 0;
            } s = str[i] s str[i] str i cnt = 0 cnt 0 if (cnt == max) {
                System.out.println(str[i]);
                cnt = 0;
            } cnt == max cnt max {
                System.out.println(str[i]);
                cnt = 0;
            } System.out.println(str[i]) System.out.println System.out System System.out str[i] str i cnt = 0 cnt 0 Solver(Scanner in) {
        this.sc = in;
    } Solver {
        this.sc = in;
    } this.sc = in this.sc this this.sc in Scanner in in public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        Solver s = new Solver(sc);
        s.Solve();
        sc.close();
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        Solver s = new Solver(sc);
        s.Solve();
        sc.close();
    } main {
        Scanner sc = new Scanner(System.in);
        Solver s = new Solver(sc);
        s.Solve();
        sc.close();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) Solver s = new Solver(sc); s new Solver(sc) s.Solve() s.Solve s sc.close() sc.close sc String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        Solver s = new Solver(sc);
        s.Solve();
        sc.close();
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        Solver s = new Solver(sc);
        s.Solve();
        sc.close();
    }
} Main
import java.util.Scanner;
import java.util.Arrays;

class Solver {
    public void Solve() {
        int n = sc.nextInt();
        String[] str = new String[n];
        for (int i = 0; i < str.length; i++) {
            str[i] = sc.next();
        }
        Arrays.sort(str);
        int max = 0;
        String s = "";
        int cnt = 0;
        for (int i = 0; i < str.length; i++) {
            if (s.equals(str[i])) {
                cnt++;
                max = Math.max(max, cnt);
            } else {
                s = str[i];
                cnt = 0;
            }
        }
        s = "";
        for (int i = 0; i < str.length; i++) {
            if (s.equals(str[i])) {
                cnt++;
            } else {
                s = str[i];
                cnt = 0;
            }
            if (cnt == max) {
                System.out.println(str[i]);
                cnt = 0;
            }
        }
    }

    Scanner sc;

    Solver(Scanner in) {
        this.sc = in;
    }
}

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        Solver s = new Solver(sc);
        s.Solve();
        sc.close();
    }
}
