import java.io.*;
import java.math.BigInteger;
import java.util.*;

public class Main {

	static class FastReader 
    { 
        BufferedReader br; 
        StringTokenizer st; 
  
        public FastReader() 
        { 
            br = new BufferedReader(new
                     InputStreamReader(System.in)); 
        } 
  
        String next() 
        { 
            while (st == null || !st.hasMoreElements()) 
            { 
                try
                { 
                    st = new StringTokenizer(br.readLine()); 
                } 
                catch (IOException  e) 
                { 
                    e.printStackTrace(); 
                } 
            } 
            return st.nextToken(); 
        } 
  
        int nextInt() 
        { 
            return Integer.parseInt(next()); 
        } 
  
        long nextLong() 
        { 
            return Long.parseLong(next()); 
        } 
  
        double nextDouble() 
        { 
            return Double.parseDouble(next()); 
        } 
  
        String nextLine() 
        { 
            String str = ""; 
            try
            { 
                str = br.readLine(); 
            } 
            catch (IOException e) 
            { 
                e.printStackTrace(); 
            } 
            return str; 
        } 
    } 
	static PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));
	public static long mod = (long) (1e9+7);
	public static long[] fac,inv;
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		FastReader sc = new FastReader();
		int n = sc.nextInt();
		Map<String,Integer> map = new HashMap<>();
		for(int i=0;i<n;++i) {
			add(map,sc.next());
		}
		List<String> list = new ArrayList<>();
		int max = 0;
		for(String key : map.keySet()) {
			if(map.get(key) > max) {
				list.clear();
				max = map.get(key);
				list.add(key);
			}else if(map.get(key) == max) list.add(key);
		}
		Collections.sort(list);
		for(String x : list) out.println(x);
		
	    out.close();

	}
	 static void add(Map<String, Integer> map, String string) {
			// TODO Auto-generated method stub
			if(map.containsKey(string)) map.put(string, map.get(string)+1);
			else map.put(string, 1);
			
		}
	

} import java.io.*; io.* java import java.math.BigInteger; BigInteger java.math import java.util.*; util.* java public class Main {

	static class FastReader 
    { 
        BufferedReader br; 
        StringTokenizer st; 
  
        public FastReader() 
        { 
            br = new BufferedReader(new
                     InputStreamReader(System.in)); 
        } 
  
        String next() 
        { 
            while (st == null || !st.hasMoreElements()) 
            { 
                try
                { 
                    st = new StringTokenizer(br.readLine()); 
                } 
                catch (IOException  e) 
                { 
                    e.printStackTrace(); 
                } 
            } 
            return st.nextToken(); 
        } 
  
        int nextInt() 
        { 
            return Integer.parseInt(next()); 
        } 
  
        long nextLong() 
        { 
            return Long.parseLong(next()); 
        } 
  
        double nextDouble() 
        { 
            return Double.parseDouble(next()); 
        } 
  
        String nextLine() 
        { 
            String str = ""; 
            try
            { 
                str = br.readLine(); 
            } 
            catch (IOException e) 
            { 
                e.printStackTrace(); 
            } 
            return str; 
        } 
    } 
	static PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));
	public static long mod = (long) (1e9+7);
	public static long[] fac,inv;
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		FastReader sc = new FastReader();
		int n = sc.nextInt();
		Map<String,Integer> map = new HashMap<>();
		for(int i=0;i<n;++i) {
			add(map,sc.next());
		}
		List<String> list = new ArrayList<>();
		int max = 0;
		for(String key : map.keySet()) {
			if(map.get(key) > max) {
				list.clear();
				max = map.get(key);
				list.add(key);
			}else if(map.get(key) == max) list.add(key);
		}
		Collections.sort(list);
		for(String x : list) out.println(x);
		
	    out.close();

	}
	 static void add(Map<String, Integer> map, String string) {
			// TODO Auto-generated method stub
			if(map.containsKey(string)) map.put(string, map.get(string)+1);
			else map.put(string, 1);
			
		}
	

} Main static PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out)); out new PrintWriter(new BufferedOutputStream(System.out)) public static long mod = (long) (1e9+7); mod (long) (1e9+7) 1e9 7 public static long[] fac fac inv; inv public static void main(String[] args) {
		// TODO Auto-generated method stub
		FastReader sc = new FastReader();
		int n = sc.nextInt();
		Map<String,Integer> map = new HashMap<>();
		for(int i=0;i<n;++i) {
			add(map,sc.next());
		}
		List<String> list = new ArrayList<>();
		int max = 0;
		for(String key : map.keySet()) {
			if(map.get(key) > max) {
				list.clear();
				max = map.get(key);
				list.add(key);
			}else if(map.get(key) == max) list.add(key);
		}
		Collections.sort(list);
		for(String x : list) out.println(x);
		
	    out.close();

	} main {
		// TODO Auto-generated method stub
		FastReader sc = new FastReader();
		int n = sc.nextInt();
		Map<String,Integer> map = new HashMap<>();
		for(int i=0;i<n;++i) {
			add(map,sc.next());
		}
		List<String> list = new ArrayList<>();
		int max = 0;
		for(String key : map.keySet()) {
			if(map.get(key) > max) {
				list.clear();
				max = map.get(key);
				list.add(key);
			}else if(map.get(key) == max) list.add(key);
		}
		Collections.sort(list);
		for(String x : list) out.println(x);
		
	    out.close();

	} FastReader sc = new FastReader(); sc new FastReader() int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc Map<String,Integer> map = new HashMap<>(); map new HashMap<>() for(int i=0;i<n;++i) {
			add(map,sc.next());
		} int i=0; int i=0; i 0 i<n i n ++i ++i i {
			add(map,sc.next());
		} {
			add(map,sc.next());
		} add(map,sc.next()) add map sc.next() sc.next sc List<String> list = new ArrayList<>(); list new ArrayList<>() int max = 0; max 0 for(String key : map.keySet()) {
			if(map.get(key) > max) {
				list.clear();
				max = map.get(key);
				list.add(key);
			}else if(map.get(key) == max) list.add(key);
		} String key map.keySet() map.keySet map {
			if(map.get(key) > max) {
				list.clear();
				max = map.get(key);
				list.add(key);
			}else if(map.get(key) == max) list.add(key);
		} {
			if(map.get(key) > max) {
				list.clear();
				max = map.get(key);
				list.add(key);
			}else if(map.get(key) == max) list.add(key);
		} if(map.get(key) > max) {
				list.clear();
				max = map.get(key);
				list.add(key);
			}else if(map.get(key) == max) list.add(key); map.get(key) > max map.get(key) map.get map key max {
				list.clear();
				max = map.get(key);
				list.add(key);
			} list.clear() list.clear list max = map.get(key) max map.get(key) map.get map key list.add(key) list.add list 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 x : list) out.println(x); String x list out.println(x); out.println(x) out.println out x out.close() out.close out String[] args args static void add(Map<String, Integer> map, String string) {
			// TODO Auto-generated method stub
			if(map.containsKey(string)) map.put(string, map.get(string)+1);
			else map.put(string, 1);
			
		} add {
			// TODO Auto-generated method stub
			if(map.containsKey(string)) map.put(string, map.get(string)+1);
			else map.put(string, 1);
			
		} if(map.containsKey(string)) map.put(string, map.get(string)+1);
			else map.put(string, 1); map.containsKey(string) map.containsKey map string map.put(string, map.get(string)+1) map.put map string map.get(string)+1 map.get(string) map.get map string 1 map.put(string, 1) map.put map string 1 Map<String, Integer> map map String string string static class FastReader 
    { 
        BufferedReader br; 
        StringTokenizer st; 
  
        public FastReader() 
        { 
            br = new BufferedReader(new
                     InputStreamReader(System.in)); 
        } 
  
        String next() 
        { 
            while (st == null || !st.hasMoreElements()) 
            { 
                try
                { 
                    st = new StringTokenizer(br.readLine()); 
                } 
                catch (IOException  e) 
                { 
                    e.printStackTrace(); 
                } 
            } 
            return st.nextToken(); 
        } 
  
        int nextInt() 
        { 
            return Integer.parseInt(next()); 
        } 
  
        long nextLong() 
        { 
            return Long.parseLong(next()); 
        } 
  
        double nextDouble() 
        { 
            return Double.parseDouble(next()); 
        } 
  
        String nextLine() 
        { 
            String str = ""; 
            try
            { 
                str = br.readLine(); 
            } 
            catch (IOException e) 
            { 
                e.printStackTrace(); 
            } 
            return str; 
        } 
    } FastReader BufferedReader br; br StringTokenizer st; st public FastReader() 
        { 
            br = new BufferedReader(new
                     InputStreamReader(System.in)); 
        } FastReader { 
            br = new BufferedReader(new
                     InputStreamReader(System.in)); 
        } br = new BufferedReader(new
                     InputStreamReader(System.in)) br new BufferedReader(new
                     InputStreamReader(System.in)) String next() 
        { 
            while (st == null || !st.hasMoreElements()) 
            { 
                try
                { 
                    st = new StringTokenizer(br.readLine()); 
                } 
                catch (IOException  e) 
                { 
                    e.printStackTrace(); 
                } 
            } 
            return st.nextToken(); 
        } next { 
            while (st == null || !st.hasMoreElements()) 
            { 
                try
                { 
                    st = new StringTokenizer(br.readLine()); 
                } 
                catch (IOException  e) 
                { 
                    e.printStackTrace(); 
                } 
            } 
            return st.nextToken(); 
        } while (st == null || !st.hasMoreElements()) 
            { 
                try
                { 
                    st = new StringTokenizer(br.readLine()); 
                } 
                catch (IOException  e) 
                { 
                    e.printStackTrace(); 
                } 
            } st == null || !st.hasMoreElements() st == null st null !st.hasMoreElements() st.hasMoreElements() st.hasMoreElements st { 
                try
                { 
                    st = new StringTokenizer(br.readLine()); 
                } 
                catch (IOException  e) 
                { 
                    e.printStackTrace(); 
                } 
            } try
                { 
                    st = new StringTokenizer(br.readLine()); 
                } 
                catch (IOException  e) 
                { 
                    e.printStackTrace(); 
                } catch (IOException  e) 
                { 
                    e.printStackTrace(); 
                } IOException  e { 
                    e.printStackTrace(); 
                } e.printStackTrace() e.printStackTrace e { 
                    st = new StringTokenizer(br.readLine()); 
                } st = new StringTokenizer(br.readLine()) st new StringTokenizer(br.readLine()) return st.nextToken(); st.nextToken() st.nextToken st int nextInt() 
        { 
            return Integer.parseInt(next()); 
        } nextInt { 
            return Integer.parseInt(next()); 
        } return Integer.parseInt(next()); Integer.parseInt(next()) Integer.parseInt Integer next() next long nextLong() 
        { 
            return Long.parseLong(next()); 
        } nextLong { 
            return Long.parseLong(next()); 
        } return Long.parseLong(next()); Long.parseLong(next()) Long.parseLong Long next() next double nextDouble() 
        { 
            return Double.parseDouble(next()); 
        } nextDouble { 
            return Double.parseDouble(next()); 
        } return Double.parseDouble(next()); Double.parseDouble(next()) Double.parseDouble Double next() next String nextLine() 
        { 
            String str = ""; 
            try
            { 
                str = br.readLine(); 
            } 
            catch (IOException e) 
            { 
                e.printStackTrace(); 
            } 
            return str; 
        } nextLine { 
            String str = ""; 
            try
            { 
                str = br.readLine(); 
            } 
            catch (IOException e) 
            { 
                e.printStackTrace(); 
            } 
            return str; 
        } String str = ""; str "" try
            { 
                str = br.readLine(); 
            } 
            catch (IOException e) 
            { 
                e.printStackTrace(); 
            } catch (IOException e) 
            { 
                e.printStackTrace(); 
            } IOException e { 
                e.printStackTrace(); 
            } e.printStackTrace() e.printStackTrace e { 
                str = br.readLine(); 
            } str = br.readLine() str br.readLine() br.readLine br return str; str public class Main {

	static class FastReader 
    { 
        BufferedReader br; 
        StringTokenizer st; 
  
        public FastReader() 
        { 
            br = new BufferedReader(new
                     InputStreamReader(System.in)); 
        } 
  
        String next() 
        { 
            while (st == null || !st.hasMoreElements()) 
            { 
                try
                { 
                    st = new StringTokenizer(br.readLine()); 
                } 
                catch (IOException  e) 
                { 
                    e.printStackTrace(); 
                } 
            } 
            return st.nextToken(); 
        } 
  
        int nextInt() 
        { 
            return Integer.parseInt(next()); 
        } 
  
        long nextLong() 
        { 
            return Long.parseLong(next()); 
        } 
  
        double nextDouble() 
        { 
            return Double.parseDouble(next()); 
        } 
  
        String nextLine() 
        { 
            String str = ""; 
            try
            { 
                str = br.readLine(); 
            } 
            catch (IOException e) 
            { 
                e.printStackTrace(); 
            } 
            return str; 
        } 
    } 
	static PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));
	public static long mod = (long) (1e9+7);
	public static long[] fac,inv;
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		FastReader sc = new FastReader();
		int n = sc.nextInt();
		Map<String,Integer> map = new HashMap<>();
		for(int i=0;i<n;++i) {
			add(map,sc.next());
		}
		List<String> list = new ArrayList<>();
		int max = 0;
		for(String key : map.keySet()) {
			if(map.get(key) > max) {
				list.clear();
				max = map.get(key);
				list.add(key);
			}else if(map.get(key) == max) list.add(key);
		}
		Collections.sort(list);
		for(String x : list) out.println(x);
		
	    out.close();

	}
	 static void add(Map<String, Integer> map, String string) {
			// TODO Auto-generated method stub
			if(map.containsKey(string)) map.put(string, map.get(string)+1);
			else map.put(string, 1);
			
		}
	

} public class Main {

	static class FastReader 
    { 
        BufferedReader br; 
        StringTokenizer st; 
  
        public FastReader() 
        { 
            br = new BufferedReader(new
                     InputStreamReader(System.in)); 
        } 
  
        String next() 
        { 
            while (st == null || !st.hasMoreElements()) 
            { 
                try
                { 
                    st = new StringTokenizer(br.readLine()); 
                } 
                catch (IOException  e) 
                { 
                    e.printStackTrace(); 
                } 
            } 
            return st.nextToken(); 
        } 
  
        int nextInt() 
        { 
            return Integer.parseInt(next()); 
        } 
  
        long nextLong() 
        { 
            return Long.parseLong(next()); 
        } 
  
        double nextDouble() 
        { 
            return Double.parseDouble(next()); 
        } 
  
        String nextLine() 
        { 
            String str = ""; 
            try
            { 
                str = br.readLine(); 
            } 
            catch (IOException e) 
            { 
                e.printStackTrace(); 
            } 
            return str; 
        } 
    } 
	static PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));
	public static long mod = (long) (1e9+7);
	public static long[] fac,inv;
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		FastReader sc = new FastReader();
		int n = sc.nextInt();
		Map<String,Integer> map = new HashMap<>();
		for(int i=0;i<n;++i) {
			add(map,sc.next());
		}
		List<String> list = new ArrayList<>();
		int max = 0;
		for(String key : map.keySet()) {
			if(map.get(key) > max) {
				list.clear();
				max = map.get(key);
				list.add(key);
			}else if(map.get(key) == max) list.add(key);
		}
		Collections.sort(list);
		for(String x : list) out.println(x);
		
	    out.close();

	}
	 static void add(Map<String, Integer> map, String string) {
			// TODO Auto-generated method stub
			if(map.containsKey(string)) map.put(string, map.get(string)+1);
			else map.put(string, 1);
			
		}
	

} Main
import java.io.*;
import java.math.BigInteger;
import java.util.*;

