import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Map.Entry;
import java.util.PriorityQueue;
import java.util.StringTokenizer;
import java.util.HashMap;

public class Main {
	static PrintWriter out;
	static Scanner sc;
	public static void main(String[] args) throws IOException{
		// TODO Auto-generated method stub
		sc = new Scanner(System.in);
		out = new PrintWriter(System.out);
		int n = sc.nextInt();
		HashMap<String, Integer> map = new HashMap<>();
		String vote;
		int max = 0;
		while(n-->0) {
			vote = sc.nextLine();
			int v = map.getOrDefault(vote, 0)+1;			
			map.put(vote, v);
			max = Math.max(max, v);
		}
		PriorityQueue<String> pq = new PriorityQueue<>();
		for(Entry<String, Integer>e:map.entrySet()) {
			if(e.getValue() == max) pq.add(e.getKey());
		}
		while(!pq.isEmpty())
			out.println(pq.poll());
		out.close();
	}
	static class Scanner{
		BufferedReader br;
		StringTokenizer st;
		public Scanner(InputStream in) {
			br = new BufferedReader(new InputStreamReader(in));			
		}
		private String next() throws IOException{
			while(st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}
		public int nextInt() throws NumberFormatException, IOException {
			return Integer.parseInt(next());
		}
		public long nextLong() throws NumberFormatException, IOException {
			return Long.parseLong(next());
		}
		public String nextLine() throws IOException {
			return br.readLine();
		}
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStream; InputStream java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.PrintWriter; PrintWriter java.io import java.util.Map.Entry; Entry java.util.Map import java.util.PriorityQueue; PriorityQueue java.util import java.util.StringTokenizer; StringTokenizer java.util import java.util.HashMap; HashMap java.util public class Main {
	static PrintWriter out;
	static Scanner sc;
	public static void main(String[] args) throws IOException{
		// TODO Auto-generated method stub
		sc = new Scanner(System.in);
		out = new PrintWriter(System.out);
		int n = sc.nextInt();
		HashMap<String, Integer> map = new HashMap<>();
		String vote;
		int max = 0;
		while(n-->0) {
			vote = sc.nextLine();
			int v = map.getOrDefault(vote, 0)+1;			
			map.put(vote, v);
			max = Math.max(max, v);
		}
		PriorityQueue<String> pq = new PriorityQueue<>();
		for(Entry<String, Integer>e:map.entrySet()) {
			if(e.getValue() == max) pq.add(e.getKey());
		}
		while(!pq.isEmpty())
			out.println(pq.poll());
		out.close();
	}
	static class Scanner{
		BufferedReader br;
		StringTokenizer st;
		public Scanner(InputStream in) {
			br = new BufferedReader(new InputStreamReader(in));			
		}
		private String next() throws IOException{
			while(st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}
		public int nextInt() throws NumberFormatException, IOException {
			return Integer.parseInt(next());
		}
		public long nextLong() throws NumberFormatException, IOException {
			return Long.parseLong(next());
		}
		public String nextLine() throws IOException {
			return br.readLine();
		}
	}
} Main static PrintWriter out; out static Scanner sc; sc public static void main(String[] args) throws IOException{
		// TODO Auto-generated method stub
		sc = new Scanner(System.in);
		out = new PrintWriter(System.out);
		int n = sc.nextInt();
		HashMap<String, Integer> map = new HashMap<>();
		String vote;
		int max = 0;
		while(n-->0) {
			vote = sc.nextLine();
			int v = map.getOrDefault(vote, 0)+1;			
			map.put(vote, v);
			max = Math.max(max, v);
		}
		PriorityQueue<String> pq = new PriorityQueue<>();
		for(Entry<String, Integer>e:map.entrySet()) {
			if(e.getValue() == max) pq.add(e.getKey());
		}
		while(!pq.isEmpty())
			out.println(pq.poll());
		out.close();
	} main {
		// TODO Auto-generated method stub
		sc = new Scanner(System.in);
		out = new PrintWriter(System.out);
		int n = sc.nextInt();
		HashMap<String, Integer> map = new HashMap<>();
		String vote;
		int max = 0;
		while(n-->0) {
			vote = sc.nextLine();
			int v = map.getOrDefault(vote, 0)+1;			
			map.put(vote, v);
			max = Math.max(max, v);
		}
		PriorityQueue<String> pq = new PriorityQueue<>();
		for(Entry<String, Integer>e:map.entrySet()) {
			if(e.getValue() == max) pq.add(e.getKey());
		}
		while(!pq.isEmpty())
			out.println(pq.poll());
		out.close();
	} sc = new Scanner(System.in) sc new Scanner(System.in) out = new PrintWriter(System.out) out new PrintWriter(System.out) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc HashMap<String, Integer> map = new HashMap<>(); map new HashMap<>() String vote; vote int max = 0; max 0 while(n-->0) {
			vote = sc.nextLine();
			int v = map.getOrDefault(vote, 0)+1;			
			map.put(vote, v);
			max = Math.max(max, v);
		} n-->0 n-- n 0 {
			vote = sc.nextLine();
			int v = map.getOrDefault(vote, 0)+1;			
			map.put(vote, v);
			max = Math.max(max, v);
		} vote = sc.nextLine() vote sc.nextLine() sc.nextLine sc int v = map.getOrDefault(vote, 0)+1; v map.getOrDefault(vote, 0)+1 map.getOrDefault(vote, 0) map.getOrDefault map vote 0 1 map.put(vote, v) map.put map vote v max = Math.max(max, v) max Math.max(max, v) Math.max Math max v PriorityQueue<String> pq = new PriorityQueue<>(); pq new PriorityQueue<>() for(Entry<String, Integer>e:map.entrySet()) {
			if(e.getValue() == max) pq.add(e.getKey());
		} Entry<String, Integer>e map.entrySet() map.entrySet map {
			if(e.getValue() == max) pq.add(e.getKey());
		} {
			if(e.getValue() == max) pq.add(e.getKey());
		} if(e.getValue() == max) pq.add(e.getKey()); e.getValue() == max e.getValue() e.getValue e max pq.add(e.getKey()) pq.add pq e.getKey() e.getKey e while(!pq.isEmpty())
			out.println(pq.poll()); !pq.isEmpty() pq.isEmpty() pq.isEmpty pq out.println(pq.poll()) out.println out pq.poll() pq.poll pq out.close() out.close out String[] args args static class Scanner{
		BufferedReader br;
		StringTokenizer st;
		public Scanner(InputStream in) {
			br = new BufferedReader(new InputStreamReader(in));			
		}
		private String next() throws IOException{
			while(st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}
		public int nextInt() throws NumberFormatException, IOException {
			return Integer.parseInt(next());
		}
		public long nextLong() throws NumberFormatException, IOException {
			return Long.parseLong(next());
		}
		public String nextLine() throws IOException {
			return br.readLine();
		}
	} Scanner BufferedReader br; br StringTokenizer st; st public Scanner(InputStream in) {
			br = new BufferedReader(new InputStreamReader(in));			
		} Scanner {
			br = new BufferedReader(new InputStreamReader(in));			
		} br = new BufferedReader(new InputStreamReader(in)) br new BufferedReader(new InputStreamReader(in)) InputStream in in private String next() throws IOException{
			while(st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		} next {
			while(st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		} while(st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine()); st == null || !st.hasMoreTokens() st == null st null !st.hasMoreTokens() st.hasMoreTokens() st.hasMoreTokens st st = new StringTokenizer(br.readLine()) st new StringTokenizer(br.readLine()) return st.nextToken(); st.nextToken() st.nextToken st public int nextInt() throws NumberFormatException, IOException {
			return Integer.parseInt(next());
		} nextInt {
			return Integer.parseInt(next());
		} return Integer.parseInt(next()); Integer.parseInt(next()) Integer.parseInt Integer next() next public long nextLong() throws NumberFormatException, IOException {
			return Long.parseLong(next());
		} nextLong {
			return Long.parseLong(next());
		} return Long.parseLong(next()); Long.parseLong(next()) Long.parseLong Long next() next public String nextLine() throws IOException {
			return br.readLine();
		} nextLine {
			return br.readLine();
		} return br.readLine(); br.readLine() br.readLine br public class Main {
	static PrintWriter out;
	static Scanner sc;
	public static void main(String[] args) throws IOException{
		// TODO Auto-generated method stub
		sc = new Scanner(System.in);
		out = new PrintWriter(System.out);
		int n = sc.nextInt();
		HashMap<String, Integer> map = new HashMap<>();
		String vote;
		int max = 0;
		while(n-->0) {
			vote = sc.nextLine();
			int v = map.getOrDefault(vote, 0)+1;			
			map.put(vote, v);
			max = Math.max(max, v);
		}
		PriorityQueue<String> pq = new PriorityQueue<>();
		for(Entry<String, Integer>e:map.entrySet()) {
			if(e.getValue() == max) pq.add(e.getKey());
		}
		while(!pq.isEmpty())
			out.println(pq.poll());
		out.close();
	}
	static class Scanner{
		BufferedReader br;
		StringTokenizer st;
		public Scanner(InputStream in) {
			br = new BufferedReader(new InputStreamReader(in));			
		}
		private String next() throws IOException{
			while(st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}
		public int nextInt() throws NumberFormatException, IOException {
			return Integer.parseInt(next());
		}
		public long nextLong() throws NumberFormatException, IOException {
			return Long.parseLong(next());
		}
		public String nextLine() throws IOException {
			return br.readLine();
		}
	}
} public class Main {
	static PrintWriter out;
	static Scanner sc;
	public static void main(String[] args) throws IOException{
		// TODO Auto-generated method stub
		sc = new Scanner(System.in);
		out = new PrintWriter(System.out);
		int n = sc.nextInt();
		HashMap<String, Integer> map = new HashMap<>();
		String vote;
		int max = 0;
		while(n-->0) {
			vote = sc.nextLine();
			int v = map.getOrDefault(vote, 0)+1;			
			map.put(vote, v);
			max = Math.max(max, v);
		}
		PriorityQueue<String> pq = new PriorityQueue<>();
		for(Entry<String, Integer>e:map.entrySet()) {
			if(e.getValue() == max) pq.add(e.getKey());
		}
		while(!pq.isEmpty())
			out.println(pq.poll());
		out.close();
	}
	static class Scanner{
		BufferedReader br;
		StringTokenizer st;
		public Scanner(InputStream in) {
			br = new BufferedReader(new InputStreamReader(in));			
		}
		private String next() throws IOException{
			while(st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}
		public int nextInt() throws NumberFormatException, IOException {
			return Integer.parseInt(next());
		}
		public long nextLong() throws NumberFormatException, IOException {
			return Long.parseLong(next());
		}
		public String nextLine() throws IOException {
			return br.readLine();
		}
	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Map.Entry;
import java.util.PriorityQueue;
import java.util.StringTokenizer;
import java.util.HashMap;

public class Main {
	static PrintWriter out;
	static Scanner sc;
	public static void main(String[] args) throws IOException{
		// TODO Auto-generated method stub
		sc = new Scanner(System.in);
		out = new PrintWriter(System.out);
		int n = sc.nextInt();
		HashMap<String, Integer> map = new HashMap<>();
		String vote;
		int max = 0;
		while(n-->0) {
			vote = sc.nextLine();
			int v = map.getOrDefault(vote, 0)+1;			
			map.put(vote, v);
			max = Math.max(max, v);
		}
		PriorityQueue<String> pq = new PriorityQueue<>();
		for(Entry<String, Integer>e:map.entrySet()) {
			if(e.getValue() == max) pq.add(e.getKey());
		}
		while(!pq.isEmpty())
			out.println(pq.poll());
		out.close();
	}
	static class Scanner{
		BufferedReader br;
		StringTokenizer st;
		public Scanner(InputStream in) {
			br = new BufferedReader(new InputStreamReader(in));			
		}
		private String next() throws IOException{
			while(st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}
		public int nextInt() throws NumberFormatException, IOException {
			return Integer.parseInt(next());
		}
		public long nextLong() throws NumberFormatException, IOException {
			return Long.parseLong(next());
		}
		public String nextLine() throws IOException {
			return br.readLine();
		}
	}
}
