import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		HashMap<String, Integer> s = new HashMap<>();
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int max = 0;
		String in ;
		for(int i=0;i<n;i++) {
			in = sc.next();
			if(s.containsKey(in)) {
				s.put(in, s.get(in)+1);
			}else {
				s.put(in, 1);
			}
			max = Math.max(max, s.get(in));
		}

		ArrayList<String> out = new ArrayList<>();
		for( String key : s.keySet()) {
			if(s.get(key) == max) {
				out.add(key);
			}
		}
		Collections.sort(out);
		for(int i=0;i<out.size();i++) {
			System.out.println(out.get(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