import java.util.*;

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

        int num;
        num = cin.nextInt();

        String temp;
        HashMap<String, Integer> vote = new HashMap<>();
        for (int i = 0; i < num; i++) {
            temp = cin.next();
            if (vote.containsKey(temp)) {
                vote.put(temp, vote.get(temp) + 1);
            } else {
                vote.put(temp, 1);
            }
        }

        int max = Collections.max(vote.values());

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

        Collections.sort(strings);

        for (String s: strings) {
            System.out.println(s);
        }
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner cin = new Scanner(System.in);

        int num;
        num = cin.nextInt();

        String temp;
        HashMap<String, Integer> vote = new HashMap<>();
        for (int i = 0; i < num; i++) {
            temp = cin.next();
            if (vote.containsKey(temp)) {
                vote.put(temp, vote.get(temp) + 1);
            } else {
                vote.put(temp, 1);
            }
        }

        int max = Collections.max(vote.values());

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

        Collections.sort(strings);

        for (String s: strings) {
            System.out.println(s);
        }
    }
} Main public static void main(String[] args) {
        Scanner cin = new Scanner(System.in);

        int num;
        num = cin.nextInt();

        String temp;
        HashMap<String, Integer> vote = new HashMap<>();
        for (int i = 0; i < num; i++) {
            temp = cin.next();
            if (vote.containsKey(temp)) {
                vote.put(temp, vote.get(temp) + 1);
            } else {
                vote.put(temp, 1);
            }
        }

        int max = Collections.max(vote.values());

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

        Collections.sort(strings);

        for (String s: strings) {
            System.out.println(s);
        }
    } main {
        Scanner cin = new Scanner(System.in);

        int num;
        num = cin.nextInt();

        String temp;
        HashMap<String, Integer> vote = new HashMap<>();
        for (int i = 0; i < num; i++) {
            temp = cin.next();
            if (vote.containsKey(temp)) {
                vote.put(temp, vote.get(temp) + 1);
            } else {
                vote.put(temp, 1);
            }
        }

        int max = Collections.max(vote.values());

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

        Collections.sort(strings);

        for (String s: strings) {
            System.out.println(s);
        }
    } Scanner cin = new Scanner(System.in); cin new Scanner(System.in) int num; num num = cin.nextInt() num cin.nextInt() cin.nextInt cin String temp; temp HashMap<String, Integer> vote = new HashMap<>(); vote new HashMap<>() for (int i = 0; i < num; i++) {
            temp = cin.next();
            if (vote.containsKey(temp)) {
                vote.put(temp, vote.get(temp) + 1);
            } else {
                vote.put(temp, 1);
            }
        } int i = 0; int i = 0; i 0 i < num i num i++ i++ i {
            temp = cin.next();
            if (vote.containsKey(temp)) {
                vote.put(temp, vote.get(temp) + 1);
            } else {
                vote.put(temp, 1);
            }
        } {
            temp = cin.next();
            if (vote.containsKey(temp)) {
                vote.put(temp, vote.get(temp) + 1);
            } else {
                vote.put(temp, 1);
            }
        } temp = cin.next() temp cin.next() cin.next cin if (vote.containsKey(temp)) {
                vote.put(temp, vote.get(temp) + 1);
            } else {
                vote.put(temp, 1);
            } vote.containsKey(temp) vote.containsKey vote temp {
                vote.put(temp, vote.get(temp) + 1);
            } vote.put(temp, vote.get(temp) + 1) vote.put vote temp vote.get(temp) + 1 vote.get(temp) vote.get vote temp 1 {
                vote.put(temp, 1);
            } vote.put(temp, 1) vote.put vote temp 1 int max = Collections.max(vote.values()); max Collections.max(vote.values()) Collections.max Collections vote.values() vote.values vote ArrayList<String> strings = new ArrayList<>(); strings new ArrayList<>() for (Map.Entry<String, Integer> entry : vote.entrySet()) {
            if (max == entry.getValue()) {
                strings.add(entry.getKey());
            }
        } Map.Entry<String, Integer> entry vote.entrySet() vote.entrySet vote {
            if (max == entry.getValue()) {
                strings.add(entry.getKey());
            }
        } {
            if (max == entry.getValue()) {
                strings.add(entry.getKey());
            }
        } if (max == entry.getValue()) {
                strings.add(entry.getKey());
            } max == entry.getValue() max entry.getValue() entry.getValue entry {
                strings.add(entry.getKey());
            } strings.add(entry.getKey()) strings.add strings entry.getKey() entry.getKey entry Collections.sort(strings) Collections.sort Collections strings for (String s: strings) {
            System.out.println(s);
        } String s strings {
            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 cin = new Scanner(System.in);

        int num;
        num = cin.nextInt();

        String temp;
        HashMap<String, Integer> vote = new HashMap<>();
        for (int i = 0; i < num; i++) {
            temp = cin.next();
            if (vote.containsKey(temp)) {
                vote.put(temp, vote.get(temp) + 1);
            } else {
                vote.put(temp, 1);
            }
        }

        int max = Collections.max(vote.values());

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

        Collections.sort(strings);

        for (String s: strings) {
            System.out.println(s);
        }
    }
} public class Main {
    public static void main(String[] args) {
        Scanner cin = new Scanner(System.in);

        int num;
        num = cin.nextInt();

        String temp;
        HashMap<String, Integer> vote = new HashMap<>();
        for (int i = 0; i < num; i++) {
            temp = cin.next();
            if (vote.containsKey(temp)) {
                vote.put(temp, vote.get(temp) + 1);
            } else {
                vote.put(temp, 1);
            }
        }

        int max = Collections.max(vote.values());

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

        Collections.sort(strings);

        for (String s: strings) {
            System.out.println(s);
        }
    }
} Main
import java.util.*;

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

        int num;
        num = cin.nextInt();

        String temp;
        HashMap<String, Integer> vote = new HashMap<>();
        for (int i = 0; i < num; i++) {
            temp = cin.next();
            if (vote.containsKey(temp)) {
                vote.put(temp, vote.get(temp) + 1);
            } else {
                vote.put(temp, 1);
            }
        }

        int max = Collections.max(vote.values());

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

        Collections.sort(strings);

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