import java.util.ArrayList;
import java.util.Arrays;
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 sc = new Scanner(System.in);
		int n = sc.nextInt();
		String[] s = new String[n];
		for (int i = 0; i < n; i++) {
			s[i] = sc.next();
		}
		Arrays.sort(s);
		String name = s[0];
		int count = 0;
		int max = 0;
		Map<String, Integer> lists = new HashMap<String, Integer>();
		for (int i = 0; i < n; i++) {
			if (name.equals(s[i])) {
				count++;
			} else {
				lists.put(name, count);
				count = 1;
				name = s[i];
			}
			max = Math.max(max, count);
		}
		lists.put(name, count);
		List<String> ans = new ArrayList<String>();
		for (String key : lists.keySet()) {
			if (lists.get(key) == max) {
				ans.add(key);
			}
		}
		Collections.sort(ans);
		for(int i=0;i<ans.size();i++) {
			System.out.println(ans.get(i));
		}
	}
} import java.util.ArrayList; ArrayList java.util import java.util.Arrays; Arrays 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 sc = new Scanner(System.in);
		int n = sc.nextInt();
		String[] s = new String[n];
		for (int i = 0; i < n; i++) {
			s[i] = sc.next();
		}
		Arrays.sort(s);
		String name = s[0];
		int count = 0;
		int max = 0;
		Map<String, Integer> lists = new HashMap<String, Integer>();
		for (int i = 0; i < n; i++) {
			if (name.equals(s[i])) {
				count++;
			} else {
				lists.put(name, count);
				count = 1;
				name = s[i];
			}
			max = Math.max(max, count);
		}
		lists.put(name, count);
		List<String> ans = new ArrayList<String>();
		for (String key : lists.keySet()) {
			if (lists.get(key) == max) {
				ans.add(key);
			}
		}
		Collections.sort(ans);
		for(int i=0;i<ans.size();i++) {
			System.out.println(ans.get(i));
		}
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		String[] s = new String[n];
		for (int i = 0; i < n; i++) {
			s[i] = sc.next();
		}
		Arrays.sort(s);
		String name = s[0];
		int count = 0;
		int max = 0;
		Map<String, Integer> lists = new HashMap<String, Integer>();
		for (int i = 0; i < n; i++) {
			if (name.equals(s[i])) {
				count++;
			} else {
				lists.put(name, count);
				count = 1;
				name = s[i];
			}
			max = Math.max(max, count);
		}
		lists.put(name, count);
		List<String> ans = new ArrayList<String>();
		for (String key : lists.keySet()) {
			if (lists.get(key) == max) {
				ans.add(key);
			}
		}
		Collections.sort(ans);
		for(int i=0;i<ans.size();i++) {
			System.out.println(ans.get(i));
		}
	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		String[] s = new String[n];
		for (int i = 0; i < n; i++) {
			s[i] = sc.next();
		}
		Arrays.sort(s);
		String name = s[0];
		int count = 0;
		int max = 0;
		Map<String, Integer> lists = new HashMap<String, Integer>();
		for (int i = 0; i < n; i++) {
			if (name.equals(s[i])) {
				count++;
			} else {
				lists.put(name, count);
				count = 1;
				name = s[i];
			}
			max = Math.max(max, count);
		}
		lists.put(name, count);
		List<String> ans = new ArrayList<String>();
		for (String key : lists.keySet()) {
			if (lists.get(key) == max) {
				ans.add(key);
			}
		}
		Collections.sort(ans);
		for(int i=0;i<ans.size();i++) {
			System.out.println(ans.get(i));
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc String[] s = new String[n]; s new String[n] n for (int i = 0; i < n; i++) {
			s[i] = sc.next();
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			s[i] = sc.next();
		} {
			s[i] = sc.next();
		} s[i] = sc.next() s[i] s i sc.next() sc.next sc Arrays.sort(s) Arrays.sort Arrays s String name = s[0]; name s[0] s 0 int count = 0; count 0 int max = 0; max 0 Map<String, Integer> lists = new HashMap<String, Integer>(); lists new HashMap<String, Integer>() for (int i = 0; i < n; i++) {
			if (name.equals(s[i])) {
				count++;
			} else {
				lists.put(name, count);
				count = 1;
				name = s[i];
			}
			max = Math.max(max, count);
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			if (name.equals(s[i])) {
				count++;
			} else {
				lists.put(name, count);
				count = 1;
				name = s[i];
			}
			max = Math.max(max, count);
		} {
			if (name.equals(s[i])) {
				count++;
			} else {
				lists.put(name, count);
				count = 1;
				name = s[i];
			}
			max = Math.max(max, count);
		} if (name.equals(s[i])) {
				count++;
			} else {
				lists.put(name, count);
				count = 1;
				name = s[i];
			} name.equals(s[i]) name.equals name s[i] s i {
				count++;
			} count++ count {
				lists.put(name, count);
				count = 1;
				name = s[i];
			} lists.put(name, count) lists.put lists name count count = 1 count 1 name = s[i] name s[i] s i max = Math.max(max, count) max Math.max(max, count) Math.max Math max count lists.put(name, count) lists.put lists name count List<String> ans = new ArrayList<String>(); ans new ArrayList<String>() for (String key : lists.keySet()) {
			if (lists.get(key) == max) {
				ans.add(key);
			}
		} String key lists.keySet() lists.keySet lists {
			if (lists.get(key) == max) {
				ans.add(key);
			}
		} {
			if (lists.get(key) == max) {
				ans.add(key);
			}
		} if (lists.get(key) == max) {
				ans.add(key);
			} lists.get(key) == max lists.get(key) lists.get lists key max {
				ans.add(key);
			} ans.add(key) ans.add ans key Collections.sort(ans) Collections.sort Collections ans for(int i=0;i<ans.size();i++) {
			System.out.println(ans.get(i));
		} int i=0; int i=0; i 0 i<ans.size() i ans.size() ans.size ans i++ i++ i {
			System.out.println(ans.get(i));
		} {
			System.out.println(ans.get(i));
		} System.out.println(ans.get(i)) System.out.println System.out System System.out ans.get(i) ans.get ans i String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		String[] s = new String[n];
		for (int i = 0; i < n; i++) {
			s[i] = sc.next();
		}
		Arrays.sort(s);
		String name = s[0];
		int count = 0;
		int max = 0;
		Map<String, Integer> lists = new HashMap<String, Integer>();
		for (int i = 0; i < n; i++) {
			if (name.equals(s[i])) {
				count++;
			} else {
				lists.put(name, count);
				count = 1;
				name = s[i];
			}
			max = Math.max(max, count);
		}
		lists.put(name, count);
		List<String> ans = new ArrayList<String>();
		for (String key : lists.keySet()) {
			if (lists.get(key) == max) {
				ans.add(key);
			}
		}
		Collections.sort(ans);
		for(int i=0;i<ans.size();i++) {
			System.out.println(ans.get(i));
		}
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		String[] s = new String[n];
		for (int i = 0; i < n; i++) {
			s[i] = sc.next();
		}
		Arrays.sort(s);
		String name = s[0];
		int count = 0;
		int max = 0;
		Map<String, Integer> lists = new HashMap<String, Integer>();
		for (int i = 0; i < n; i++) {
			if (name.equals(s[i])) {
				count++;
			} else {
				lists.put(name, count);
				count = 1;
				name = s[i];
			}
			max = Math.max(max, count);
		}
		lists.put(name, count);
		List<String> ans = new ArrayList<String>();
		for (String key : lists.keySet()) {
			if (lists.get(key) == max) {
				ans.add(key);
			}
		}
		Collections.sort(ans);
		for(int i=0;i<ans.size();i++) {
			System.out.println(ans.get(i));
		}
	}
} Main
import java.util.ArrayList;
import java.util.Arrays;
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 sc = new Scanner(System.in);
		int n = sc.nextInt();
		String[] s = new String[n];
		for (int i = 0; i < n; i++) {
			s[i] = sc.next();
		}
		Arrays.sort(s);
		String name = s[0];
		int count = 0;
		int max = 0;
		Map<String, Integer> lists = new HashMap<String, Integer>();
		for (int i = 0; i < n; i++) {
			if (name.equals(s[i])) {
				count++;
			} else {
				lists.put(name, count);
				count = 1;
				name = s[i];
			}
			max = Math.max(max, count);
		}
		lists.put(name, count);
		List<String> ans = new ArrayList<String>();
		for (String key : lists.keySet()) {
			if (lists.get(key) == max) {
				ans.add(key);
			}
		}
		Collections.sort(ans);
		for(int i=0;i<ans.size();i++) {
			System.out.println(ans.get(i));
		}
	}
}