import java.util.*;
import java.io.*;
 
public class Main{
 
	public static void main(String[] $){
		Scanner s = new Scanner(System.in);
        int N = s.nextInt();
        String[] S = new String[N];
        for(int i = 0; i < N; i++){
            S[i] = s.next();
        }
        HashMap<String, Integer> Hash = new HashMap<String, Integer>();
        int max = 0;
        List<String> list = new ArrayList<String>();
        for(int i = 0; i < N; i++){
            if(Hash.get(S[i]) == null){
                Hash.put(S[i], 1);
                list.add(S[i]);
                max = Math.max(max, 1);
            }else{
                int a = Hash.get(S[i]);
                a++;
                Hash.put(S[i], a);
                max = Math.max(a, max);
            }
        }
        List<String> list2 = new ArrayList<String>();
        for(int i = 0; i < list.size(); i++){
            if(Hash.get(list.get(i)) == max){
                list2.add(list.get(i));
            }
        }

        Collections.sort(list2);
        for(int i = 0; i < list2.size(); i++){
            System.out.println(list2.get(i));
        }
        
	}
}  import java.util.*; util.* java import java.io.*; io.* java public class Main{
 
	public static void main(String[] $){
		Scanner s = new Scanner(System.in);
        int N = s.nextInt();
        String[] S = new String[N];
        for(int i = 0; i < N; i++){
            S[i] = s.next();
        }
        HashMap<String, Integer> Hash = new HashMap<String, Integer>();
        int max = 0;
        List<String> list = new ArrayList<String>();
        for(int i = 0; i < N; i++){
            if(Hash.get(S[i]) == null){
                Hash.put(S[i], 1);
                list.add(S[i]);
                max = Math.max(max, 1);
            }else{
                int a = Hash.get(S[i]);
                a++;
                Hash.put(S[i], a);
                max = Math.max(a, max);
            }
        }
        List<String> list2 = new ArrayList<String>();
        for(int i = 0; i < list.size(); i++){
            if(Hash.get(list.get(i)) == max){
                list2.add(list.get(i));
            }
        }

        Collections.sort(list2);
        for(int i = 0; i < list2.size(); i++){
            System.out.println(list2.get(i));
        }
        
	}
} Main public static void main(String[] $){
		Scanner s = new Scanner(System.in);
        int N = s.nextInt();
        String[] S = new String[N];
        for(int i = 0; i < N; i++){
            S[i] = s.next();
        }
        HashMap<String, Integer> Hash = new HashMap<String, Integer>();
        int max = 0;
        List<String> list = new ArrayList<String>();
        for(int i = 0; i < N; i++){
            if(Hash.get(S[i]) == null){
                Hash.put(S[i], 1);
                list.add(S[i]);
                max = Math.max(max, 1);
            }else{
                int a = Hash.get(S[i]);
                a++;
                Hash.put(S[i], a);
                max = Math.max(a, max);
            }
        }
        List<String> list2 = new ArrayList<String>();
        for(int i = 0; i < list.size(); i++){
            if(Hash.get(list.get(i)) == max){
                list2.add(list.get(i));
            }
        }

        Collections.sort(list2);
        for(int i = 0; i < list2.size(); i++){
            System.out.println(list2.get(i));
        }
        
	} main {
		Scanner s = new Scanner(System.in);
        int N = s.nextInt();
        String[] S = new String[N];
        for(int i = 0; i < N; i++){
            S[i] = s.next();
        }
        HashMap<String, Integer> Hash = new HashMap<String, Integer>();
        int max = 0;
        List<String> list = new ArrayList<String>();
        for(int i = 0; i < N; i++){
            if(Hash.get(S[i]) == null){
                Hash.put(S[i], 1);
                list.add(S[i]);
                max = Math.max(max, 1);
            }else{
                int a = Hash.get(S[i]);
                a++;
                Hash.put(S[i], a);
                max = Math.max(a, max);
            }
        }
        List<String> list2 = new ArrayList<String>();
        for(int i = 0; i < list.size(); i++){
            if(Hash.get(list.get(i)) == max){
                list2.add(list.get(i));
            }
        }

        Collections.sort(list2);
        for(int i = 0; i < list2.size(); i++){
            System.out.println(list2.get(i));
        }
        
	} Scanner s = new Scanner(System.in); s new Scanner(System.in) int N = s.nextInt(); N s.nextInt() s.nextInt s String[] S = new String[N]; S new String[N] N for(int i = 0; i < N; i++){
            S[i] = s.next();
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            S[i] = s.next();
        } {
            S[i] = s.next();
        } S[i] = s.next() S[i] S i s.next() s.next s HashMap<String, Integer> Hash = new HashMap<String, Integer>(); Hash new HashMap<String, Integer>() int max = 0; max 0 List<String> list = new ArrayList<String>(); list new ArrayList<String>() for(int i = 0; i < N; i++){
            if(Hash.get(S[i]) == null){
                Hash.put(S[i], 1);
                list.add(S[i]);
                max = Math.max(max, 1);
            }else{
                int a = Hash.get(S[i]);
                a++;
                Hash.put(S[i], a);
                max = Math.max(a, max);
            }
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            if(Hash.get(S[i]) == null){
                Hash.put(S[i], 1);
                list.add(S[i]);
                max = Math.max(max, 1);
            }else{
                int a = Hash.get(S[i]);
                a++;
                Hash.put(S[i], a);
                max = Math.max(a, max);
            }
        } {
            if(Hash.get(S[i]) == null){
                Hash.put(S[i], 1);
                list.add(S[i]);
                max = Math.max(max, 1);
            }else{
                int a = Hash.get(S[i]);
                a++;
                Hash.put(S[i], a);
                max = Math.max(a, max);
            }
        } if(Hash.get(S[i]) == null){
                Hash.put(S[i], 1);
                list.add(S[i]);
                max = Math.max(max, 1);
            }else{
                int a = Hash.get(S[i]);
                a++;
                Hash.put(S[i], a);
                max = Math.max(a, max);
            } Hash.get(S[i]) == null Hash.get(S[i]) Hash.get Hash S[i] S i null {
                Hash.put(S[i], 1);
                list.add(S[i]);
                max = Math.max(max, 1);
            } Hash.put(S[i], 1) Hash.put Hash S[i] S i 1 list.add(S[i]) list.add list S[i] S i max = Math.max(max, 1) max Math.max(max, 1) Math.max Math max 1 {
                int a = Hash.get(S[i]);
                a++;
                Hash.put(S[i], a);
                max = Math.max(a, max);
            } int a = Hash.get(S[i]); a Hash.get(S[i]) Hash.get Hash S[i] S i a++ a Hash.put(S[i], a) Hash.put Hash S[i] S i a max = Math.max(a, max) max Math.max(a, max) Math.max Math a max List<String> list2 = new ArrayList<String>(); list2 new ArrayList<String>() for(int i = 0; i < list.size(); i++){
            if(Hash.get(list.get(i)) == max){
                list2.add(list.get(i));
            }
        } int i = 0; int i = 0; i 0 i < list.size() i list.size() list.size list i++ i++ i {
            if(Hash.get(list.get(i)) == max){
                list2.add(list.get(i));
            }
        } {
            if(Hash.get(list.get(i)) == max){
                list2.add(list.get(i));
            }
        } if(Hash.get(list.get(i)) == max){
                list2.add(list.get(i));
            } Hash.get(list.get(i)) == max Hash.get(list.get(i)) Hash.get Hash list.get(i) list.get list i max {
                list2.add(list.get(i));
            } list2.add(list.get(i)) list2.add list2 list.get(i) list.get list i Collections.sort(list2) Collections.sort Collections list2 for(int i = 0; i < list2.size(); i++){
            System.out.println(list2.get(i));
        } int i = 0; int i = 0; i 0 i < list2.size() i list2.size() list2.size list2 i++ i++ i {
            System.out.println(list2.get(i));
        } {
            System.out.println(list2.get(i));
        } System.out.println(list2.get(i)) System.out.println System.out System System.out list2.get(i) list2.get list2 i String[] $ $ public class Main{
 
	public static void main(String[] $){
		Scanner s = new Scanner(System.in);
        int N = s.nextInt();
        String[] S = new String[N];
        for(int i = 0; i < N; i++){
            S[i] = s.next();
        }
        HashMap<String, Integer> Hash = new HashMap<String, Integer>();
        int max = 0;
        List<String> list = new ArrayList<String>();
        for(int i = 0; i < N; i++){
            if(Hash.get(S[i]) == null){
                Hash.put(S[i], 1);
                list.add(S[i]);
                max = Math.max(max, 1);
            }else{
                int a = Hash.get(S[i]);
                a++;
                Hash.put(S[i], a);
                max = Math.max(a, max);
            }
        }
        List<String> list2 = new ArrayList<String>();
        for(int i = 0; i < list.size(); i++){
            if(Hash.get(list.get(i)) == max){
                list2.add(list.get(i));
            }
        }

        Collections.sort(list2);
        for(int i = 0; i < list2.size(); i++){
            System.out.println(list2.get(i));
        }
        
	}
} public class Main{
 
	public static void main(String[] $){
		Scanner s = new Scanner(System.in);
        int N = s.nextInt();
        String[] S = new String[N];
        for(int i = 0; i < N; i++){
            S[i] = s.next();
        }
        HashMap<String, Integer> Hash = new HashMap<String, Integer>();
        int max = 0;
        List<String> list = new ArrayList<String>();
        for(int i = 0; i < N; i++){
            if(Hash.get(S[i]) == null){
                Hash.put(S[i], 1);
                list.add(S[i]);
                max = Math.max(max, 1);
            }else{
                int a = Hash.get(S[i]);
                a++;
                Hash.put(S[i], a);
                max = Math.max(a, max);
            }
        }
        List<String> list2 = new ArrayList<String>();
        for(int i = 0; i < list.size(); i++){
            if(Hash.get(list.get(i)) == max){
                list2.add(list.get(i));
            }
        }

        Collections.sort(list2);
        for(int i = 0; i < list2.size(); i++){
            System.out.println(list2.get(i));
        }
        
	}
} Main
import java.util.*;
import java.io.*;
 
public class Main{
 
	public static void main(String[] $){
		Scanner s = new Scanner(System.in);
        int N = s.nextInt();
        String[] S = new String[N];
        for(int i = 0; i < N; i++){
            S[i] = s.next();
        }
        HashMap<String, Integer> Hash = new HashMap<String, Integer>();
        int max = 0;
        List<String> list = new ArrayList<String>();
        for(int i = 0; i < N; i++){
            if(Hash.get(S[i]) == null){
                Hash.put(S[i], 1);
                list.add(S[i]);
                max = Math.max(max, 1);
            }else{
                int a = Hash.get(S[i]);
                a++;
                Hash.put(S[i], a);
                max = Math.max(a, max);
            }
        }
        List<String> list2 = new ArrayList<String>();
        for(int i = 0; i < list.size(); i++){
            if(Hash.get(list.get(i)) == max){
                list2.add(list.get(i));
            }
        }

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