import java.util.*;

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

        for (int i = 0; i < N; i++) {
            S[i] = sc.next();
        }

        Arrays.sort(S);
        //System.out.println(Arrays.toString(S));

        ArrayList<String> Ans = new ArrayList<>();
        String tmp;
        int count = 1;

        for (int i = 0; i < N-1; i++) {
            tmp = S[i];
            if(tmp.equals(S[i+1])){
                count++;
            }else{
                count = 1;
            }

            if(count == Max_cnt){
                Ans.add(tmp);
            }else if(count > Max_cnt){
                Ans.clear();
                Ans.add(tmp);
                Max_cnt = count;
            }
        }

        if(Max_cnt == 1){
            Ans.add(S[N-1]);
        }

        for (int i = 0; i < Ans.size(); i++) {
            System.out.println(Ans.get(i));
        }
    }
} import java.util.*; util.* java public class Main {
    public static int Max_cnt = 1;
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        String[] S = new String[N];

        for (int i = 0; i < N; i++) {
            S[i] = sc.next();
        }

        Arrays.sort(S);
        //System.out.println(Arrays.toString(S));

        ArrayList<String> Ans = new ArrayList<>();
        String tmp;
        int count = 1;

        for (int i = 0; i < N-1; i++) {
            tmp = S[i];
            if(tmp.equals(S[i+1])){
                count++;
            }else{
                count = 1;
            }

            if(count == Max_cnt){
                Ans.add(tmp);
            }else if(count > Max_cnt){
                Ans.clear();
                Ans.add(tmp);
                Max_cnt = count;
            }
        }

        if(Max_cnt == 1){
            Ans.add(S[N-1]);
        }

        for (int i = 0; i < Ans.size(); i++) {
            System.out.println(Ans.get(i));
        }
    }
} Main public static int Max_cnt = 1; Max_cnt 1 public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        String[] S = new String[N];

        for (int i = 0; i < N; i++) {
            S[i] = sc.next();
        }

        Arrays.sort(S);
        //System.out.println(Arrays.toString(S));

        ArrayList<String> Ans = new ArrayList<>();
        String tmp;
        int count = 1;

        for (int i = 0; i < N-1; i++) {
            tmp = S[i];
            if(tmp.equals(S[i+1])){
                count++;
            }else{
                count = 1;
            }

            if(count == Max_cnt){
                Ans.add(tmp);
            }else if(count > Max_cnt){
                Ans.clear();
                Ans.add(tmp);
                Max_cnt = count;
            }
        }

        if(Max_cnt == 1){
            Ans.add(S[N-1]);
        }

        for (int i = 0; i < Ans.size(); i++) {
            System.out.println(Ans.get(i));
        }
    } main {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        String[] S = new String[N];

        for (int i = 0; i < N; i++) {
            S[i] = sc.next();
        }

        Arrays.sort(S);
        //System.out.println(Arrays.toString(S));

        ArrayList<String> Ans = new ArrayList<>();
        String tmp;
        int count = 1;

        for (int i = 0; i < N-1; i++) {
            tmp = S[i];
            if(tmp.equals(S[i+1])){
                count++;
            }else{
                count = 1;
            }

            if(count == Max_cnt){
                Ans.add(tmp);
            }else if(count > Max_cnt){
                Ans.clear();
                Ans.add(tmp);
                Max_cnt = count;
            }
        }

        if(Max_cnt == 1){
            Ans.add(S[N-1]);
        }

        for (int i = 0; i < Ans.size(); i++) {
            System.out.println(Ans.get(i));
        }
    } 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 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 Arrays.sort(S) Arrays.sort Arrays S ArrayList<String> Ans = new ArrayList<>(); Ans new ArrayList<>() String tmp; tmp int count = 1; count 1 for (int i = 0; i < N-1; i++) {
            tmp = S[i];
            if(tmp.equals(S[i+1])){
                count++;
            }else{
                count = 1;
            }

            if(count == Max_cnt){
                Ans.add(tmp);
            }else if(count > Max_cnt){
                Ans.clear();
                Ans.add(tmp);
                Max_cnt = count;
            }
        } int i = 0; int i = 0; i 0 i < N-1 i N-1 N 1 i++ i++ i {
            tmp = S[i];
            if(tmp.equals(S[i+1])){
                count++;
            }else{
                count = 1;
            }

            if(count == Max_cnt){
                Ans.add(tmp);
            }else if(count > Max_cnt){
                Ans.clear();
                Ans.add(tmp);
                Max_cnt = count;
            }
        } {
            tmp = S[i];
            if(tmp.equals(S[i+1])){
                count++;
            }else{
                count = 1;
            }

            if(count == Max_cnt){
                Ans.add(tmp);
            }else if(count > Max_cnt){
                Ans.clear();
                Ans.add(tmp);
                Max_cnt = count;
            }
        } tmp = S[i] tmp S[i] S i if(tmp.equals(S[i+1])){
                count++;
            }else{
                count = 1;
            } tmp.equals(S[i+1]) tmp.equals tmp S[i+1] S i+1 i 1 {
                count++;
            } count++ count {
                count = 1;
            } count = 1 count 1 if(count == Max_cnt){
                Ans.add(tmp);
            }else if(count > Max_cnt){
                Ans.clear();
                Ans.add(tmp);
                Max_cnt = count;
            } count == Max_cnt count Max_cnt {
                Ans.add(tmp);
            } Ans.add(tmp) Ans.add Ans tmp if(count > Max_cnt){
                Ans.clear();
                Ans.add(tmp);
                Max_cnt = count;
            } count > Max_cnt count Max_cnt {
                Ans.clear();
                Ans.add(tmp);
                Max_cnt = count;
            } Ans.clear() Ans.clear Ans Ans.add(tmp) Ans.add Ans tmp Max_cnt = count Max_cnt count if(Max_cnt == 1){
            Ans.add(S[N-1]);
        } Max_cnt == 1 Max_cnt 1 {
            Ans.add(S[N-1]);
        } Ans.add(S[N-1]) Ans.add Ans S[N-1] S N-1 N 1 for (int i = 0; i < Ans.size(); i++) {
            System.out.println(Ans.get(i));
        } int i = 0; int i = 0; i 0 i < Ans.size() i Ans.size() Ans.size Ans i++ i++ i {
            System.out.println(Ans.get(i));
        } {
            System.out.println(Ans.get(i));
        } System.out.println(Ans.get(i)) System.out.println System.out System System.out Ans.get(i) Ans.get Ans i String[] args args public class Main {
    public static int Max_cnt = 1;
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        String[] S = new String[N];

        for (int i = 0; i < N; i++) {
            S[i] = sc.next();
        }

        Arrays.sort(S);
        //System.out.println(Arrays.toString(S));

        ArrayList<String> Ans = new ArrayList<>();
        String tmp;
        int count = 1;

        for (int i = 0; i < N-1; i++) {
            tmp = S[i];
            if(tmp.equals(S[i+1])){
                count++;
            }else{
                count = 1;
            }

            if(count == Max_cnt){
                Ans.add(tmp);
            }else if(count > Max_cnt){
                Ans.clear();
                Ans.add(tmp);
                Max_cnt = count;
            }
        }

        if(Max_cnt == 1){
            Ans.add(S[N-1]);
        }

        for (int i = 0; i < Ans.size(); i++) {
            System.out.println(Ans.get(i));
        }
    }
} public class Main {
    public static int Max_cnt = 1;
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        String[] S = new String[N];

        for (int i = 0; i < N; i++) {
            S[i] = sc.next();
        }

        Arrays.sort(S);
        //System.out.println(Arrays.toString(S));

        ArrayList<String> Ans = new ArrayList<>();
        String tmp;
        int count = 1;

        for (int i = 0; i < N-1; i++) {
            tmp = S[i];
            if(tmp.equals(S[i+1])){
                count++;
            }else{
                count = 1;
            }

            if(count == Max_cnt){
                Ans.add(tmp);
            }else if(count > Max_cnt){
                Ans.clear();
                Ans.add(tmp);
                Max_cnt = count;
            }
        }

        if(Max_cnt == 1){
            Ans.add(S[N-1]);
        }

        for (int i = 0; i < Ans.size(); i++) {
            System.out.println(Ans.get(i));
        }
    }
} Main
import java.util.*;

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

        for (int i = 0; i < N; i++) {
            S[i] = sc.next();
        }

        Arrays.sort(S);
        //System.out.println(Arrays.toString(S));

        ArrayList<String> Ans = new ArrayList<>();
        String tmp;
        int count = 1;

        for (int i = 0; i < N-1; i++) {
            tmp = S[i];
            if(tmp.equals(S[i+1])){
                count++;
            }else{
                count = 1;
            }

            if(count == Max_cnt){
                Ans.add(tmp);
            }else if(count > Max_cnt){
                Ans.clear();
                Ans.add(tmp);
                Max_cnt = count;
            }
        }

        if(Max_cnt == 1){
            Ans.add(S[N-1]);
        }

        for (int i = 0; i < Ans.size(); i++) {
            System.out.println(Ans.get(i));
        }
    }
}
