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

//AtCoder Beginner Contest 155
//C	Poll
public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());
		String[] S = new String[N];
		Map<String, Integer> count = new HashMap<>();
		for (int i = 0; i < N; i++) {
			S[i] = sc.next();
			if (count.containsKey(S[i])) {
				count.put(S[i], count.get(S[i]).intValue() + 1);
			} else {
				count.put(S[i], 1);
			}
		}
		sc.close();

		int max = Collections.max(count.values());
		Set<String> set = new HashSet<>();
		for (Map.Entry<String, Integer> s : count.entrySet()) {
			if (s.getValue() == max) {
				set.add(s.getKey());
			}
		}
		List<String> l = new ArrayList<>(set);
		Collections.sort(l);
		for (String s : l) {
			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.HashSet; HashSet java.util import java.util.List; List java.util import java.util.Map; Map java.util import java.util.Scanner; Scanner java.util import java.util.Set; Set java.util public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());
		String[] S = new String[N];
		Map<String, Integer> count = new HashMap<>();
		for (int i = 0; i < N; i++) {
			S[i] = sc.next();
			if (count.containsKey(S[i])) {
				count.put(S[i], count.get(S[i]).intValue() + 1);
			} else {
				count.put(S[i], 1);
			}
		}
		sc.close();

		int max = Collections.max(count.values());
		Set<String> set = new HashSet<>();
		for (Map.Entry<String, Integer> s : count.entrySet()) {
			if (s.getValue() == max) {
				set.add(s.getKey());
			}
		}
		List<String> l = new ArrayList<>(set);
		Collections.sort(l);
		for (String s : l) {
			System.out.println(s);
		}
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());
		String[] S = new String[N];
		Map<String, Integer> count = new HashMap<>();
		for (int i = 0; i < N; i++) {
			S[i] = sc.next();
			if (count.containsKey(S[i])) {
				count.put(S[i], count.get(S[i]).intValue() + 1);
			} else {
				count.put(S[i], 1);
			}
		}
		sc.close();

		int max = Collections.max(count.values());
		Set<String> set = new HashSet<>();
		for (Map.Entry<String, Integer> s : count.entrySet()) {
			if (s.getValue() == max) {
				set.add(s.getKey());
			}
		}
		List<String> l = new ArrayList<>(set);
		Collections.sort(l);
		for (String s : l) {
			System.out.println(s);
		}
	} main {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());
		String[] S = new String[N];
		Map<String, Integer> count = new HashMap<>();
		for (int i = 0; i < N; i++) {
			S[i] = sc.next();
			if (count.containsKey(S[i])) {
				count.put(S[i], count.get(S[i]).intValue() + 1);
			} else {
				count.put(S[i], 1);
			}
		}
		sc.close();

		int max = Collections.max(count.values());
		Set<String> set = new HashSet<>();
		for (Map.Entry<String, Integer> s : count.entrySet()) {
			if (s.getValue() == max) {
				set.add(s.getKey());
			}
		}
		List<String> l = new ArrayList<>(set);
		Collections.sort(l);
		for (String s : l) {
			System.out.println(s);
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = Integer.parseInt(sc.next()); N Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc String[] S = new String[N]; S new String[N] N Map<String, Integer> count = new HashMap<>(); count new HashMap<>() for (int i = 0; i < N; i++) {
			S[i] = sc.next();
			if (count.containsKey(S[i])) {
				count.put(S[i], count.get(S[i]).intValue() + 1);
			} else {
				count.put(S[i], 1);
			}
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			S[i] = sc.next();
			if (count.containsKey(S[i])) {
				count.put(S[i], count.get(S[i]).intValue() + 1);
			} else {
				count.put(S[i], 1);
			}
		} {
			S[i] = sc.next();
			if (count.containsKey(S[i])) {
				count.put(S[i], count.get(S[i]).intValue() + 1);
			} else {
				count.put(S[i], 1);
			}
		} S[i] = sc.next() S[i] S i sc.next() sc.next sc if (count.containsKey(S[i])) {
				count.put(S[i], count.get(S[i]).intValue() + 1);
			} else {
				count.put(S[i], 1);
			} count.containsKey(S[i]) count.containsKey count S[i] S i {
				count.put(S[i], count.get(S[i]).intValue() + 1);
			} count.put(S[i], count.get(S[i]).intValue() + 1) count.put count S[i] S i count.get(S[i]).intValue() + 1 count.get(S[i]).intValue() count.get(S[i]).intValue count.get(S[i]) count.get count S[i] S i 1 {
				count.put(S[i], 1);
			} count.put(S[i], 1) count.put count S[i] S i 1 sc.close() sc.close sc int max = Collections.max(count.values()); max Collections.max(count.values()) Collections.max Collections count.values() count.values count Set<String> set = new HashSet<>(); set new HashSet<>() for (Map.Entry<String, Integer> s : count.entrySet()) {
			if (s.getValue() == max) {
				set.add(s.getKey());
			}
		} Map.Entry<String, Integer> s count.entrySet() count.entrySet count {
			if (s.getValue() == max) {
				set.add(s.getKey());
			}
		} {
			if (s.getValue() == max) {
				set.add(s.getKey());
			}
		} if (s.getValue() == max) {
				set.add(s.getKey());
			} s.getValue() == max s.getValue() s.getValue s max {
				set.add(s.getKey());
			} set.add(s.getKey()) set.add set s.getKey() s.getKey s List<String> l = new ArrayList<>(set); l new ArrayList<>(set) Collections.sort(l) Collections.sort Collections l for (String s : l) {
			System.out.println(s);
		} String s l {
			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);
		int N = Integer.parseInt(sc.next());
		String[] S = new String[N];
		Map<String, Integer> count = new HashMap<>();
		for (int i = 0; i < N; i++) {
			S[i] = sc.next();
			if (count.containsKey(S[i])) {
				count.put(S[i], count.get(S[i]).intValue() + 1);
			} else {
				count.put(S[i], 1);
			}
		}
		sc.close();

		int max = Collections.max(count.values());
		Set<String> set = new HashSet<>();
		for (Map.Entry<String, Integer> s : count.entrySet()) {
			if (s.getValue() == max) {
				set.add(s.getKey());
			}
		}
		List<String> l = new ArrayList<>(set);
		Collections.sort(l);
		for (String s : l) {
			System.out.println(s);
		}
	}
} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());
		String[] S = new String[N];
		Map<String, Integer> count = new HashMap<>();
		for (int i = 0; i < N; i++) {
			S[i] = sc.next();
			if (count.containsKey(S[i])) {
				count.put(S[i], count.get(S[i]).intValue() + 1);
			} else {
				count.put(S[i], 1);
			}
		}
		sc.close();

		int max = Collections.max(count.values());
		Set<String> set = new HashSet<>();
		for (Map.Entry<String, Integer> s : count.entrySet()) {
			if (s.getValue() == max) {
				set.add(s.getKey());
			}
		}
		List<String> l = new ArrayList<>(set);
		Collections.sort(l);
		for (String s : l) {
			System.out.println(s);
		}
	}
} Main
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
import java.util.Set;

//AtCoder Beginner Contest 155
//C	Poll
public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());
		String[] S = new String[N];
		Map<String, Integer> count = new HashMap<>();
		for (int i = 0; i < N; i++) {
			S[i] = sc.next();
			if (count.containsKey(S[i])) {
				count.put(S[i], count.get(S[i]).intValue() + 1);
			} else {
				count.put(S[i], 1);
			}
		}
		sc.close();

		int max = Collections.max(count.values());
		Set<String> set = new HashSet<>();
		for (Map.Entry<String, Integer> s : count.entrySet()) {
			if (s.getValue() == max) {
				set.add(s.getKey());
			}
		}
		List<String> l = new ArrayList<>(set);
		Collections.sort(l);
		for (String s : l) {
			System.out.println(s);
		}
	}
}
