import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.nextLine());

//        sc.nextLine();
        String[] texts = new String[N];
        for (int n = 0; n < N; n++) {
            texts[n] = sc.nextLine();
        }

        HashMap<String, Integer> words = new HashMap<String, Integer>();
//        System.out.println("\n\n"+N);
        int max = 0;
        for (int n = 0; n < N; n++) {
            if (!words.keySet().contains(texts[n])){
                words.put(texts[n], 1);
            } else {
                words.put(texts[n], words.get(texts[n]) + 1);
            }

            if (max < words.get(texts[n])) max = words.get(texts[n]);
//            System.out.println(texts[n]);
//            words.add(texts[n]);
        }

        List<String> maxz = new ArrayList<String>();
//        System.out.println(max);

        for (String w:words.keySet()){
//            System.out.println(w+" "+words.get(w));
            if (max == words.get(w)){
                maxz.add(w);
            }
        }

//        List<String> sortedList = maxz.stream().sorted(Comparator.naturalOrder()).collect(Collectors.toList());
        Collections.sort(maxz);
        for (String i: maxz){
            System.out.println(i);
        }

    }
}
/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