import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        try (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();
            }

            HashMap<String, Integer> sToNumber = new HashMap<String, Integer>();
            for (int i = 0; i < N; i++) {
                Integer number = sToNumber.get(S[i]);
                sToNumber.put(S[i], 1 + (number == null ? 0 : number.intValue()));
            }

            ArrayList<String> list = new ArrayList<>();
            int max = 0;
            for (String key : sToNumber.keySet()) {
                int number = sToNumber.get(key).intValue();
                if (number >= max) {
                    if (number > max) {
                        max = number;
                        list.clear();
                    }
                    list.add(key);
                }
            }
            Collections.sort(list);

            for (int i = 0; i < list.size(); i++) {
                System.out.println(list.get(i));
            }
        }
    }
} import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections java.util import java.util.HashMap; HashMap java.util import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        try (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();
            }

            HashMap<String, Integer> sToNumber = new HashMap<String, Integer>();
            for (int i = 0; i < N; i++) {
                Integer number = sToNumber.get(S[i]);
                sToNumber.put(S[i], 1 + (number == null ? 0 : number.intValue()));
            }

            ArrayList<String> list = new ArrayList<>();
            int max = 0;
            for (String key : sToNumber.keySet()) {
                int number = sToNumber.get(key).intValue();
                if (number >= max) {
                    if (number > max) {
                        max = number;
                        list.clear();
                    }
                    list.add(key);
                }
            }
            Collections.sort(list);

            for (int i = 0; i < list.size(); i++) {
                System.out.println(list.get(i));
            }
        }
    }
} Main public static void main(String[] args) {
        try (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();
            }

            HashMap<String, Integer> sToNumber = new HashMap<String, Integer>();
            for (int i = 0; i < N; i++) {
                Integer number = sToNumber.get(S[i]);
                sToNumber.put(S[i], 1 + (number == null ? 0 : number.intValue()));
            }

            ArrayList<String> list = new ArrayList<>();
            int max = 0;
            for (String key : sToNumber.keySet()) {
                int number = sToNumber.get(key).intValue();
                if (number >= max) {
                    if (number > max) {
                        max = number;
                        list.clear();
                    }
                    list.add(key);
                }
            }
            Collections.sort(list);

            for (int i = 0; i < list.size(); i++) {
                System.out.println(list.get(i));
            }
        }
    } main {
        try (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();
            }

            HashMap<String, Integer> sToNumber = new HashMap<String, Integer>();
            for (int i = 0; i < N; i++) {
                Integer number = sToNumber.get(S[i]);
                sToNumber.put(S[i], 1 + (number == null ? 0 : number.intValue()));
            }

            ArrayList<String> list = new ArrayList<>();
            int max = 0;
            for (String key : sToNumber.keySet()) {
                int number = sToNumber.get(key).intValue();
                if (number >= max) {
                    if (number > max) {
                        max = number;
                        list.clear();
                    }
                    list.add(key);
                }
            }
            Collections.sort(list);

            for (int i = 0; i < list.size(); i++) {
                System.out.println(list.get(i));
            }
        }
    } try (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();
            }

            HashMap<String, Integer> sToNumber = new HashMap<String, Integer>();
            for (int i = 0; i < N; i++) {
                Integer number = sToNumber.get(S[i]);
                sToNumber.put(S[i], 1 + (number == null ? 0 : number.intValue()));
            }

            ArrayList<String> list = new ArrayList<>();
            int max = 0;
            for (String key : sToNumber.keySet()) {
                int number = sToNumber.get(key).intValue();
                if (number >= max) {
                    if (number > max) {
                        max = number;
                        list.clear();
                    }
                    list.add(key);
                }
            }
            Collections.sort(list);

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

            HashMap<String, Integer> sToNumber = new HashMap<String, Integer>();
            for (int i = 0; i < N; i++) {
                Integer number = sToNumber.get(S[i]);
                sToNumber.put(S[i], 1 + (number == null ? 0 : number.intValue()));
            }

            ArrayList<String> list = new ArrayList<>();
            int max = 0;
            for (String key : sToNumber.keySet()) {
                int number = sToNumber.get(key).intValue();
                if (number >= max) {
                    if (number > max) {
                        max = number;
                        list.clear();
                    }
                    list.add(key);
                }
            }
            Collections.sort(list);

            for (int i = 0; i < list.size(); i++) {
                System.out.println(list.get(i));
            }
        } Scanner sc = new Scanner(System.in) Scanner sc = new Scanner(System.in) 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 HashMap<String, Integer> sToNumber = new HashMap<String, Integer>(); sToNumber new HashMap<String, Integer>() for (int i = 0; i < N; i++) {
                Integer number = sToNumber.get(S[i]);
                sToNumber.put(S[i], 1 + (number == null ? 0 : number.intValue()));
            } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
                Integer number = sToNumber.get(S[i]);
                sToNumber.put(S[i], 1 + (number == null ? 0 : number.intValue()));
            } {
                Integer number = sToNumber.get(S[i]);
                sToNumber.put(S[i], 1 + (number == null ? 0 : number.intValue()));
            } Integer number = sToNumber.get(S[i]); number sToNumber.get(S[i]) sToNumber.get sToNumber S[i] S i sToNumber.put(S[i], 1 + (number == null ? 0 : number.intValue())) sToNumber.put sToNumber S[i] S i 1 + (number == null ? 0 : number.intValue()) 1 (number == null ? 0 : number.intValue()) number == null number null 0 number.intValue() number.intValue number ArrayList<String> list = new ArrayList<>(); list new ArrayList<>() int max = 0; max 0 for (String key : sToNumber.keySet()) {
                int number = sToNumber.get(key).intValue();
                if (number >= max) {
                    if (number > max) {
                        max = number;
                        list.clear();
                    }
                    list.add(key);
                }
            } String key sToNumber.keySet() sToNumber.keySet sToNumber {
                int number = sToNumber.get(key).intValue();
                if (number >= max) {
                    if (number > max) {
                        max = number;
                        list.clear();
                    }
                    list.add(key);
                }
            } {
                int number = sToNumber.get(key).intValue();
                if (number >= max) {
                    if (number > max) {
                        max = number;
                        list.clear();
                    }
                    list.add(key);
                }
            } int number = sToNumber.get(key).intValue(); number sToNumber.get(key).intValue() sToNumber.get(key).intValue sToNumber.get(key) sToNumber.get sToNumber key if (number >= max) {
                    if (number > max) {
                        max = number;
                        list.clear();
                    }
                    list.add(key);
                } number >= max number max {
                    if (number > max) {
                        max = number;
                        list.clear();
                    }
                    list.add(key);
                } if (number > max) {
                        max = number;
                        list.clear();
                    } number > max number max {
                        max = number;
                        list.clear();
                    } max = number max number list.clear() list.clear list list.add(key) list.add list key Collections.sort(list) Collections.sort Collections list for (int i = 0; i < list.size(); i++) {
                System.out.println(list.get(i));
            } int i = 0; int i = 0; i 0 i < list.size() i list.size() list.size list i++ i++ i {
                System.out.println(list.get(i));
            } {
                System.out.println(list.get(i));
            } System.out.println(list.get(i)) System.out.println System.out System System.out list.get(i) list.get list i String[] args args public class Main {
    public static void main(String[] args) {
        try (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();
            }

            HashMap<String, Integer> sToNumber = new HashMap<String, Integer>();
            for (int i = 0; i < N; i++) {
                Integer number = sToNumber.get(S[i]);
                sToNumber.put(S[i], 1 + (number == null ? 0 : number.intValue()));
            }

            ArrayList<String> list = new ArrayList<>();
            int max = 0;
            for (String key : sToNumber.keySet()) {
                int number = sToNumber.get(key).intValue();
                if (number >= max) {
                    if (number > max) {
                        max = number;
                        list.clear();
                    }
                    list.add(key);
                }
            }
            Collections.sort(list);

            for (int i = 0; i < list.size(); i++) {
                System.out.println(list.get(i));
            }
        }
    }
} public class Main {
    public static void main(String[] args) {
        try (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();
            }

            HashMap<String, Integer> sToNumber = new HashMap<String, Integer>();
            for (int i = 0; i < N; i++) {
                Integer number = sToNumber.get(S[i]);
                sToNumber.put(S[i], 1 + (number == null ? 0 : number.intValue()));
            }

            ArrayList<String> list = new ArrayList<>();
            int max = 0;
            for (String key : sToNumber.keySet()) {
                int number = sToNumber.get(key).intValue();
                if (number >= max) {
                    if (number > max) {
                        max = number;
                        list.clear();
                    }
                    list.add(key);
                }
            }
            Collections.sort(list);

            for (int i = 0; i < list.size(); i++) {
                System.out.println(list.get(i));
            }
        }
    }
} Main
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        try (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();
            }

            HashMap<String, Integer> sToNumber = new HashMap<String, Integer>();
            for (int i = 0; i < N; i++) {
                Integer number = sToNumber.get(S[i]);
                sToNumber.put(S[i], 1 + (number == null ? 0 : number.intValue()));
            }

            ArrayList<String> list = new ArrayList<>();
            int max = 0;
            for (String key : sToNumber.keySet()) {
                int number = sToNumber.get(key).intValue();
                if (number >= max) {
                    if (number > max) {
                        max = number;
                        list.clear();
                    }
                    list.add(key);
                }
            }
            Collections.sort(list);

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