import java.io.*;
import java.util.*;
public class Main
{
	final long mod=(long)(1e9+7);
	final int maxn=(int)(1e6);
	
	private void solve()throws IOException
	{
		HashMap<String,Integer> map=new HashMap<>();
		int n=nextInt();
		for(int i=1;i<=n;i++)
		{
			String s=nextLine();
			map.put(s,map.getOrDefault(s,0)+1);
		}
		int max=0;
		ArrayList<String> list=new ArrayList<>();
		for(String s:map.keySet())
		{
			int x=map.get(s);
			if(x>max)
			{
				list=new ArrayList<String>();
				list.add(s);
				max=x;
			}
			else if(x==max)
				list.add(s);
		}
		Collections.sort(list);
		for(String s:list)
			out.println(s);
	}

	 
	///////////////////////////////////////////////////////////

	public void run()throws IOException
	{
		br=new BufferedReader(new InputStreamReader(System.in));
		st=null;
		out=new PrintWriter(System.out);

		solve();

		br.close();
		out.close();
	}
	public static void main(String args[])throws IOException{
		new Main().run();
	}
	BufferedReader br;
	StringTokenizer st;
	PrintWriter out;
	String nextToken()throws IOException{
		while(st==null || !st.hasMoreTokens())
		st=new StringTokenizer(br.readLine());
		return st.nextToken();
	}
	String nextLine()throws IOException{
		return br.readLine();
	}
	int nextInt()throws IOException{
		return Integer.parseInt(nextToken());
	}
	long nextLong()throws IOException{
		return Long.parseLong(nextToken());
	}
	double nextDouble()throws IOException{
		return Double.parseDouble(nextToken());
	}
} import java.io.*; io.* java import java.util.*; util.* java public class Main
{
	final long mod=(long)(1e9+7);
	final int maxn=(int)(1e6);
	
	private void solve()throws IOException
	{
		HashMap<String,Integer> map=new HashMap<>();
		int n=nextInt();
		for(int i=1;i<=n;i++)
		{
			String s=nextLine();
			map.put(s,map.getOrDefault(s,0)+1);
		}
		int max=0;
		ArrayList<String> list=new ArrayList<>();
		for(String s:map.keySet())
		{
			int x=map.get(s);
			if(x>max)
			{
				list=new ArrayList<String>();
				list.add(s);
				max=x;
			}
			else if(x==max)
				list.add(s);
		}
		Collections.sort(list);
		for(String s:list)
			out.println(s);
	}

	 
	///////////////////////////////////////////////////////////

	public void run()throws IOException
	{
		br=new BufferedReader(new InputStreamReader(System.in));
		st=null;
		out=new PrintWriter(System.out);

		solve();

		br.close();
		out.close();
	}
	public static void main(String args[])throws IOException{
		new Main().run();
	}
	BufferedReader br;
	StringTokenizer st;
	PrintWriter out;
	String nextToken()throws IOException{
		while(st==null || !st.hasMoreTokens())
		st=new StringTokenizer(br.readLine());
		return st.nextToken();
	}
	String nextLine()throws IOException{
		return br.readLine();
	}
	int nextInt()throws IOException{
		return Integer.parseInt(nextToken());
	}
	long nextLong()throws IOException{
		return Long.parseLong(nextToken());
	}
	double nextDouble()throws IOException{
		return Double.parseDouble(nextToken());
	}
} Main final long mod=(long)(1e9+7); mod (long)(1e9+7) 1e9 7 final int maxn=(int)(1e6); maxn (int)(1e6) BufferedReader br; br StringTokenizer st; st PrintWriter out; out private void solve()throws IOException
	{
		HashMap<String,Integer> map=new HashMap<>();
		int n=nextInt();
		for(int i=1;i<=n;i++)
		{
			String s=nextLine();
			map.put(s,map.getOrDefault(s,0)+1);
		}
		int max=0;
		ArrayList<String> list=new ArrayList<>();
		for(String s:map.keySet())
		{
			int x=map.get(s);
			if(x>max)
			{
				list=new ArrayList<String>();
				list.add(s);
				max=x;
			}
			else if(x==max)
				list.add(s);
		}
		Collections.sort(list);
		for(String s:list)
			out.println(s);
	} solve {
		HashMap<String,Integer> map=new HashMap<>();
		int n=nextInt();
		for(int i=1;i<=n;i++)
		{
			String s=nextLine();
			map.put(s,map.getOrDefault(s,0)+1);
		}
		int max=0;
		ArrayList<String> list=new ArrayList<>();
		for(String s:map.keySet())
		{
			int x=map.get(s);
			if(x>max)
			{
				list=new ArrayList<String>();
				list.add(s);
				max=x;
			}
			else if(x==max)
				list.add(s);
		}
		Collections.sort(list);
		for(String s:list)
			out.println(s);
	} HashMap<String,Integer> map=new HashMap<>(); map new HashMap<>() int n=nextInt(); n nextInt() nextInt for(int i=1;i<=n;i++)
		{
			String s=nextLine();
			map.put(s,map.getOrDefault(s,0)+1);
		} int i=1; int i=1; i 1 i<=n i n i++ i++ i {
			String s=nextLine();
			map.put(s,map.getOrDefault(s,0)+1);
		} {
			String s=nextLine();
			map.put(s,map.getOrDefault(s,0)+1);
		} String s=nextLine(); s nextLine() nextLine map.put(s,map.getOrDefault(s,0)+1) map.put map s map.getOrDefault(s,0)+1 map.getOrDefault(s,0) map.getOrDefault map s 0 1 int max=0; max 0 ArrayList<String> list=new ArrayList<>(); list new ArrayList<>() for(String s:map.keySet())
		{
			int x=map.get(s);
			if(x>max)
			{
				list=new ArrayList<String>();
				list.add(s);
				max=x;
			}
			else if(x==max)
				list.add(s);
		} String s map.keySet() map.keySet map {
			int x=map.get(s);
			if(x>max)
			{
				list=new ArrayList<String>();
				list.add(s);
				max=x;
			}
			else if(x==max)
				list.add(s);
		} {
			int x=map.get(s);
			if(x>max)
			{
				list=new ArrayList<String>();
				list.add(s);
				max=x;
			}
			else if(x==max)
				list.add(s);
		} int x=map.get(s); x map.get(s) map.get map s if(x>max)
			{
				list=new ArrayList<String>();
				list.add(s);
				max=x;
			}
			else if(x==max)
				list.add(s); x>max x max {
				list=new ArrayList<String>();
				list.add(s);
				max=x;
			} list=new ArrayList<String>() list new ArrayList<String>() list.add(s) list.add list s max=x max x if(x==max)
				list.add(s); x==max x max list.add(s) list.add list s Collections.sort(list) Collections.sort Collections list for(String s:list)
			out.println(s); String s list out.println(s); out.println(s) out.println out s public void run()throws IOException
	{
		br=new BufferedReader(new InputStreamReader(System.in));
		st=null;
		out=new PrintWriter(System.out);

		solve();

		br.close();
		out.close();
	} run {
		br=new BufferedReader(new InputStreamReader(System.in));
		st=null;
		out=new PrintWriter(System.out);

		solve();

		br.close();
		out.close();
	} br=new BufferedReader(new InputStreamReader(System.in)) br new BufferedReader(new InputStreamReader(System.in)) st=null st null out=new PrintWriter(System.out) out new PrintWriter(System.out) solve() solve br.close() br.close br out.close() out.close out public static void main(String args[])throws IOException{
		new Main().run();
	} main {
		new Main().run();
	} new Main().run() new Main().run new Main() String args[] args String nextToken()throws IOException{
		while(st==null || !st.hasMoreTokens())
		st=new StringTokenizer(br.readLine());
		return st.nextToken();
	} nextToken {
		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 String nextLine()throws IOException{
		return br.readLine();
	} nextLine {
		return br.readLine();
	} return br.readLine(); br.readLine() br.readLine br int nextInt()throws IOException{
		return Integer.parseInt(nextToken());
	} nextInt {
		return Integer.parseInt(nextToken());
	} return Integer.parseInt(nextToken()); Integer.parseInt(nextToken()) Integer.parseInt Integer nextToken() nextToken long nextLong()throws IOException{
		return Long.parseLong(nextToken());
	} nextLong {
		return Long.parseLong(nextToken());
	} return Long.parseLong(nextToken()); Long.parseLong(nextToken()) Long.parseLong Long nextToken() nextToken double nextDouble()throws IOException{
		return Double.parseDouble(nextToken());
	} nextDouble {
		return Double.parseDouble(nextToken());
	} return Double.parseDouble(nextToken()); Double.parseDouble(nextToken()) Double.parseDouble Double nextToken() nextToken public class Main
{
	final long mod=(long)(1e9+7);
	final int maxn=(int)(1e6);
	
	private void solve()throws IOException
	{
		HashMap<String,Integer> map=new HashMap<>();
		int n=nextInt();
		for(int i=1;i<=n;i++)
		{
			String s=nextLine();
			map.put(s,map.getOrDefault(s,0)+1);
		}
		int max=0;
		ArrayList<String> list=new ArrayList<>();
		for(String s:map.keySet())
		{
			int x=map.get(s);
			if(x>max)
			{
				list=new ArrayList<String>();
				list.add(s);
				max=x;
			}
			else if(x==max)
				list.add(s);
		}
		Collections.sort(list);
		for(String s:list)
			out.println(s);
	}

	 
	///////////////////////////////////////////////////////////

	public void run()throws IOException
	{
		br=new BufferedReader(new InputStreamReader(System.in));
		st=null;
		out=new PrintWriter(System.out);

		solve();

		br.close();
		out.close();
	}
	public static void main(String args[])throws IOException{
		new Main().run();
	}
	BufferedReader br;
	StringTokenizer st;
	PrintWriter out;
	String nextToken()throws IOException{
		while(st==null || !st.hasMoreTokens())
		st=new StringTokenizer(br.readLine());
		return st.nextToken();
	}
	String nextLine()throws IOException{
		return br.readLine();
	}
	int nextInt()throws IOException{
		return Integer.parseInt(nextToken());
	}
	long nextLong()throws IOException{
		return Long.parseLong(nextToken());
	}
	double nextDouble()throws IOException{
		return Double.parseDouble(nextToken());
	}
} public class Main
{
	final long mod=(long)(1e9+7);
	final int maxn=(int)(1e6);
	
	private void solve()throws IOException
	{
		HashMap<String,Integer> map=new HashMap<>();
		int n=nextInt();
		for(int i=1;i<=n;i++)
		{
			String s=nextLine();
			map.put(s,map.getOrDefault(s,0)+1);
		}
		int max=0;
		ArrayList<String> list=new ArrayList<>();
		for(String s:map.keySet())
		{
			int x=map.get(s);
			if(x>max)
			{
				list=new ArrayList<String>();
				list.add(s);
				max=x;
			}
			else if(x==max)
				list.add(s);
		}
		Collections.sort(list);
		for(String s:list)
			out.println(s);
	}

	 
	///////////////////////////////////////////////////////////

	public void run()throws IOException
	{
		br=new BufferedReader(new InputStreamReader(System.in));
		st=null;
		out=new PrintWriter(System.out);

		solve();

		br.close();
		out.close();
	}
	public static void main(String args[])throws IOException{
		new Main().run();
	}
	BufferedReader br;
	StringTokenizer st;
	PrintWriter out;
	String nextToken()throws IOException{
		while(st==null || !st.hasMoreTokens())
		st=new StringTokenizer(br.readLine());
		return st.nextToken();
	}
	String nextLine()throws IOException{
		return br.readLine();
	}
	int nextInt()throws IOException{
		return Integer.parseInt(nextToken());
	}
	long nextLong()throws IOException{
		return Long.parseLong(nextToken());
	}
	double nextDouble()throws IOException{
		return Double.parseDouble(nextToken());
	}
} Main
import java.io.*;
import java.util.*;
public class Main
{
	final long mod=(long)(1e9+7);
	final int maxn=(int)(1e6);
	
	private void solve()throws IOException
	{
		HashMap<String,Integer> map=new HashMap<>();
		int n=nextInt();
		for(int i=1;i<=n;i++)
		{
			String s=nextLine();
			map.put(s,map.getOrDefault(s,0)+1);
		}
		int max=0;
		ArrayList<String> list=new ArrayList<>();
		for(String s:map.keySet())
		{
			int x=map.get(s);
			if(x>max)
			{
				list=new ArrayList<String>();
				list.add(s);
				max=x;
			}
			else if(x==max)
				list.add(s);
		}
		Collections.sort(list);
		for(String s:list)
			out.println(s);
	}

	 
	///////////////////////////////////////////////////////////

	public void run()throws IOException
	{
		br=new BufferedReader(new InputStreamReader(System.in));
		st=null;
		out=new PrintWriter(System.out);

		solve();

		br.close();
		out.close();
	}
	public static void main(String args[])throws IOException{
		new Main().run();
	}
	BufferedReader br;
	StringTokenizer st;
	PrintWriter out;
	String nextToken()throws IOException{
		while(st==null || !st.hasMoreTokens())
		st=new StringTokenizer(br.readLine());
		return st.nextToken();
	}
	String nextLine()throws IOException{
		return br.readLine();
	}
	int nextInt()throws IOException{
		return Integer.parseInt(nextToken());
	}
	long nextLong()throws IOException{
		return Long.parseLong(nextToken());
	}
	double nextDouble()throws IOException{
		return Double.parseDouble(nextToken());
	}
}