import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Map<String, Integer> word = new HashMap<String, Integer>();
        String newWord;
        int num = 0;
        for(int i = 0; i < n; i++) {
            newWord = sc.next();
            if(!word.containsKey(newWord)){
                word.put(newWord, 1);
            }else{
                num = word.get(newWord);
                word.remove(newWord);
                word.put(newWord, num + 1);
            }
        }
        int mostNum = 0;
        int current = 0;
        Iterator<Integer> it = word.values().iterator();
        while(it.hasNext()) {
            current = it.next();
            if(mostNum< current) {
                mostNum = current;
            }
        }

        String[] allWords = new String[n];
        Iterator<String> it3 = word.keySet().iterator();
        int q = 0;
        while(it3.hasNext()) {
            allWords[q] = it3.next();
            q++;
        }

        ArrayList<String> mostWords = new ArrayList<String>();
        for(int i = 0; i < q; i++) {
            if(word.get(allWords[i]) == mostNum) {
                mostWords.add(allWords[i]);
            }
        }
        Collections.sort(mostWords);
        for(int a = 0; a < mostWords.size(); a++) {
            System.out.println(mostWords.get(a));
        }
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Map<String, Integer> word = new HashMap<String, Integer>();
        String newWord;
        int num = 0;
        for(int i = 0; i < n; i++) {
            newWord = sc.next();
            if(!word.containsKey(newWord)){
                word.put(newWord, 1);
            }else{
                num = word.get(newWord);
                word.remove(newWord);
                word.put(newWord, num + 1);
            }
        }
        int mostNum = 0;
        int current = 0;
        Iterator<Integer> it = word.values().iterator();
        while(it.hasNext()) {
            current = it.next();
            if(mostNum< current) {
                mostNum = current;
            }
        }

        String[] allWords = new String[n];
        Iterator<String> it3 = word.keySet().iterator();
        int q = 0;
        while(it3.hasNext()) {
            allWords[q] = it3.next();
            q++;
        }

        ArrayList<String> mostWords = new ArrayList<String>();
        for(int i = 0; i < q; i++) {
            if(word.get(allWords[i]) == mostNum) {
                mostWords.add(allWords[i]);
            }
        }
        Collections.sort(mostWords);
        for(int a = 0; a < mostWords.size(); a++) {
            System.out.println(mostWords.get(a));
        }
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Map<String, Integer> word = new HashMap<String, Integer>();
        String newWord;
        int num = 0;
        for(int i = 0; i < n; i++) {
            newWord = sc.next();
            if(!word.containsKey(newWord)){
                word.put(newWord, 1);
            }else{
                num = word.get(newWord);
                word.remove(newWord);
                word.put(newWord, num + 1);
            }
        }
        int mostNum = 0;
        int current = 0;
        Iterator<Integer> it = word.values().iterator();
        while(it.hasNext()) {
            current = it.next();
            if(mostNum< current) {
                mostNum = current;
            }
        }

        String[] allWords = new String[n];
        Iterator<String> it3 = word.keySet().iterator();
        int q = 0;
        while(it3.hasNext()) {
            allWords[q] = it3.next();
            q++;
        }

        ArrayList<String> mostWords = new ArrayList<String>();
        for(int i = 0; i < q; i++) {
            if(word.get(allWords[i]) == mostNum) {
                mostWords.add(allWords[i]);
            }
        }
        Collections.sort(mostWords);
        for(int a = 0; a < mostWords.size(); a++) {
            System.out.println(mostWords.get(a));
        }
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Map<String, Integer> word = new HashMap<String, Integer>();
        String newWord;
        int num = 0;
        for(int i = 0; i < n; i++) {
            newWord = sc.next();
            if(!word.containsKey(newWord)){
                word.put(newWord, 1);
            }else{
                num = word.get(newWord);
                word.remove(newWord);
                word.put(newWord, num + 1);
            }
        }
        int mostNum = 0;
        int current = 0;
        Iterator<Integer> it = word.values().iterator();
        while(it.hasNext()) {
            current = it.next();
            if(mostNum< current) {
                mostNum = current;
            }
        }

        String[] allWords = new String[n];
        Iterator<String> it3 = word.keySet().iterator();
        int q = 0;
        while(it3.hasNext()) {
            allWords[q] = it3.next();
            q++;
        }

        ArrayList<String> mostWords = new ArrayList<String>();
        for(int i = 0; i < q; i++) {
            if(word.get(allWords[i]) == mostNum) {
                mostWords.add(allWords[i]);
            }
        }
        Collections.sort(mostWords);
        for(int a = 0; a < mostWords.size(); a++) {
            System.out.println(mostWords.get(a));
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc Map<String, Integer> word = new HashMap<String, Integer>(); word new HashMap<String, Integer>() String newWord; newWord int num = 0; num 0 for(int i = 0; i < n; i++) {
            newWord = sc.next();
            if(!word.containsKey(newWord)){
                word.put(newWord, 1);
            }else{
                num = word.get(newWord);
                word.remove(newWord);
                word.put(newWord, num + 1);
            }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            newWord = sc.next();
            if(!word.containsKey(newWord)){
                word.put(newWord, 1);
            }else{
                num = word.get(newWord);
                word.remove(newWord);
                word.put(newWord, num + 1);
            }
        } {
            newWord = sc.next();
            if(!word.containsKey(newWord)){
                word.put(newWord, 1);
            }else{
                num = word.get(newWord);
                word.remove(newWord);
                word.put(newWord, num + 1);
            }
        } newWord = sc.next() newWord sc.next() sc.next sc if(!word.containsKey(newWord)){
                word.put(newWord, 1);
            }else{
                num = word.get(newWord);
                word.remove(newWord);
                word.put(newWord, num + 1);
            } !word.containsKey(newWord) word.containsKey(newWord) word.containsKey word newWord {
                word.put(newWord, 1);
            } word.put(newWord, 1) word.put word newWord 1 {
                num = word.get(newWord);
                word.remove(newWord);
                word.put(newWord, num + 1);
            } num = word.get(newWord) num word.get(newWord) word.get word newWord word.remove(newWord) word.remove word newWord word.put(newWord, num + 1) word.put word newWord num + 1 num 1 int mostNum = 0; mostNum 0 int current = 0; current 0 Iterator<Integer> it = word.values().iterator(); it word.values().iterator() word.values().iterator word.values() word.values word while(it.hasNext()) {
            current = it.next();
            if(mostNum< current) {
                mostNum = current;
            }
        } it.hasNext() it.hasNext it {
            current = it.next();
            if(mostNum< current) {
                mostNum = current;
            }
        } current = it.next() current it.next() it.next it if(mostNum< current) {
                mostNum = current;
            } mostNum< current mostNum current {
                mostNum = current;
            } mostNum = current mostNum current String[] allWords = new String[n]; allWords new String[n] n Iterator<String> it3 = word.keySet().iterator(); it3 word.keySet().iterator() word.keySet().iterator word.keySet() word.keySet word int q = 0; q 0 while(it3.hasNext()) {
            allWords[q] = it3.next();
            q++;
        } it3.hasNext() it3.hasNext it3 {
            allWords[q] = it3.next();
            q++;
        } allWords[q] = it3.next() allWords[q] allWords q it3.next() it3.next it3 q++ q ArrayList<String> mostWords = new ArrayList<String>(); mostWords new ArrayList<String>() for(int i = 0; i < q; i++) {
            if(word.get(allWords[i]) == mostNum) {
                mostWords.add(allWords[i]);
            }
        } int i = 0; int i = 0; i 0 i < q i q i++ i++ i {
            if(word.get(allWords[i]) == mostNum) {
                mostWords.add(allWords[i]);
            }
        } {
            if(word.get(allWords[i]) == mostNum) {
                mostWords.add(allWords[i]);
            }
        } if(word.get(allWords[i]) == mostNum) {
                mostWords.add(allWords[i]);
            } word.get(allWords[i]) == mostNum word.get(allWords[i]) word.get word allWords[i] allWords i mostNum {
                mostWords.add(allWords[i]);
            } mostWords.add(allWords[i]) mostWords.add mostWords allWords[i] allWords i Collections.sort(mostWords) Collections.sort Collections mostWords for(int a = 0; a < mostWords.size(); a++) {
            System.out.println(mostWords.get(a));
        } int a = 0; int a = 0; a 0 a < mostWords.size() a mostWords.size() mostWords.size mostWords a++ a++ a {
            System.out.println(mostWords.get(a));
        } {
            System.out.println(mostWords.get(a));
        } System.out.println(mostWords.get(a)) System.out.println System.out System System.out mostWords.get(a) mostWords.get mostWords a String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Map<String, Integer> word = new HashMap<String, Integer>();
        String newWord;
        int num = 0;
        for(int i = 0; i < n; i++) {
            newWord = sc.next();
            if(!word.containsKey(newWord)){
                word.put(newWord, 1);
            }else{
                num = word.get(newWord);
                word.remove(newWord);
                word.put(newWord, num + 1);
            }
        }
        int mostNum = 0;
        int current = 0;
        Iterator<Integer> it = word.values().iterator();
        while(it.hasNext()) {
            current = it.next();
            if(mostNum< current) {
                mostNum = current;
            }
        }

        String[] allWords = new String[n];
        Iterator<String> it3 = word.keySet().iterator();
        int q = 0;
        while(it3.hasNext()) {
            allWords[q] = it3.next();
            q++;
        }

        ArrayList<String> mostWords = new ArrayList<String>();
        for(int i = 0; i < q; i++) {
            if(word.get(allWords[i]) == mostNum) {
                mostWords.add(allWords[i]);
            }
        }
        Collections.sort(mostWords);
        for(int a = 0; a < mostWords.size(); a++) {
            System.out.println(mostWords.get(a));
        }
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Map<String, Integer> word = new HashMap<String, Integer>();
        String newWord;
        int num = 0;
        for(int i = 0; i < n; i++) {
            newWord = sc.next();
            if(!word.containsKey(newWord)){
                word.put(newWord, 1);
            }else{
                num = word.get(newWord);
                word.remove(newWord);
                word.put(newWord, num + 1);
            }
        }
        int mostNum = 0;
        int current = 0;
        Iterator<Integer> it = word.values().iterator();
        while(it.hasNext()) {
            current = it.next();
            if(mostNum< current) {
                mostNum = current;
            }
        }

        String[] allWords = new String[n];
        Iterator<String> it3 = word.keySet().iterator();
        int q = 0;
        while(it3.hasNext()) {
            allWords[q] = it3.next();
            q++;
        }

        ArrayList<String> mostWords = new ArrayList<String>();
        for(int i = 0; i < q; i++) {
            if(word.get(allWords[i]) == mostNum) {
                mostWords.add(allWords[i]);
            }
        }
        Collections.sort(mostWords);
        for(int a = 0; a < mostWords.size(); a++) {
            System.out.println(mostWords.get(a));
        }
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Map<String, Integer> word = new HashMap<String, Integer>();
        String newWord;
        int num = 0;
        for(int i = 0; i < n; i++) {
            newWord = sc.next();
            if(!word.containsKey(newWord)){
                word.put(newWord, 1);
            }else{
                num = word.get(newWord);
                word.remove(newWord);
                word.put(newWord, num + 1);
            }
        }
        int mostNum = 0;
        int current = 0;
        Iterator<Integer> it = word.values().iterator();
        while(it.hasNext()) {
            current = it.next();
            if(mostNum< current) {
                mostNum = current;
            }
        }

        String[] allWords = new String[n];
        Iterator<String> it3 = word.keySet().iterator();
        int q = 0;
        while(it3.hasNext()) {
            allWords[q] = it3.next();
            q++;
        }

        ArrayList<String> mostWords = new ArrayList<String>();
        for(int i = 0; i < q; i++) {
            if(word.get(allWords[i]) == mostNum) {
                mostWords.add(allWords[i]);
            }
        }
        Collections.sort(mostWords);
        for(int a = 0; a < mostWords.size(); a++) {
            System.out.println(mostWords.get(a));
        }
    }
}