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 sc = new Scanner(System.in);
		int n = sc.nextInt(); int max = 1;
		Map<String, Integer> map = new HashMap<String, Integer>();
		int rem = 0;
		for (int i = 0; i < n; i++) {
			String s = sc.next();
			if(map.containsKey(s)) {
				rem = map.get(s)+1;
				map.replace(s, rem);
				max = Math.max(max,rem);
			}else {
				map.put(s, 1);
			}
		}
		List<String> list = new ArrayList<String>();
		for(String key : map.keySet()) {
			if(map.get(key) == max)list.add(key);
		}
		Collections.sort(list);
		for(String key : list) {
			System.out.println(key);
		}
		sc.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 sc = new Scanner(System.in);
		int n = sc.nextInt(); int max = 1;
		Map<String, Integer> map = new HashMap<String, Integer>();
		int rem = 0;
		for (int i = 0; i < n; i++) {
			String s = sc.next();
			if(map.containsKey(s)) {
				rem = map.get(s)+1;
				map.replace(s, rem);
				max = Math.max(max,rem);
			}else {
				map.put(s, 1);
			}
		}
		List<String> list = new ArrayList<String>();
		for(String key : map.keySet()) {
			if(map.get(key) == max)list.add(key);
		}
		Collections.sort(list);
		for(String key : list) {
			System.out.println(key);
		}
		sc.close();
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt(); int max = 1;
		Map<String, Integer> map = new HashMap<String, Integer>();
		int rem = 0;
		for (int i = 0; i < n; i++) {
			String s = sc.next();
			if(map.containsKey(s)) {
				rem = map.get(s)+1;
				map.replace(s, rem);
				max = Math.max(max,rem);
			}else {
				map.put(s, 1);
			}
		}
		List<String> list = new ArrayList<String>();
		for(String key : map.keySet()) {
			if(map.get(key) == max)list.add(key);
		}
		Collections.sort(list);
		for(String key : list) {
			System.out.println(key);
		}
		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt(); int max = 1;
		Map<String, Integer> map = new HashMap<String, Integer>();
		int rem = 0;
		for (int i = 0; i < n; i++) {
			String s = sc.next();
			if(map.containsKey(s)) {
				rem = map.get(s)+1;
				map.replace(s, rem);
				max = Math.max(max,rem);
			}else {
				map.put(s, 1);
			}
		}
		List<String> list = new ArrayList<String>();
		for(String key : map.keySet()) {
			if(map.get(key) == max)list.add(key);
		}
		Collections.sort(list);
		for(String key : list) {
			System.out.println(key);
		}
		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int max = 1; max 1 Map<String, Integer> map = new HashMap<String, Integer>(); map new HashMap<String, Integer>() int rem = 0; rem 0 for (int i = 0; i < n; i++) {
			String s = sc.next();
			if(map.containsKey(s)) {
				rem = map.get(s)+1;
				map.replace(s, rem);
				max = Math.max(max,rem);
			}else {
				map.put(s, 1);
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			String s = sc.next();
			if(map.containsKey(s)) {
				rem = map.get(s)+1;
				map.replace(s, rem);
				max = Math.max(max,rem);
			}else {
				map.put(s, 1);
			}
		} {
			String s = sc.next();
			if(map.containsKey(s)) {
				rem = map.get(s)+1;
				map.replace(s, rem);
				max = Math.max(max,rem);
			}else {
				map.put(s, 1);
			}
		} String s = sc.next(); s sc.next() sc.next sc if(map.containsKey(s)) {
				rem = map.get(s)+1;
				map.replace(s, rem);
				max = Math.max(max,rem);
			}else {
				map.put(s, 1);
			} map.containsKey(s) map.containsKey map s {
				rem = map.get(s)+1;
				map.replace(s, rem);
				max = Math.max(max,rem);
			} rem = map.get(s)+1 rem map.get(s)+1 map.get(s) map.get map s 1 map.replace(s, rem) map.replace map s rem max = Math.max(max,rem) max Math.max(max,rem) Math.max Math max rem {
				map.put(s, 1);
			} map.put(s, 1) map.put map s 1 List<String> list = new ArrayList<String>(); list new ArrayList<String>() for(String key : map.keySet()) {
			if(map.get(key) == max)list.add(key);
		} String key map.keySet() map.keySet map {
			if(map.get(key) == max)list.add(key);
		} {
			if(map.get(key) == max)list.add(key);
		} if(map.get(key) == max)list.add(key); map.get(key) == max map.get(key) map.get map key max list.add(key) list.add list key Collections.sort(list) Collections.sort Collections list for(String key : list) {
			System.out.println(key);
		} String key list {
			System.out.println(key);
		} {
			System.out.println(key);
		} System.out.println(key) System.out.println System.out System System.out key sc.close() sc.close sc String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt(); int max = 1;
		Map<String, Integer> map = new HashMap<String, Integer>();
		int rem = 0;
		for (int i = 0; i < n; i++) {
			String s = sc.next();
			if(map.containsKey(s)) {
				rem = map.get(s)+1;
				map.replace(s, rem);
				max = Math.max(max,rem);
			}else {
				map.put(s, 1);
			}
		}
		List<String> list = new ArrayList<String>();
		for(String key : map.keySet()) {
			if(map.get(key) == max)list.add(key);
		}
		Collections.sort(list);
		for(String key : list) {
			System.out.println(key);
		}
		sc.close();
	}
} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt(); int max = 1;
		Map<String, Integer> map = new HashMap<String, Integer>();
		int rem = 0;
		for (int i = 0; i < n; i++) {
			String s = sc.next();
			if(map.containsKey(s)) {
				rem = map.get(s)+1;
				map.replace(s, rem);
				max = Math.max(max,rem);
			}else {
				map.put(s, 1);
			}
		}
		List<String> list = new ArrayList<String>();
		for(String key : map.keySet()) {
			if(map.get(key) == max)list.add(key);
		}
		Collections.sort(list);
		for(String key : list) {
			System.out.println(key);
		}
		sc.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 sc = new Scanner(System.in);
		int n = sc.nextInt(); int max = 1;
		Map<String, Integer> map = new HashMap<String, Integer>();
		int rem = 0;
		for (int i = 0; i < n; i++) {
			String s = sc.next();
			if(map.containsKey(s)) {
				rem = map.get(s)+1;
				map.replace(s, rem);
				max = Math.max(max,rem);
			}else {
				map.put(s, 1);
			}
		}
		List<String> list = new ArrayList<String>();
		for(String key : map.keySet()) {
			if(map.get(key) == max)list.add(key);
		}
		Collections.sort(list);
		for(String key : list) {
			System.out.println(key);
		}
		sc.close();
	}
}