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

public class Main {

	public static void main(String[] args) {

	Scanner sca = new Scanner(System.in);
	int n = sca.nextInt();
	String[] str = new String[n];
	int temp = 0;
	int max = 0;
	List<String> smallstr = new ArrayList<>();


	Map<String, Integer> map = new HashMap<>();
	for(int i = 0; i < n; i++) {
		str[i] = sca.next();

		if(i == 0) {
			map.put(str[i], 1);
		}

		if(map.containsKey(str[i]) == true && i > 0) {
			temp = map.get(str[i]);
			temp++;
			map.put(str[i], temp);
		}
		else if(map.containsKey(str[i]) != true && i > 0) {
			map.put(str[i], 1);
		}
	}

	for (int val : map.values()) {
		if(val > max) {
			max = val;
		}
	}

	for (String key : map.keySet()) {
		if(map.get(key) == max) {
			smallstr.add(key);
		}
	}

	Collections.sort(smallstr);
	for(String result : smallstr) {
		System.out.println(result);
	}
	// 後始末
	sca.close();
	}
} import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections java.util import java.util.HashMap; HashMap java.util import java.util.List; List java.util import java.util.Map; Map java.util import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {

	Scanner sca = new Scanner(System.in);
	int n = sca.nextInt();
	String[] str = new String[n];
	int temp = 0;
	int max = 0;
	List<String> smallstr = new ArrayList<>();


	Map<String, Integer> map = new HashMap<>();
	for(int i = 0; i < n; i++) {
		str[i] = sca.next();

		if(i == 0) {
			map.put(str[i], 1);
		}

		if(map.containsKey(str[i]) == true && i > 0) {
			temp = map.get(str[i]);
			temp++;
			map.put(str[i], temp);
		}
		else if(map.containsKey(str[i]) != true && i > 0) {
			map.put(str[i], 1);
		}
	}

	for (int val : map.values()) {
		if(val > max) {
			max = val;
		}
	}

	for (String key : map.keySet()) {
		if(map.get(key) == max) {
			smallstr.add(key);
		}
	}

	Collections.sort(smallstr);
	for(String result : smallstr) {
		System.out.println(result);
	}
	// 後始末
	sca.close();
	}
} Main public static void main(String[] args) {

	Scanner sca = new Scanner(System.in);
	int n = sca.nextInt();
	String[] str = new String[n];
	int temp = 0;
	int max = 0;
	List<String> smallstr = new ArrayList<>();


	Map<String, Integer> map = new HashMap<>();
	for(int i = 0; i < n; i++) {
		str[i] = sca.next();

		if(i == 0) {
			map.put(str[i], 1);
		}

		if(map.containsKey(str[i]) == true && i > 0) {
			temp = map.get(str[i]);
			temp++;
			map.put(str[i], temp);
		}
		else if(map.containsKey(str[i]) != true && i > 0) {
			map.put(str[i], 1);
		}
	}

	for (int val : map.values()) {
		if(val > max) {
			max = val;
		}
	}

	for (String key : map.keySet()) {
		if(map.get(key) == max) {
			smallstr.add(key);
		}
	}

	Collections.sort(smallstr);
	for(String result : smallstr) {
		System.out.println(result);
	}
	// 後始末
	sca.close();
	} main {

	Scanner sca = new Scanner(System.in);
	int n = sca.nextInt();
	String[] str = new String[n];
	int temp = 0;
	int max = 0;
	List<String> smallstr = new ArrayList<>();


	Map<String, Integer> map = new HashMap<>();
	for(int i = 0; i < n; i++) {
		str[i] = sca.next();

		if(i == 0) {
			map.put(str[i], 1);
		}

		if(map.containsKey(str[i]) == true && i > 0) {
			temp = map.get(str[i]);
			temp++;
			map.put(str[i], temp);
		}
		else if(map.containsKey(str[i]) != true && i > 0) {
			map.put(str[i], 1);
		}
	}

	for (int val : map.values()) {
		if(val > max) {
			max = val;
		}
	}

	for (String key : map.keySet()) {
		if(map.get(key) == max) {
			smallstr.add(key);
		}
	}

	Collections.sort(smallstr);
	for(String result : smallstr) {
		System.out.println(result);
	}
	// 後始末
	sca.close();
	} Scanner sca = new Scanner(System.in); sca new Scanner(System.in) int n = sca.nextInt(); n sca.nextInt() sca.nextInt sca String[] str = new String[n]; str new String[n] n int temp = 0; temp 0 int max = 0; max 0 List<String> smallstr = new ArrayList<>(); smallstr new ArrayList<>() Map<String, Integer> map = new HashMap<>(); map new HashMap<>() for(int i = 0; i < n; i++) {
		str[i] = sca.next();

		if(i == 0) {
			map.put(str[i], 1);
		}

		if(map.containsKey(str[i]) == true && i > 0) {
			temp = map.get(str[i]);
			temp++;
			map.put(str[i], temp);
		}
		else if(map.containsKey(str[i]) != true && i > 0) {
			map.put(str[i], 1);
		}
	} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
		str[i] = sca.next();

		if(i == 0) {
			map.put(str[i], 1);
		}

		if(map.containsKey(str[i]) == true && i > 0) {
			temp = map.get(str[i]);
			temp++;
			map.put(str[i], temp);
		}
		else if(map.containsKey(str[i]) != true && i > 0) {
			map.put(str[i], 1);
		}
	} {
		str[i] = sca.next();

		if(i == 0) {
			map.put(str[i], 1);
		}

		if(map.containsKey(str[i]) == true && i > 0) {
			temp = map.get(str[i]);
			temp++;
			map.put(str[i], temp);
		}
		else if(map.containsKey(str[i]) != true && i > 0) {
			map.put(str[i], 1);
		}
	} str[i] = sca.next() str[i] str i sca.next() sca.next sca if(i == 0) {
			map.put(str[i], 1);
		} i == 0 i 0 {
			map.put(str[i], 1);
		} map.put(str[i], 1) map.put map str[i] str i 1 if(map.containsKey(str[i]) == true && i > 0) {
			temp = map.get(str[i]);
			temp++;
			map.put(str[i], temp);
		}
		else if(map.containsKey(str[i]) != true && i > 0) {
			map.put(str[i], 1);
		} map.containsKey(str[i]) == true && i > 0 map.containsKey(str[i]) == true map.containsKey(str[i]) map.containsKey map str[i] str i true i > 0 i 0 {
			temp = map.get(str[i]);
			temp++;
			map.put(str[i], temp);
		} temp = map.get(str[i]) temp map.get(str[i]) map.get map str[i] str i temp++ temp map.put(str[i], temp) map.put map str[i] str i temp if(map.containsKey(str[i]) != true && i > 0) {
			map.put(str[i], 1);
		} map.containsKey(str[i]) != true && i > 0 map.containsKey(str[i]) != true map.containsKey(str[i]) map.containsKey map str[i] str i true i > 0 i 0 {
			map.put(str[i], 1);
		} map.put(str[i], 1) map.put map str[i] str i 1 for (int val : map.values()) {
		if(val > max) {
			max = val;
		}
	} int val map.values() map.values map {
		if(val > max) {
			max = val;
		}
	} {
		if(val > max) {
			max = val;
		}
	} if(val > max) {
			max = val;
		} val > max val max {
			max = val;
		} max = val max val for (String key : map.keySet()) {
		if(map.get(key) == max) {
			smallstr.add(key);
		}
	} String key map.keySet() map.keySet map {
		if(map.get(key) == max) {
			smallstr.add(key);
		}
	} {
		if(map.get(key) == max) {
			smallstr.add(key);
		}
	} if(map.get(key) == max) {
			smallstr.add(key);
		} map.get(key) == max map.get(key) map.get map key max {
			smallstr.add(key);
		} smallstr.add(key) smallstr.add smallstr key Collections.sort(smallstr) Collections.sort Collections smallstr for(String result : smallstr) {
		System.out.println(result);
	} String result smallstr {
		System.out.println(result);
	} {
		System.out.println(result);
	} System.out.println(result) System.out.println System.out System System.out result sca.close() sca.close sca String[] args args public class Main {

	public static void main(String[] args) {

	Scanner sca = new Scanner(System.in);
	int n = sca.nextInt();
	String[] str = new String[n];
	int temp = 0;
	int max = 0;
	List<String> smallstr = new ArrayList<>();


	Map<String, Integer> map = new HashMap<>();
	for(int i = 0; i < n; i++) {
		str[i] = sca.next();

		if(i == 0) {
			map.put(str[i], 1);
		}

		if(map.containsKey(str[i]) == true && i > 0) {
			temp = map.get(str[i]);
			temp++;
			map.put(str[i], temp);
		}
		else if(map.containsKey(str[i]) != true && i > 0) {
			map.put(str[i], 1);
		}
	}

	for (int val : map.values()) {
		if(val > max) {
			max = val;
		}
	}

	for (String key : map.keySet()) {
		if(map.get(key) == max) {
			smallstr.add(key);
		}
	}

	Collections.sort(smallstr);
	for(String result : smallstr) {
		System.out.println(result);
	}
	// 後始末
	sca.close();
	}
} public class Main {

	public static void main(String[] args) {

	Scanner sca = new Scanner(System.in);
	int n = sca.nextInt();
	String[] str = new String[n];
	int temp = 0;
	int max = 0;
	List<String> smallstr = new ArrayList<>();


	Map<String, Integer> map = new HashMap<>();
	for(int i = 0; i < n; i++) {
		str[i] = sca.next();

		if(i == 0) {
			map.put(str[i], 1);
		}

		if(map.containsKey(str[i]) == true && i > 0) {
			temp = map.get(str[i]);
			temp++;
			map.put(str[i], temp);
		}
		else if(map.containsKey(str[i]) != true && i > 0) {
			map.put(str[i], 1);
		}
	}

	for (int val : map.values()) {
		if(val > max) {
			max = val;
		}
	}

	for (String key : map.keySet()) {
		if(map.get(key) == max) {
			smallstr.add(key);
		}
	}

	Collections.sort(smallstr);
	for(String result : smallstr) {
		System.out.println(result);
	}
	// 後始末
	sca.close();
	}
} Main
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

	Scanner sca = new Scanner(System.in);
	int n = sca.nextInt();
	String[] str = new String[n];
	int temp = 0;
	int max = 0;
	List<String> smallstr = new ArrayList<>();


	Map<String, Integer> map = new HashMap<>();
	for(int i = 0; i < n; i++) {
		str[i] = sca.next();

		if(i == 0) {
			map.put(str[i], 1);
		}

		if(map.containsKey(str[i]) == true && i > 0) {
			temp = map.get(str[i]);
			temp++;
			map.put(str[i], temp);
		}
		else if(map.containsKey(str[i]) != true && i > 0) {
			map.put(str[i], 1);
		}
	}

	for (int val : map.values()) {
		if(val > max) {
			max = val;
		}
	}

	for (String key : map.keySet()) {
		if(map.get(key) == max) {
			smallstr.add(key);
		}
	}

	Collections.sort(smallstr);
	for(String result : smallstr) {
		System.out.println(result);
	}
	// 後始末
	sca.close();
	}
}