import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Scanner;

public class Main {

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

            Map<String, Integer> map = new HashMap<>();
            for (int i = 0; i < N; i++) {
                Integer count = map.get(S[i]);
                if (count == null) {
                    count = 1;
                } else {
                    count = count + 1;
                }

                map.put(S[i], count);
            }

            int max = 0;
            for (Integer count : map.values()) {
                max = Math.max(max, count);
            }

            List<String> list = new ArrayList<>();
            for (Entry<String, Integer> entry : map.entrySet()) {
                if (entry.getValue() == max) {
                    list.add(entry.getKey());
                }
            }

            Collections.sort(list);

            StringBuilder ans = new StringBuilder();
            for (String s : list) {
                ans.append(s).append("\n");
            }

            System.out.print(ans.toString());
        }
    }

} import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections java.util import java.util.HashMap; HashMap java.util import java.util.List; List java.util import java.util.Map; Map java.util import java.util.Map.Entry; Entry java.util.Map import java.util.Scanner; Scanner java.util public class Main {

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

            Map<String, Integer> map = new HashMap<>();
            for (int i = 0; i < N; i++) {
                Integer count = map.get(S[i]);
                if (count == null) {
                    count = 1;
                } else {
                    count = count + 1;
                }

                map.put(S[i], count);
            }

            int max = 0;
            for (Integer count : map.values()) {
                max = Math.max(max, count);
            }

            List<String> list = new ArrayList<>();
            for (Entry<String, Integer> entry : map.entrySet()) {
                if (entry.getValue() == max) {
                    list.add(entry.getKey());
                }
            }

            Collections.sort(list);

            StringBuilder ans = new StringBuilder();
            for (String s : list) {
                ans.append(s).append("\n");
            }

            System.out.print(ans.toString());
        }
    }

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

            Map<String, Integer> map = new HashMap<>();
            for (int i = 0; i < N; i++) {
                Integer count = map.get(S[i]);
                if (count == null) {
                    count = 1;
                } else {
                    count = count + 1;
                }

                map.put(S[i], count);
            }

            int max = 0;
            for (Integer count : map.values()) {
                max = Math.max(max, count);
            }

            List<String> list = new ArrayList<>();
            for (Entry<String, Integer> entry : map.entrySet()) {
                if (entry.getValue() == max) {
                    list.add(entry.getKey());
                }
            }

            Collections.sort(list);

            StringBuilder ans = new StringBuilder();
            for (String s : list) {
                ans.append(s).append("\n");
            }

            System.out.print(ans.toString());
        }
    } 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();
            }

            Map<String, Integer> map = new HashMap<>();
            for (int i = 0; i < N; i++) {
                Integer count = map.get(S[i]);
                if (count == null) {
                    count = 1;
                } else {
                    count = count + 1;
                }

                map.put(S[i], count);
            }

            int max = 0;
            for (Integer count : map.values()) {
                max = Math.max(max, count);
            }

            List<String> list = new ArrayList<>();
            for (Entry<String, Integer> entry : map.entrySet()) {
                if (entry.getValue() == max) {
                    list.add(entry.getKey());
                }
            }

            Collections.sort(list);

            StringBuilder ans = new StringBuilder();
            for (String s : list) {
                ans.append(s).append("\n");
            }

            System.out.print(ans.toString());
        }
    } 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();
            }

            Map<String, Integer> map = new HashMap<>();
            for (int i = 0; i < N; i++) {
                Integer count = map.get(S[i]);
                if (count == null) {
                    count = 1;
                } else {
                    count = count + 1;
                }

                map.put(S[i], count);
            }

            int max = 0;
            for (Integer count : map.values()) {
                max = Math.max(max, count);
            }

            List<String> list = new ArrayList<>();
            for (Entry<String, Integer> entry : map.entrySet()) {
                if (entry.getValue() == max) {
                    list.add(entry.getKey());
                }
            }

            Collections.sort(list);

            StringBuilder ans = new StringBuilder();
            for (String s : list) {
                ans.append(s).append("\n");
            }

            System.out.print(ans.toString());
        } {
            int N = sc.nextInt();
            String[] S = new String[N];
            for (int i = 0; i < N; i++) {
                S[i] = sc.next();
            }

            Map<String, Integer> map = new HashMap<>();
            for (int i = 0; i < N; i++) {
                Integer count = map.get(S[i]);
                if (count == null) {
                    count = 1;
                } else {
                    count = count + 1;
                }

                map.put(S[i], count);
            }

            int max = 0;
            for (Integer count : map.values()) {
                max = Math.max(max, count);
            }

            List<String> list = new ArrayList<>();
            for (Entry<String, Integer> entry : map.entrySet()) {
                if (entry.getValue() == max) {
                    list.add(entry.getKey());
                }
            }

            Collections.sort(list);

            StringBuilder ans = new StringBuilder();
            for (String s : list) {
                ans.append(s).append("\n");
            }

            System.out.print(ans.toString());
        } 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 Map<String, Integer> map = new HashMap<>(); map new HashMap<>() for (int i = 0; i < N; i++) {
                Integer count = map.get(S[i]);
                if (count == null) {
                    count = 1;
                } else {
                    count = count + 1;
                }

                map.put(S[i], count);
            } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
                Integer count = map.get(S[i]);
                if (count == null) {
                    count = 1;
                } else {
                    count = count + 1;
                }

                map.put(S[i], count);
            } {
                Integer count = map.get(S[i]);
                if (count == null) {
                    count = 1;
                } else {
                    count = count + 1;
                }

                map.put(S[i], count);
            } Integer count = map.get(S[i]); count map.get(S[i]) map.get map S[i] S i if (count == null) {
                    count = 1;
                } else {
                    count = count + 1;
                } count == null count null {
                    count = 1;
                } count = 1 count 1 {
                    count = count + 1;
                } count = count + 1 count count + 1 count 1 map.put(S[i], count) map.put map S[i] S i count int max = 0; max 0 for (Integer count : map.values()) {
                max = Math.max(max, count);
            } Integer count map.values() map.values map {
                max = Math.max(max, count);
            } {
                max = Math.max(max, count);
            } max = Math.max(max, count) max Math.max(max, count) Math.max Math max count List<String> list = new ArrayList<>(); list new ArrayList<>() for (Entry<String, Integer> entry : map.entrySet()) {
                if (entry.getValue() == max) {
                    list.add(entry.getKey());
                }
            } Entry<String, Integer> entry map.entrySet() map.entrySet map {
                if (entry.getValue() == max) {
                    list.add(entry.getKey());
                }
            } {
                if (entry.getValue() == max) {
                    list.add(entry.getKey());
                }
            } if (entry.getValue() == max) {
                    list.add(entry.getKey());
                } entry.getValue() == max entry.getValue() entry.getValue entry max {
                    list.add(entry.getKey());
                } list.add(entry.getKey()) list.add list entry.getKey() entry.getKey entry Collections.sort(list) Collections.sort Collections list StringBuilder ans = new StringBuilder(); ans new StringBuilder() for (String s : list) {
                ans.append(s).append("\n");
            } String s list {
                ans.append(s).append("\n");
            } {
                ans.append(s).append("\n");
            } ans.append(s).append("\n") ans.append(s).append ans.append(s) ans.append ans s "\n" System.out.print(ans.toString()) System.out.print System.out System System.out ans.toString() ans.toString ans String[] args args public class Main {

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

            Map<String, Integer> map = new HashMap<>();
            for (int i = 0; i < N; i++) {
                Integer count = map.get(S[i]);
                if (count == null) {
                    count = 1;
                } else {
                    count = count + 1;
                }

                map.put(S[i], count);
            }

            int max = 0;
            for (Integer count : map.values()) {
                max = Math.max(max, count);
            }

            List<String> list = new ArrayList<>();
            for (Entry<String, Integer> entry : map.entrySet()) {
                if (entry.getValue() == max) {
                    list.add(entry.getKey());
                }
            }

            Collections.sort(list);

            StringBuilder ans = new StringBuilder();
            for (String s : list) {
                ans.append(s).append("\n");
            }

            System.out.print(ans.toString());
        }
    }

} public class Main {

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

            Map<String, Integer> map = new HashMap<>();
            for (int i = 0; i < N; i++) {
                Integer count = map.get(S[i]);
                if (count == null) {
                    count = 1;
                } else {
                    count = count + 1;
                }

                map.put(S[i], count);
            }

            int max = 0;
            for (Integer count : map.values()) {
                max = Math.max(max, count);
            }

            List<String> list = new ArrayList<>();
            for (Entry<String, Integer> entry : map.entrySet()) {
                if (entry.getValue() == max) {
                    list.add(entry.getKey());
                }
            }

            Collections.sort(list);

            StringBuilder ans = new StringBuilder();
            for (String s : list) {
                ans.append(s).append("\n");
            }

            System.out.print(ans.toString());
        }
    }

} Main
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Scanner;

public class Main {

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

            Map<String, Integer> map = new HashMap<>();
            for (int i = 0; i < N; i++) {
                Integer count = map.get(S[i]);
                if (count == null) {
                    count = 1;
                } else {
                    count = count + 1;
                }

                map.put(S[i], count);
            }

            int max = 0;
            for (Integer count : map.values()) {
                max = Math.max(max, count);
            }

            List<String> list = new ArrayList<>();
            for (Entry<String, Integer> entry : map.entrySet()) {
                if (entry.getValue() == max) {
                    list.add(entry.getKey());
                }
            }

            Collections.sort(list);

            StringBuilder ans = new StringBuilder();
            for (String s : list) {
                ans.append(s).append("\n");
            }

            System.out.print(ans.toString());
        }
    }

}
