import java.util.*;

class Main {
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        HashMap<String,Integer> hmap = new HashMap<String,Integer>();
        
        int N = sc.nextInt();
        String[] S = new String[N];
        
        int max = 1;
        for(int i=0; i<N; i++){
            S[i] = sc.next();
            if(hmap.get(S[i]) == null){
                hmap.put(S[i],1);
            } else {
                int nextcount = hmap.get(S[i])+1;
                hmap.put(S[i],nextcount);
                if(nextcount > max) max = nextcount;
            }
        }

        ArrayList<String> maxS = new ArrayList<String>();

        for(String key : hmap.keySet()){
            if(hmap.get(key) == max) maxS.add(key);
        }

        Collections.sort(maxS);

        for(int i=0; i<maxS.size(); i++){
            System.out.println(maxS.get(i));
        }
    }
} import java.util.*; util.* java class Main {
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        HashMap<String,Integer> hmap = new HashMap<String,Integer>();
        
        int N = sc.nextInt();
        String[] S = new String[N];
        
        int max = 1;
        for(int i=0; i<N; i++){
            S[i] = sc.next();
            if(hmap.get(S[i]) == null){
                hmap.put(S[i],1);
            } else {
                int nextcount = hmap.get(S[i])+1;
                hmap.put(S[i],nextcount);
                if(nextcount > max) max = nextcount;
            }
        }

        ArrayList<String> maxS = new ArrayList<String>();

        for(String key : hmap.keySet()){
            if(hmap.get(key) == max) maxS.add(key);
        }

        Collections.sort(maxS);

        for(int i=0; i<maxS.size(); i++){
            System.out.println(maxS.get(i));
        }
    }
} Main public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        HashMap<String,Integer> hmap = new HashMap<String,Integer>();
        
        int N = sc.nextInt();
        String[] S = new String[N];
        
        int max = 1;
        for(int i=0; i<N; i++){
            S[i] = sc.next();
            if(hmap.get(S[i]) == null){
                hmap.put(S[i],1);
            } else {
                int nextcount = hmap.get(S[i])+1;
                hmap.put(S[i],nextcount);
                if(nextcount > max) max = nextcount;
            }
        }

        ArrayList<String> maxS = new ArrayList<String>();

        for(String key : hmap.keySet()){
            if(hmap.get(key) == max) maxS.add(key);
        }

        Collections.sort(maxS);

        for(int i=0; i<maxS.size(); i++){
            System.out.println(maxS.get(i));
        }
    } main {
        Scanner sc = new Scanner(System.in);
        HashMap<String,Integer> hmap = new HashMap<String,Integer>();
        
        int N = sc.nextInt();
        String[] S = new String[N];
        
        int max = 1;
        for(int i=0; i<N; i++){
            S[i] = sc.next();
            if(hmap.get(S[i]) == null){
                hmap.put(S[i],1);
            } else {
                int nextcount = hmap.get(S[i])+1;
                hmap.put(S[i],nextcount);
                if(nextcount > max) max = nextcount;
            }
        }

        ArrayList<String> maxS = new ArrayList<String>();

        for(String key : hmap.keySet()){
            if(hmap.get(key) == max) maxS.add(key);
        }

        Collections.sort(maxS);

        for(int i=0; i<maxS.size(); i++){
            System.out.println(maxS.get(i));
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) HashMap<String,Integer> hmap = new HashMap<String,Integer>(); hmap new HashMap<String,Integer>() int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc String[] S = new String[N]; S new String[N] N int max = 1; max 1 for(int i=0; i<N; i++){
            S[i] = sc.next();
            if(hmap.get(S[i]) == null){
                hmap.put(S[i],1);
            } else {
                int nextcount = hmap.get(S[i])+1;
                hmap.put(S[i],nextcount);
                if(nextcount > max) max = nextcount;
            }
        } int i=0; int i=0; i 0 i<N i N i++ i++ i {
            S[i] = sc.next();
            if(hmap.get(S[i]) == null){
                hmap.put(S[i],1);
            } else {
                int nextcount = hmap.get(S[i])+1;
                hmap.put(S[i],nextcount);
                if(nextcount > max) max = nextcount;
            }
        } {
            S[i] = sc.next();
            if(hmap.get(S[i]) == null){
                hmap.put(S[i],1);
            } else {
                int nextcount = hmap.get(S[i])+1;
                hmap.put(S[i],nextcount);
                if(nextcount > max) max = nextcount;
            }
        } S[i] = sc.next() S[i] S i sc.next() sc.next sc if(hmap.get(S[i]) == null){
                hmap.put(S[i],1);
            } else {
                int nextcount = hmap.get(S[i])+1;
                hmap.put(S[i],nextcount);
                if(nextcount > max) max = nextcount;
            } hmap.get(S[i]) == null hmap.get(S[i]) hmap.get hmap S[i] S i null {
                hmap.put(S[i],1);
            } hmap.put(S[i],1) hmap.put hmap S[i] S i 1 {
                int nextcount = hmap.get(S[i])+1;
                hmap.put(S[i],nextcount);
                if(nextcount > max) max = nextcount;
            } int nextcount = hmap.get(S[i])+1; nextcount hmap.get(S[i])+1 hmap.get(S[i]) hmap.get hmap S[i] S i 1 hmap.put(S[i],nextcount) hmap.put hmap S[i] S i nextcount if(nextcount > max) max = nextcount; nextcount > max nextcount max max = nextcount max nextcount ArrayList<String> maxS = new ArrayList<String>(); maxS new ArrayList<String>() for(String key : hmap.keySet()){
            if(hmap.get(key) == max) maxS.add(key);
        } String key hmap.keySet() hmap.keySet hmap {
            if(hmap.get(key) == max) maxS.add(key);
        } {
            if(hmap.get(key) == max) maxS.add(key);
        } if(hmap.get(key) == max) maxS.add(key); hmap.get(key) == max hmap.get(key) hmap.get hmap key max maxS.add(key) maxS.add maxS key Collections.sort(maxS) Collections.sort Collections maxS for(int i=0; i<maxS.size(); i++){
            System.out.println(maxS.get(i));
        } int i=0; int i=0; i 0 i<maxS.size() i maxS.size() maxS.size maxS i++ i++ i {
            System.out.println(maxS.get(i));
        } {
            System.out.println(maxS.get(i));
        } System.out.println(maxS.get(i)) System.out.println System.out System System.out maxS.get(i) maxS.get maxS i String args[] args
import java.util.*;

class Main {
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        HashMap<String,Integer> hmap = new HashMap<String,Integer>();
        
        int N = sc.nextInt();
        String[] S = new String[N];
        
        int max = 1;
        for(int i=0; i<N; i++){
            S[i] = sc.next();
            if(hmap.get(S[i]) == null){
                hmap.put(S[i],1);
            } else {
                int nextcount = hmap.get(S[i])+1;
                hmap.put(S[i],nextcount);
                if(nextcount > max) max = nextcount;
            }
        }

        ArrayList<String> maxS = new ArrayList<String>();

        for(String key : hmap.keySet()){
            if(hmap.get(key) == max) maxS.add(key);
        }

        Collections.sort(maxS);

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