//package AtCoder;
import java.util.*;
public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc=new Scanner(System.in);
		Map<String,Integer> map=new HashMap<>();
		int n=sc.nextInt();
		int max=1;
		for(int i=0;i<n;i++)
		{
			String s=sc.next();
			if(map.containsKey(s))
			{
				int val=map.get(s)+1;
				if(val>max)
					max=val;
				map.put(s,val);
			}
			else
			{
				map.put(s, 1);
			}
		}
		Set<String> set=new TreeSet<>();
		for(Map.Entry<String, Integer> entry:map.entrySet())
		{
			if(entry.getValue()==max)
				set.add(entry.getKey());
		}
		List<String> list=new ArrayList<>(set);
		for(String str:list)
		{
			System.out.println(str);
		}

	}

} import java.util.*; util.* java public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc=new Scanner(System.in);
		Map<String,Integer> map=new HashMap<>();
		int n=sc.nextInt();
		int max=1;
		for(int i=0;i<n;i++)
		{
			String s=sc.next();
			if(map.containsKey(s))
			{
				int val=map.get(s)+1;
				if(val>max)
					max=val;
				map.put(s,val);
			}
			else
			{
				map.put(s, 1);
			}
		}
		Set<String> set=new TreeSet<>();
		for(Map.Entry<String, Integer> entry:map.entrySet())
		{
			if(entry.getValue()==max)
				set.add(entry.getKey());
		}
		List<String> list=new ArrayList<>(set);
		for(String str:list)
		{
			System.out.println(str);
		}

	}

} Main public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc=new Scanner(System.in);
		Map<String,Integer> map=new HashMap<>();
		int n=sc.nextInt();
		int max=1;
		for(int i=0;i<n;i++)
		{
			String s=sc.next();
			if(map.containsKey(s))
			{
				int val=map.get(s)+1;
				if(val>max)
					max=val;
				map.put(s,val);
			}
			else
			{
				map.put(s, 1);
			}
		}
		Set<String> set=new TreeSet<>();
		for(Map.Entry<String, Integer> entry:map.entrySet())
		{
			if(entry.getValue()==max)
				set.add(entry.getKey());
		}
		List<String> list=new ArrayList<>(set);
		for(String str:list)
		{
			System.out.println(str);
		}

	} main {
		// TODO Auto-generated method stub
		Scanner sc=new Scanner(System.in);
		Map<String,Integer> map=new HashMap<>();
		int n=sc.nextInt();
		int max=1;
		for(int i=0;i<n;i++)
		{
			String s=sc.next();
			if(map.containsKey(s))
			{
				int val=map.get(s)+1;
				if(val>max)
					max=val;
				map.put(s,val);
			}
			else
			{
				map.put(s, 1);
			}
		}
		Set<String> set=new TreeSet<>();
		for(Map.Entry<String, Integer> entry:map.entrySet())
		{
			if(entry.getValue()==max)
				set.add(entry.getKey());
		}
		List<String> list=new ArrayList<>(set);
		for(String str:list)
		{
			System.out.println(str);
		}

	} Scanner sc=new Scanner(System.in); sc new Scanner(System.in) Map<String,Integer> map=new HashMap<>(); map new HashMap<>() int n=sc.nextInt(); n sc.nextInt() sc.nextInt sc int max=1; max 1 for(int i=0;i<n;i++)
		{
			String s=sc.next();
			if(map.containsKey(s))
			{
				int val=map.get(s)+1;
				if(val>max)
					max=val;
				map.put(s,val);
			}
			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))
			{
				int val=map.get(s)+1;
				if(val>max)
					max=val;
				map.put(s,val);
			}
			else
			{
				map.put(s, 1);
			}
		} {
			String s=sc.next();
			if(map.containsKey(s))
			{
				int val=map.get(s)+1;
				if(val>max)
					max=val;
				map.put(s,val);
			}
			else
			{
				map.put(s, 1);
			}
		} String s=sc.next(); s sc.next() sc.next sc if(map.containsKey(s))
			{
				int val=map.get(s)+1;
				if(val>max)
					max=val;
				map.put(s,val);
			}
			else
			{
				map.put(s, 1);
			} map.containsKey(s) map.containsKey map s {
				int val=map.get(s)+1;
				if(val>max)
					max=val;
				map.put(s,val);
			} int val=map.get(s)+1; val map.get(s)+1 map.get(s) map.get map s 1 if(val>max)
					max=val; val>max val max max=val max val map.put(s,val) map.put map s val {
				map.put(s, 1);
			} map.put(s, 1) map.put map s 1 Set<String> set=new TreeSet<>(); set new TreeSet<>() for(Map.Entry<String, Integer> entry:map.entrySet())
		{
			if(entry.getValue()==max)
				set.add(entry.getKey());
		} Map.Entry<String, Integer> entry map.entrySet() map.entrySet map {
			if(entry.getValue()==max)
				set.add(entry.getKey());
		} {
			if(entry.getValue()==max)
				set.add(entry.getKey());
		} if(entry.getValue()==max)
				set.add(entry.getKey()); entry.getValue()==max entry.getValue() entry.getValue entry max set.add(entry.getKey()) set.add set entry.getKey() entry.getKey entry List<String> list=new ArrayList<>(set); list new ArrayList<>(set) for(String str:list)
		{
			System.out.println(str);
		} String str list {
			System.out.println(str);
		} {
			System.out.println(str);
		} System.out.println(str) System.out.println System.out System System.out str String[] args args public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc=new Scanner(System.in);
		Map<String,Integer> map=new HashMap<>();
		int n=sc.nextInt();
		int max=1;
		for(int i=0;i<n;i++)
		{
			String s=sc.next();
			if(map.containsKey(s))
			{
				int val=map.get(s)+1;
				if(val>max)
					max=val;
				map.put(s,val);
			}
			else
			{
				map.put(s, 1);
			}
		}
		Set<String> set=new TreeSet<>();
		for(Map.Entry<String, Integer> entry:map.entrySet())
		{
			if(entry.getValue()==max)
				set.add(entry.getKey());
		}
		List<String> list=new ArrayList<>(set);
		for(String str:list)
		{
			System.out.println(str);
		}

	}

} public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc=new Scanner(System.in);
		Map<String,Integer> map=new HashMap<>();
		int n=sc.nextInt();
		int max=1;
		for(int i=0;i<n;i++)
		{
			String s=sc.next();
			if(map.containsKey(s))
			{
				int val=map.get(s)+1;
				if(val>max)
					max=val;
				map.put(s,val);
			}
			else
			{
				map.put(s, 1);
			}
		}
		Set<String> set=new TreeSet<>();
		for(Map.Entry<String, Integer> entry:map.entrySet())
		{
			if(entry.getValue()==max)
				set.add(entry.getKey());
		}
		List<String> list=new ArrayList<>(set);
		for(String str:list)
		{
			System.out.println(str);
		}

	}

} Main
//package AtCoder;
import java.util.*;
public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc=new Scanner(System.in);
		Map<String,Integer> map=new HashMap<>();
		int n=sc.nextInt();
		int max=1;
		for(int i=0;i<n;i++)
		{
			String s=sc.next();
			if(map.containsKey(s))
			{
				int val=map.get(s)+1;
				if(val>max)
					max=val;
				map.put(s,val);
			}
			else
			{
				map.put(s, 1);
			}
		}
		Set<String> set=new TreeSet<>();
		for(Map.Entry<String, Integer> entry:map.entrySet())
		{
			if(entry.getValue()==max)
				set.add(entry.getKey());
		}
		List<String> list=new ArrayList<>(set);
		for(String str:list)
		{
			System.out.println(str);
		}

	}

}
