import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Map<String, Integer> countWord = new HashMap<>();
        Set<String> results = new TreeSet<>();
        int maxNum = 1;
        for(int i = 0; i < n; i++) {
            String str = sc.next();
            if(countWord.containsKey(str)) {
                int num = countWord.get(str) + 1;
                countWord.put(str, num);
                maxNum = Math.max(maxNum, num);
            }
            else countWord.put(str, 1);
        }
        for(String key : countWord.keySet()) {
            if(countWord.get(key) == maxNum) results.add(key);
        }

        for(String ans : results) System.out.println(ans);
    }
} import java.util.HashMap; HashMap java.util import java.util.Map; Map java.util import java.util.Scanner; Scanner java.util import java.util.Set; Set java.util import java.util.TreeSet; TreeSet java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Map<String, Integer> countWord = new HashMap<>();
        Set<String> results = new TreeSet<>();
        int maxNum = 1;
        for(int i = 0; i < n; i++) {
            String str = sc.next();
            if(countWord.containsKey(str)) {
                int num = countWord.get(str) + 1;
                countWord.put(str, num);
                maxNum = Math.max(maxNum, num);
            }
            else countWord.put(str, 1);
        }
        for(String key : countWord.keySet()) {
            if(countWord.get(key) == maxNum) results.add(key);
        }

        for(String ans : results) System.out.println(ans);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Map<String, Integer> countWord = new HashMap<>();
        Set<String> results = new TreeSet<>();
        int maxNum = 1;
        for(int i = 0; i < n; i++) {
            String str = sc.next();
            if(countWord.containsKey(str)) {
                int num = countWord.get(str) + 1;
                countWord.put(str, num);
                maxNum = Math.max(maxNum, num);
            }
            else countWord.put(str, 1);
        }
        for(String key : countWord.keySet()) {
            if(countWord.get(key) == maxNum) results.add(key);
        }

        for(String ans : results) System.out.println(ans);
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Map<String, Integer> countWord = new HashMap<>();
        Set<String> results = new TreeSet<>();
        int maxNum = 1;
        for(int i = 0; i < n; i++) {
            String str = sc.next();
            if(countWord.containsKey(str)) {
                int num = countWord.get(str) + 1;
                countWord.put(str, num);
                maxNum = Math.max(maxNum, num);
            }
            else countWord.put(str, 1);
        }
        for(String key : countWord.keySet()) {
            if(countWord.get(key) == maxNum) results.add(key);
        }

        for(String ans : results) System.out.println(ans);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc Map<String, Integer> countWord = new HashMap<>(); countWord new HashMap<>() Set<String> results = new TreeSet<>(); results new TreeSet<>() int maxNum = 1; maxNum 1 for(int i = 0; i < n; i++) {
            String str = sc.next();
            if(countWord.containsKey(str)) {
                int num = countWord.get(str) + 1;
                countWord.put(str, num);
                maxNum = Math.max(maxNum, num);
            }
            else countWord.put(str, 1);
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            String str = sc.next();
            if(countWord.containsKey(str)) {
                int num = countWord.get(str) + 1;
                countWord.put(str, num);
                maxNum = Math.max(maxNum, num);
            }
            else countWord.put(str, 1);
        } {
            String str = sc.next();
            if(countWord.containsKey(str)) {
                int num = countWord.get(str) + 1;
                countWord.put(str, num);
                maxNum = Math.max(maxNum, num);
            }
            else countWord.put(str, 1);
        } String str = sc.next(); str sc.next() sc.next sc if(countWord.containsKey(str)) {
                int num = countWord.get(str) + 1;
                countWord.put(str, num);
                maxNum = Math.max(maxNum, num);
            }
            else countWord.put(str, 1); countWord.containsKey(str) countWord.containsKey countWord str {
                int num = countWord.get(str) + 1;
                countWord.put(str, num);
                maxNum = Math.max(maxNum, num);
            } int num = countWord.get(str) + 1; num countWord.get(str) + 1 countWord.get(str) countWord.get countWord str 1 countWord.put(str, num) countWord.put countWord str num maxNum = Math.max(maxNum, num) maxNum Math.max(maxNum, num) Math.max Math maxNum num countWord.put(str, 1) countWord.put countWord str 1 for(String key : countWord.keySet()) {
            if(countWord.get(key) == maxNum) results.add(key);
        } String key countWord.keySet() countWord.keySet countWord {
            if(countWord.get(key) == maxNum) results.add(key);
        } {
            if(countWord.get(key) == maxNum) results.add(key);
        } if(countWord.get(key) == maxNum) results.add(key); countWord.get(key) == maxNum countWord.get(key) countWord.get countWord key maxNum results.add(key) results.add results key for(String ans : results) System.out.println(ans); String ans results System.out.println(ans); System.out.println(ans) System.out.println System.out System System.out ans 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> countWord = new HashMap<>();
        Set<String> results = new TreeSet<>();
        int maxNum = 1;
        for(int i = 0; i < n; i++) {
            String str = sc.next();
            if(countWord.containsKey(str)) {
                int num = countWord.get(str) + 1;
                countWord.put(str, num);
                maxNum = Math.max(maxNum, num);
            }
            else countWord.put(str, 1);
        }
        for(String key : countWord.keySet()) {
            if(countWord.get(key) == maxNum) results.add(key);
        }

        for(String ans : results) System.out.println(ans);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Map<String, Integer> countWord = new HashMap<>();
        Set<String> results = new TreeSet<>();
        int maxNum = 1;
        for(int i = 0; i < n; i++) {
            String str = sc.next();
            if(countWord.containsKey(str)) {
                int num = countWord.get(str) + 1;
                countWord.put(str, num);
                maxNum = Math.max(maxNum, num);
            }
            else countWord.put(str, 1);
        }
        for(String key : countWord.keySet()) {
            if(countWord.get(key) == maxNum) results.add(key);
        }

        for(String ans : results) System.out.println(ans);
    }
} Main
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Map<String, Integer> countWord = new HashMap<>();
        Set<String> results = new TreeSet<>();
        int maxNum = 1;
        for(int i = 0; i < n; i++) {
            String str = sc.next();
            if(countWord.containsKey(str)) {
                int num = countWord.get(str) + 1;
                countWord.put(str, num);
                maxNum = Math.max(maxNum, num);
            }
            else countWord.put(str, 1);
        }
        for(String key : countWord.keySet()) {
            if(countWord.get(key) == maxNum) results.add(key);
        }

        for(String ans : results) System.out.println(ans);
    }
}