import java.util.*;


public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int N = sc.nextInt();
        HashMap<String,Integer> hmap = new HashMap<String, Integer>();
        int max = 0;

        for(int i=0;i<N;i++){
            String S = sc.next();
            if (hmap.containsKey(S)) {
                int count = hmap.get(S) + 1;
                hmap.put(S,count);
                max = Math.max(max,count);
            } else {
                hmap.put(S,1);
                max = Math.max(max,1);
            }
        }
        ArrayList<String> ans = new ArrayList<>();

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

        for (String s : ans){
            System.out.println(s);
        }

    }
}





 import java.util.*; util.* java public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int N = sc.nextInt();
        HashMap<String,Integer> hmap = new HashMap<String, Integer>();
        int max = 0;

        for(int i=0;i<N;i++){
            String S = sc.next();
            if (hmap.containsKey(S)) {
                int count = hmap.get(S) + 1;
                hmap.put(S,count);
                max = Math.max(max,count);
            } else {
                hmap.put(S,1);
                max = Math.max(max,1);
            }
        }
        ArrayList<String> ans = new ArrayList<>();

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

        for (String s : ans){
            System.out.println(s);
        }

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

        int N = sc.nextInt();
        HashMap<String,Integer> hmap = new HashMap<String, Integer>();
        int max = 0;

        for(int i=0;i<N;i++){
            String S = sc.next();
            if (hmap.containsKey(S)) {
                int count = hmap.get(S) + 1;
                hmap.put(S,count);
                max = Math.max(max,count);
            } else {
                hmap.put(S,1);
                max = Math.max(max,1);
            }
        }
        ArrayList<String> ans = new ArrayList<>();

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

        for (String s : ans){
            System.out.println(s);
        }

    } main {
        Scanner sc = new Scanner(System.in);

        int N = sc.nextInt();
        HashMap<String,Integer> hmap = new HashMap<String, Integer>();
        int max = 0;

        for(int i=0;i<N;i++){
            String S = sc.next();
            if (hmap.containsKey(S)) {
                int count = hmap.get(S) + 1;
                hmap.put(S,count);
                max = Math.max(max,count);
            } else {
                hmap.put(S,1);
                max = Math.max(max,1);
            }
        }
        ArrayList<String> ans = new ArrayList<>();

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

        for (String s : ans){
            System.out.println(s);
        }

    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc HashMap<String,Integer> hmap = new HashMap<String, Integer>(); hmap new HashMap<String, Integer>() int max = 0; max 0 for(int i=0;i<N;i++){
            String S = sc.next();
            if (hmap.containsKey(S)) {
                int count = hmap.get(S) + 1;
                hmap.put(S,count);
                max = Math.max(max,count);
            } else {
                hmap.put(S,1);
                max = Math.max(max,1);
            }
        } int i=0; int i=0; i 0 i<N i N i++ i++ i {
            String S = sc.next();
            if (hmap.containsKey(S)) {
                int count = hmap.get(S) + 1;
                hmap.put(S,count);
                max = Math.max(max,count);
            } else {
                hmap.put(S,1);
                max = Math.max(max,1);
            }
        } {
            String S = sc.next();
            if (hmap.containsKey(S)) {
                int count = hmap.get(S) + 1;
                hmap.put(S,count);
                max = Math.max(max,count);
            } else {
                hmap.put(S,1);
                max = Math.max(max,1);
            }
        } String S = sc.next(); S sc.next() sc.next sc if (hmap.containsKey(S)) {
                int count = hmap.get(S) + 1;
                hmap.put(S,count);
                max = Math.max(max,count);
            } else {
                hmap.put(S,1);
                max = Math.max(max,1);
            } hmap.containsKey(S) hmap.containsKey hmap S {
                int count = hmap.get(S) + 1;
                hmap.put(S,count);
                max = Math.max(max,count);
            } int count = hmap.get(S) + 1; count hmap.get(S) + 1 hmap.get(S) hmap.get hmap S 1 hmap.put(S,count) hmap.put hmap S count max = Math.max(max,count) max Math.max(max,count) Math.max Math max count {
                hmap.put(S,1);
                max = Math.max(max,1);
            } hmap.put(S,1) hmap.put hmap S 1 max = Math.max(max,1) max Math.max(max,1) Math.max Math max 1 ArrayList<String> ans = new ArrayList<>(); ans new ArrayList<>() for (String key : hmap.keySet()) {
            if(hmap.get(key) == max){
                ans.add(key);
            }
        } String key hmap.keySet() hmap.keySet hmap {
            if(hmap.get(key) == max){
                ans.add(key);
            }
        } {
            if(hmap.get(key) == max){
                ans.add(key);
            }
        } if(hmap.get(key) == max){
                ans.add(key);
            } hmap.get(key) == max hmap.get(key) hmap.get hmap key max {
                ans.add(key);
            } ans.add(key) ans.add ans key Collections.sort(ans) Collections.sort Collections ans for (String s : ans){
            System.out.println(s);
        } String s ans {
            System.out.println(s);
        } {
            System.out.println(s);
        } System.out.println(s) System.out.println System.out System System.out s String[] args args public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int N = sc.nextInt();
        HashMap<String,Integer> hmap = new HashMap<String, Integer>();
        int max = 0;

        for(int i=0;i<N;i++){
            String S = sc.next();
            if (hmap.containsKey(S)) {
                int count = hmap.get(S) + 1;
                hmap.put(S,count);
                max = Math.max(max,count);
            } else {
                hmap.put(S,1);
                max = Math.max(max,1);
            }
        }
        ArrayList<String> ans = new ArrayList<>();

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

        for (String s : ans){
            System.out.println(s);
        }

    }
} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int N = sc.nextInt();
        HashMap<String,Integer> hmap = new HashMap<String, Integer>();
        int max = 0;

        for(int i=0;i<N;i++){
            String S = sc.next();
            if (hmap.containsKey(S)) {
                int count = hmap.get(S) + 1;
                hmap.put(S,count);
                max = Math.max(max,count);
            } else {
                hmap.put(S,1);
                max = Math.max(max,1);
            }
        }
        ArrayList<String> ans = new ArrayList<>();

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

        for (String s : ans){
            System.out.println(s);
        }

    }
} Main
import java.util.*;


public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int N = sc.nextInt();
        HashMap<String,Integer> hmap = new HashMap<String, Integer>();
        int max = 0;

        for(int i=0;i<N;i++){
            String S = sc.next();
            if (hmap.containsKey(S)) {
                int count = hmap.get(S) + 1;
                hmap.put(S,count);
                max = Math.max(max,count);
            } else {
                hmap.put(S,1);
                max = Math.max(max,1);
            }
        }
        ArrayList<String> ans = new ArrayList<>();

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

        for (String s : ans){
            System.out.println(s);
        }

    }
}






