import java.util.*;

public class Main {
    public static void main(String[] args) {
        new Main().run();
    }

    private void run() {
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        Map<String, Integer> map = new HashMap<>();
        int max = 0;
        for(int i = 0; i < N; i++) {
            String key = scanner.next();
            if(map.containsKey(key)) {
                map.put(key, map.get(key) + 1);
                max = Math.max(max, map.get(key));
            }else{
                map.put(key, 1);
                max = Math.max(max, 1);
            }
        }

        List<String> listOfCountryNames = new ArrayList<>();
        for (String key : map.keySet()) {
            if(map.get(key) == max) {
                listOfCountryNames.add(key);
            }
        }

        java.util.Collections.sort(listOfCountryNames);

        for (String name : listOfCountryNames) {
            System.out.println(name);
        }

    }
}

/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz