import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int N = scan.nextInt();
        List<String> list = new ArrayList<>();
        for (int i = 0; i < N; i++) list.add(scan.next());
        Collections.sort(list);
        int cnt = 0, now = 0;
        String before = "";
        for (int i = 0; i < N; i++) {
            if (!before.equals(list.get(i))) {
                cnt = Math.max(cnt, now);
                now = 1;
            } else {
                now++;
                cnt = Math.max(cnt, now);
            }
            before = list.get(i);
        }
        now = 0;
        before = "";
        for (int i = 0; i < N; i++) {
            if (!before.equals(list.get(i))) {
                now = 1;
                if (now == cnt) System.out.println(list.get(i));
            } else {
                now++;
                if (now == cnt) System.out.println(list.get(i));
            }
            before = list.get(i);
        }
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int N = scan.nextInt();
        List<String> list = new ArrayList<>();
        for (int i = 0; i < N; i++) list.add(scan.next());
        Collections.sort(list);
        int cnt = 0, now = 0;
        String before = "";
        for (int i = 0; i < N; i++) {
            if (!before.equals(list.get(i))) {
                cnt = Math.max(cnt, now);
                now = 1;
            } else {
                now++;
                cnt = Math.max(cnt, now);
            }
            before = list.get(i);
        }
        now = 0;
        before = "";
        for (int i = 0; i < N; i++) {
            if (!before.equals(list.get(i))) {
                now = 1;
                if (now == cnt) System.out.println(list.get(i));
            } else {
                now++;
                if (now == cnt) System.out.println(list.get(i));
            }
            before = list.get(i);
        }
    }
} Main public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int N = scan.nextInt();
        List<String> list = new ArrayList<>();
        for (int i = 0; i < N; i++) list.add(scan.next());
        Collections.sort(list);
        int cnt = 0, now = 0;
        String before = "";
        for (int i = 0; i < N; i++) {
            if (!before.equals(list.get(i))) {
                cnt = Math.max(cnt, now);
                now = 1;
            } else {
                now++;
                cnt = Math.max(cnt, now);
            }
            before = list.get(i);
        }
        now = 0;
        before = "";
        for (int i = 0; i < N; i++) {
            if (!before.equals(list.get(i))) {
                now = 1;
                if (now == cnt) System.out.println(list.get(i));
            } else {
                now++;
                if (now == cnt) System.out.println(list.get(i));
            }
            before = list.get(i);
        }
    } main {
        Scanner scan = new Scanner(System.in);
        int N = scan.nextInt();
        List<String> list = new ArrayList<>();
        for (int i = 0; i < N; i++) list.add(scan.next());
        Collections.sort(list);
        int cnt = 0, now = 0;
        String before = "";
        for (int i = 0; i < N; i++) {
            if (!before.equals(list.get(i))) {
                cnt = Math.max(cnt, now);
                now = 1;
            } else {
                now++;
                cnt = Math.max(cnt, now);
            }
            before = list.get(i);
        }
        now = 0;
        before = "";
        for (int i = 0; i < N; i++) {
            if (!before.equals(list.get(i))) {
                now = 1;
                if (now == cnt) System.out.println(list.get(i));
            } else {
                now++;
                if (now == cnt) System.out.println(list.get(i));
            }
            before = list.get(i);
        }
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int N = scan.nextInt(); N scan.nextInt() scan.nextInt scan List<String> list = new ArrayList<>(); list new ArrayList<>() for (int i = 0; i < N; i++) list.add(scan.next()); int i = 0; int i = 0; i 0 i < N i N i++ i++ i list.add(scan.next()); list.add(scan.next()) list.add list scan.next() scan.next scan Collections.sort(list) Collections.sort Collections list int cnt = 0 cnt 0 now = 0; now 0 String before = ""; before "" for (int i = 0; i < N; i++) {
            if (!before.equals(list.get(i))) {
                cnt = Math.max(cnt, now);
                now = 1;
            } else {
                now++;
                cnt = Math.max(cnt, now);
            }
            before = list.get(i);
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            if (!before.equals(list.get(i))) {
                cnt = Math.max(cnt, now);
                now = 1;
            } else {
                now++;
                cnt = Math.max(cnt, now);
            }
            before = list.get(i);
        } {
            if (!before.equals(list.get(i))) {
                cnt = Math.max(cnt, now);
                now = 1;
            } else {
                now++;
                cnt = Math.max(cnt, now);
            }
            before = list.get(i);
        } if (!before.equals(list.get(i))) {
                cnt = Math.max(cnt, now);
                now = 1;
            } else {
                now++;
                cnt = Math.max(cnt, now);
            } !before.equals(list.get(i)) before.equals(list.get(i)) before.equals before list.get(i) list.get list i {
                cnt = Math.max(cnt, now);
                now = 1;
            } cnt = Math.max(cnt, now) cnt Math.max(cnt, now) Math.max Math cnt now now = 1 now 1 {
                now++;
                cnt = Math.max(cnt, now);
            } now++ now cnt = Math.max(cnt, now) cnt Math.max(cnt, now) Math.max Math cnt now before = list.get(i) before list.get(i) list.get list i now = 0 now 0 before = "" before "" for (int i = 0; i < N; i++) {
            if (!before.equals(list.get(i))) {
                now = 1;
                if (now == cnt) System.out.println(list.get(i));
            } else {
                now++;
                if (now == cnt) System.out.println(list.get(i));
            }
            before = list.get(i);
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            if (!before.equals(list.get(i))) {
                now = 1;
                if (now == cnt) System.out.println(list.get(i));
            } else {
                now++;
                if (now == cnt) System.out.println(list.get(i));
            }
            before = list.get(i);
        } {
            if (!before.equals(list.get(i))) {
                now = 1;
                if (now == cnt) System.out.println(list.get(i));
            } else {
                now++;
                if (now == cnt) System.out.println(list.get(i));
            }
            before = list.get(i);
        } if (!before.equals(list.get(i))) {
                now = 1;
                if (now == cnt) System.out.println(list.get(i));
            } else {
                now++;
                if (now == cnt) System.out.println(list.get(i));
            } !before.equals(list.get(i)) before.equals(list.get(i)) before.equals before list.get(i) list.get list i {
                now = 1;
                if (now == cnt) System.out.println(list.get(i));
            } now = 1 now 1 if (now == cnt) System.out.println(list.get(i)); now == cnt now cnt System.out.println(list.get(i)) System.out.println System.out System System.out list.get(i) list.get list i {
                now++;
                if (now == cnt) System.out.println(list.get(i));
            } now++ now if (now == cnt) System.out.println(list.get(i)); now == cnt now cnt System.out.println(list.get(i)) System.out.println System.out System System.out list.get(i) list.get list i before = list.get(i) before list.get(i) list.get list i String[] args args public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int N = scan.nextInt();
        List<String> list = new ArrayList<>();
        for (int i = 0; i < N; i++) list.add(scan.next());
        Collections.sort(list);
        int cnt = 0, now = 0;
        String before = "";
        for (int i = 0; i < N; i++) {
            if (!before.equals(list.get(i))) {
                cnt = Math.max(cnt, now);
                now = 1;
            } else {
                now++;
                cnt = Math.max(cnt, now);
            }
            before = list.get(i);
        }
        now = 0;
        before = "";
        for (int i = 0; i < N; i++) {
            if (!before.equals(list.get(i))) {
                now = 1;
                if (now == cnt) System.out.println(list.get(i));
            } else {
                now++;
                if (now == cnt) System.out.println(list.get(i));
            }
            before = list.get(i);
        }
    }
} public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int N = scan.nextInt();
        List<String> list = new ArrayList<>();
        for (int i = 0; i < N; i++) list.add(scan.next());
        Collections.sort(list);
        int cnt = 0, now = 0;
        String before = "";
        for (int i = 0; i < N; i++) {
            if (!before.equals(list.get(i))) {
                cnt = Math.max(cnt, now);
                now = 1;
            } else {
                now++;
                cnt = Math.max(cnt, now);
            }
            before = list.get(i);
        }
        now = 0;
        before = "";
        for (int i = 0; i < N; i++) {
            if (!before.equals(list.get(i))) {
                now = 1;
                if (now == cnt) System.out.println(list.get(i));
            } else {
                now++;
                if (now == cnt) System.out.println(list.get(i));
            }
            before = list.get(i);
        }
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int N = scan.nextInt();
        List<String> list = new ArrayList<>();
        for (int i = 0; i < N; i++) list.add(scan.next());
        Collections.sort(list);
        int cnt = 0, now = 0;
        String before = "";
        for (int i = 0; i < N; i++) {
            if (!before.equals(list.get(i))) {
                cnt = Math.max(cnt, now);
                now = 1;
            } else {
                now++;
                cnt = Math.max(cnt, now);
            }
            before = list.get(i);
        }
        now = 0;
        before = "";
        for (int i = 0; i < N; i++) {
            if (!before.equals(list.get(i))) {
                now = 1;
                if (now == cnt) System.out.println(list.get(i));
            } else {
                now++;
                if (now == cnt) System.out.println(list.get(i));
            }
            before = list.get(i);
        }
    }
}