public class Main {

	static class FastReader 
    { 
        BufferedReader br; 
        StringTokenizer st; 
  
        public FastReader() 
        { 
            br = new BufferedReader(new
                     InputStreamReader(System.in)); 
        } 
  
        String next() 
        { 
            while (st == null || !st.hasMoreElements()) 
            { 
                try
                { 
                    st = new StringTokenizer(br.readLine()); 
                } 
                catch (IOException  e) 
                { 
                    e.printStackTrace(); 
                } 
            } 
            return st.nextToken(); 
        } 
  
        int nextInt() 
        { 
            return Integer.parseInt(next()); 
        } 
  
        long nextLong() 
        { 
            return Long.parseLong(next()); 
        } 
  
        double nextDouble() 
        { 
            return Double.parseDouble(next()); 
        } 
  
        String nextLine() 
        { 
            String str = ""; 
            try
            { 
                str = br.readLine(); 
            } 
            catch (IOException e) 
            { 
                e.printStackTrace(); 
            } 
            return str; 
        } 
    } 
	static PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));
	public static long mod = (long) (1e9+7);
	public static long[] fac,inv;
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		FastReader sc = new FastReader();
		int n = sc.nextInt();
		Map<String,Integer> map = new HashMap<>();
		for(int i=0;i<n;++i) {
			add(map,sc.next());
		}
		List<String> list = new ArrayList<>();
		int max = 0;
		for(String key : map.keySet()) {
			if(map.get(key) > max) {
				list.clear();
				max = map.get(key);
				list.add(key);
			}else if(map.get(key) == max) list.add(key);
		}
		Collections.sort(list);
		for(String x : list) out.println(x);
		
	    out.close();

	}
	 static void add(Map<String, Integer> map, String string) {
			// TODO Auto-generated method stub
			if(map.containsKey(string)) map.put(string, map.get(string)+1);
			else map.put(string, 1);
			
		}
	

}
