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

public class Main {
	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
//		String s = sc.next();
		int n = sc.nextInt();

		Map<String, Integer> map = new HashMap<>();

		for(int i=0;i<n;i++) {
			String s = sc.next();
			if(!map.containsKey(s)) {
				map.put(s, 1);
			}else {
				int cnt = map.get(s) + 1;
				map.put(s,cnt);
			}
		}

		//TODO mapのキー,値でソートする方法
		int max = 0;
		ArrayList<String> ans = new ArrayList<>();

		for(Entry<String, Integer> m : map.entrySet()) {
			int val = m.getValue();
			if(val >= max) {
				max = val;
			}
		}

		for(Entry<String, Integer> m : map.entrySet()) {
			if(m.getValue() == max) {
				ans.add(m.getKey());
			}
		}

		Collections.sort(ans);

		for(String s:ans) {
			System.out.println(s);
		}

	}
} import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections java.util import java.util.HashMap; HashMap java.util import java.util.Map; Map java.util import java.util.Map.Entry; Entry java.util.Map import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
//		String s = sc.next();
		int n = sc.nextInt();

		Map<String, Integer> map = new HashMap<>();

		for(int i=0;i<n;i++) {
			String s = sc.next();
			if(!map.containsKey(s)) {
				map.put(s, 1);
			}else {
				int cnt = map.get(s) + 1;
				map.put(s,cnt);
			}
		}

		//TODO mapのキー,値でソートする方法
		int max = 0;
		ArrayList<String> ans = new ArrayList<>();

		for(Entry<String, Integer> m : map.entrySet()) {
			int val = m.getValue();
			if(val >= max) {
				max = val;
			}
		}

		for(Entry<String, Integer> m : map.entrySet()) {
			if(m.getValue() == max) {
				ans.add(m.getKey());
			}
		}

		Collections.sort(ans);

		for(String s:ans) {
			System.out.println(s);
		}

	}
} Main public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
//		String s = sc.next();
		int n = sc.nextInt();

		Map<String, Integer> map = new HashMap<>();

		for(int i=0;i<n;i++) {
			String s = sc.next();
			if(!map.containsKey(s)) {
				map.put(s, 1);
			}else {
				int cnt = map.get(s) + 1;
				map.put(s,cnt);
			}
		}

		//TODO mapのキー,値でソートする方法
		int max = 0;
		ArrayList<String> ans = new ArrayList<>();

		for(Entry<String, Integer> m : map.entrySet()) {
			int val = m.getValue();
			if(val >= max) {
				max = val;
			}
		}

		for(Entry<String, Integer> m : map.entrySet()) {
			if(m.getValue() == max) {
				ans.add(m.getKey());
			}
		}

		Collections.sort(ans);

		for(String s:ans) {
			System.out.println(s);
		}

	} main {

		Scanner sc = new Scanner(System.in);
//		String s = sc.next();
		int n = sc.nextInt();

		Map<String, Integer> map = new HashMap<>();

		for(int i=0;i<n;i++) {
			String s = sc.next();
			if(!map.containsKey(s)) {
				map.put(s, 1);
			}else {
				int cnt = map.get(s) + 1;
				map.put(s,cnt);
			}
		}

		//TODO mapのキー,値でソートする方法
		int max = 0;
		ArrayList<String> ans = new ArrayList<>();

		for(Entry<String, Integer> m : map.entrySet()) {
			int val = m.getValue();
			if(val >= max) {
				max = val;
			}
		}

		for(Entry<String, Integer> m : map.entrySet()) {
			if(m.getValue() == max) {
				ans.add(m.getKey());
			}
		}

		Collections.sort(ans);

		for(String s:ans) {
			System.out.println(s);
		}

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc Map<String, Integer> map = new HashMap<>(); map new HashMap<>() for(int i=0;i<n;i++) {
			String s = sc.next();
			if(!map.containsKey(s)) {
				map.put(s, 1);
			}else {
				int cnt = map.get(s) + 1;
				map.put(s,cnt);
			}
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			String s = sc.next();
			if(!map.containsKey(s)) {
				map.put(s, 1);
			}else {
				int cnt = map.get(s) + 1;
				map.put(s,cnt);
			}
		} {
			String s = sc.next();
			if(!map.containsKey(s)) {
				map.put(s, 1);
			}else {
				int cnt = map.get(s) + 1;
				map.put(s,cnt);
			}
		} String s = sc.next(); s sc.next() sc.next sc if(!map.containsKey(s)) {
				map.put(s, 1);
			}else {
				int cnt = map.get(s) + 1;
				map.put(s,cnt);
			} !map.containsKey(s) map.containsKey(s) map.containsKey map s {
				map.put(s, 1);
			} map.put(s, 1) map.put map s 1 {
				int cnt = map.get(s) + 1;
				map.put(s,cnt);
			} int cnt = map.get(s) + 1; cnt map.get(s) + 1 map.get(s) map.get map s 1 map.put(s,cnt) map.put map s cnt int max = 0; max 0 ArrayList<String> ans = new ArrayList<>(); ans new ArrayList<>() for(Entry<String, Integer> m : map.entrySet()) {
			int val = m.getValue();
			if(val >= max) {
				max = val;
			}
		} Entry<String, Integer> m map.entrySet() map.entrySet map {
			int val = m.getValue();
			if(val >= max) {
				max = val;
			}
		} {
			int val = m.getValue();
			if(val >= max) {
				max = val;
			}
		} int val = m.getValue(); val m.getValue() m.getValue m if(val >= max) {
				max = val;
			} val >= max val max {
				max = val;
			} max = val max val for(Entry<String, Integer> m : map.entrySet()) {
			if(m.getValue() == max) {
				ans.add(m.getKey());
			}
		} Entry<String, Integer> m map.entrySet() map.entrySet map {
			if(m.getValue() == max) {
				ans.add(m.getKey());
			}
		} {
			if(m.getValue() == max) {
				ans.add(m.getKey());
			}
		} if(m.getValue() == max) {
				ans.add(m.getKey());
			} m.getValue() == max m.getValue() m.getValue m max {
				ans.add(m.getKey());
			} ans.add(m.getKey()) ans.add ans m.getKey() m.getKey m Collections.sort(ans) Collections.sort Collections ans for(String s:ans) {
			System.out.println(s);
		} String s ans {
			System.out.println(s);
		} {
			System.out.println(s);
		} System.out.println(s) System.out.println System.out System System.out s String[] args args public class Main {
	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
//		String s = sc.next();
		int n = sc.nextInt();

		Map<String, Integer> map = new HashMap<>();

		for(int i=0;i<n;i++) {
			String s = sc.next();
			if(!map.containsKey(s)) {
				map.put(s, 1);
			}else {
				int cnt = map.get(s) + 1;
				map.put(s,cnt);
			}
		}

		//TODO mapのキー,値でソートする方法
		int max = 0;
		ArrayList<String> ans = new ArrayList<>();

		for(Entry<String, Integer> m : map.entrySet()) {
			int val = m.getValue();
			if(val >= max) {
				max = val;
			}
		}

		for(Entry<String, Integer> m : map.entrySet()) {
			if(m.getValue() == max) {
				ans.add(m.getKey());
			}
		}

		Collections.sort(ans);

		for(String s:ans) {
			System.out.println(s);
		}

	}
} public class Main {
	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
//		String s = sc.next();
		int n = sc.nextInt();

		Map<String, Integer> map = new HashMap<>();

		for(int i=0;i<n;i++) {
			String s = sc.next();
			if(!map.containsKey(s)) {
				map.put(s, 1);
			}else {
				int cnt = map.get(s) + 1;
				map.put(s,cnt);
			}
		}

		//TODO mapのキー,値でソートする方法
		int max = 0;
		ArrayList<String> ans = new ArrayList<>();

		for(Entry<String, Integer> m : map.entrySet()) {
			int val = m.getValue();
			if(val >= max) {
				max = val;
			}
		}

		for(Entry<String, Integer> m : map.entrySet()) {
			if(m.getValue() == max) {
				ans.add(m.getKey());
			}
		}

		Collections.sort(ans);

		for(String s:ans) {
			System.out.println(s);
		}

	}
} Main
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
//		String s = sc.next();
		int n = sc.nextInt();

		Map<String, Integer> map = new HashMap<>();

		for(int i=0;i<n;i++) {
			String s = sc.next();
			if(!map.containsKey(s)) {
				map.put(s, 1);
			}else {
				int cnt = map.get(s) + 1;
				map.put(s,cnt);
			}
		}

		//TODO mapのキー,値でソートする方法
		int max = 0;
		ArrayList<String> ans = new ArrayList<>();

		for(Entry<String, Integer> m : map.entrySet()) {
			int val = m.getValue();
			if(val >= max) {
				max = val;
			}
		}

		for(Entry<String, Integer> m : map.entrySet()) {
			if(m.getValue() == max) {
				ans.add(m.getKey());
			}
		}

		Collections.sort(ans);

		for(String s:ans) {
			System.out.println(s);
		}

	}
}
