import java.io.*;
import java.util.*;

class Main{
    final static long MOD = 1000000007;
    FastScanner sc = new FastScanner();

    public static void main(String[] args) {
        new Main().solve();
    }

    void solve(){

        int n = sc.nextInt();
        Map<String, Integer> m = new HashMap<>();
        int max = 0;

        for(int i = 0; i < n; i++){
            String s = sc.next();
            if(m.get(s) == null) m.put(s, 1);
            else m.put(s, m.get(s) + 1);
            max = Math.max(max, m.get(s));
        }

        SortedSet<String> k = new TreeSet<>(m.keySet());

        for(String s : k){
            if(m.get(s) == max) System.out.println(s);
        }

    }

    long mod_pow(long a, long r){ // return a^r (mod MOD)
        long sum = 1;
        while(r > 0){
            if((r & 1) == 1){
                sum *= a;
                sum %= MOD;
            }
            a *= a;
            a %= MOD;
            r >>= 1;
        }
        return sum;
    }

    long mod_inv(long a){ // return aの逆元 (mod MOD)
        return mod_pow(a, MOD - 2);
    }

    long fact(long n){ // return n!
        if(n == 0){
            return 1;
        }
        return n * fact(n - 1);
    }

    long mod_fact(long n){ // retur n! (mod MOD)
        if(n == 0){
            return 1;
        }
        return n * mod_fact(n - 1) % MOD;
    }

    int numOfCombination(int n, int r){ // return nCr
        int num = 1;
        for(int i = 1; i <= r; i++){
            num = num * (n - i + 1) / i;
        }
        return num;
    }

    long gcd(long a, long b){ // return aとbの最大公約数
        if(b == 0){
          return a;
        }
        return gcd(b, a % b);
    }

    boolean is_prime(long a){ // aの素数判定
        if(a <= 1) return false;
        for(int i = 2; i * i <= a; i++){
            if(a % i == 0) return false;
        }
        return true;
    }

    String nextPermutation(String s){ // return sの次の順列
        ArrayList<Character> list = new ArrayList<>();
        for(int i = 0; i < s.length(); i++) list.add(s.charAt(i));

        int pivotPos = -1;
        char pivot = 0;
        for(int i = list.size() - 2; i >= 0; i--){
            if(list.get(i) < list.get(i+1)){
    			pivotPos = i;
    			pivot = list.get(i);
    			break;
    		}
    	}

        if(pivotPos == -1 && pivot == 0) return null;

        int L = pivotPos + 1;
        int R = list.size() - 1;
    	int minPos = -1;
    	char min = Character.MAX_VALUE;
    	for(int i = R; i >= L; i--){
    		if(pivot < list.get(i)){
    			if(list.get(i) < min){
    				min = list.get(i);
    				minPos = i;
    			}
    		}
    	}

    	Collections.swap(list, pivotPos, minPos);
    	Collections.sort(list.subList(L, R + 1));

    	StringBuilder sb = new StringBuilder();
    	for(int i=0; i<list.size(); i++) sb.append(list.get(i));

    	return sb.toString();
    }

}



class FastScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;
    private boolean hasNextByte(){
        if(ptr < buflen){
            return true;
        }else{
            ptr = 0;
            try{
                buflen = in.read(buffer);
            }catch(IOException e){
                e.printStackTrace();
            }
            if(buflen <= 0){
                return false;
            }
        }
        return true;
    }
    private int readByte(){
        if(hasNextByte()) return buffer[ptr++];
        else return -1;
    }
    private static boolean isPrintableChar(int c){
        return 33 <= c && c <= 126;
    }
    public boolean hasNext(){
        while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;
        return hasNextByte();
    }
    public String next(){
        if(!hasNext()) throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while(isPrintableChar(b)){
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }
    public long nextLong(){
        if(!hasNext()) throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if(b == '-'){
            minus = true;
            b = readByte();
        }
        if(b < '0' || '9' < b){
            throw new NumberFormatException();
        }
        while(true){
            if('0' <= b && b <= '9'){
                n *= 10;
                n += b - '0';
            }else if(b == -1 || !isPrintableChar(b)){
                return minus ? -n : n;
            }else{
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }
    public int nextInt(){
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
        return (int) nl;
    }
    public double nextDouble(){
        return Double.parseDouble(next());
    }
}



class Pair implements Comparable<Pair>{
    long a, b;
    public Pair(long i, long j){
        a = i;
        b = j;
    }

    @Override
    public int compareTo(Pair p){
        if(this.b < p.b) return -1;
        else if(this.b > p.b) return 1;
        else return 0;
    }
} import java.io.*; io.* java import java.util.*; util.* java class Main{
    final static long MOD = 1000000007;
    FastScanner sc = new FastScanner();

    public static void main(String[] args) {
        new Main().solve();
    }

    void solve(){

        int n = sc.nextInt();
        Map<String, Integer> m = new HashMap<>();
        int max = 0;

        for(int i = 0; i < n; i++){
            String s = sc.next();
            if(m.get(s) == null) m.put(s, 1);
            else m.put(s, m.get(s) + 1);
            max = Math.max(max, m.get(s));
        }

        SortedSet<String> k = new TreeSet<>(m.keySet());

        for(String s : k){
            if(m.get(s) == max) System.out.println(s);
        }

    }

    long mod_pow(long a, long r){ // return a^r (mod MOD)
        long sum = 1;
        while(r > 0){
            if((r & 1) == 1){
                sum *= a;
                sum %= MOD;
            }
            a *= a;
            a %= MOD;
            r >>= 1;
        }
        return sum;
    }

    long mod_inv(long a){ // return aの逆元 (mod MOD)
        return mod_pow(a, MOD - 2);
    }

    long fact(long n){ // return n!
        if(n == 0){
            return 1;
        }
        return n * fact(n - 1);
    }

    long mod_fact(long n){ // retur n! (mod MOD)
        if(n == 0){
            return 1;
        }
        return n * mod_fact(n - 1) % MOD;
    }

    int numOfCombination(int n, int r){ // return nCr
        int num = 1;
        for(int i = 1; i <= r; i++){
            num = num * (n - i + 1) / i;
        }
        return num;
    }

    long gcd(long a, long b){ // return aとbの最大公約数
        if(b == 0){
          return a;
        }
        return gcd(b, a % b);
    }

    boolean is_prime(long a){ // aの素数判定
        if(a <= 1) return false;
        for(int i = 2; i * i <= a; i++){
            if(a % i == 0) return false;
        }
        return true;
    }

    String nextPermutation(String s){ // return sの次の順列
        ArrayList<Character> list = new ArrayList<>();
        for(int i = 0; i < s.length(); i++) list.add(s.charAt(i));

        int pivotPos = -1;
        char pivot = 0;
        for(int i = list.size() - 2; i >= 0; i--){
            if(list.get(i) < list.get(i+1)){
    			pivotPos = i;
    			pivot = list.get(i);
    			break;
    		}
    	}

        if(pivotPos == -1 && pivot == 0) return null;

        int L = pivotPos + 1;
        int R = list.size() - 1;
    	int minPos = -1;
    	char min = Character.MAX_VALUE;
    	for(int i = R; i >= L; i--){
    		if(pivot < list.get(i)){
    			if(list.get(i) < min){
    				min = list.get(i);
    				minPos = i;
    			}
    		}
    	}

    	Collections.swap(list, pivotPos, minPos);
    	Collections.sort(list.subList(L, R + 1));

    	StringBuilder sb = new StringBuilder();
    	for(int i=0; i<list.size(); i++) sb.append(list.get(i));

    	return sb.toString();
    }

} Main final static long MOD = 1000000007; MOD 1000000007 FastScanner sc = new FastScanner(); sc new FastScanner() public static void main(String[] args) {
        new Main().solve();
    } main {
        new Main().solve();
    } new Main().solve() new Main().solve new Main() String[] args args void solve(){

        int n = sc.nextInt();
        Map<String, Integer> m = new HashMap<>();
        int max = 0;

        for(int i = 0; i < n; i++){
            String s = sc.next();
            if(m.get(s) == null) m.put(s, 1);
            else m.put(s, m.get(s) + 1);
            max = Math.max(max, m.get(s));
        }

        SortedSet<String> k = new TreeSet<>(m.keySet());

        for(String s : k){
            if(m.get(s) == max) System.out.println(s);
        }

    } solve {

        int n = sc.nextInt();
        Map<String, Integer> m = new HashMap<>();
        int max = 0;

        for(int i = 0; i < n; i++){
            String s = sc.next();
            if(m.get(s) == null) m.put(s, 1);
            else m.put(s, m.get(s) + 1);
            max = Math.max(max, m.get(s));
        }

        SortedSet<String> k = new TreeSet<>(m.keySet());

        for(String s : k){
            if(m.get(s) == max) System.out.println(s);
        }

    } int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc Map<String, Integer> m = new HashMap<>(); m new HashMap<>() int max = 0; max 0 for(int i = 0; i < n; i++){
            String s = sc.next();
            if(m.get(s) == null) m.put(s, 1);
            else m.put(s, m.get(s) + 1);
            max = Math.max(max, m.get(s));
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            String s = sc.next();
            if(m.get(s) == null) m.put(s, 1);
            else m.put(s, m.get(s) + 1);
            max = Math.max(max, m.get(s));
        } {
            String s = sc.next();
            if(m.get(s) == null) m.put(s, 1);
            else m.put(s, m.get(s) + 1);
            max = Math.max(max, m.get(s));
        } String s = sc.next(); s sc.next() sc.next sc if(m.get(s) == null) m.put(s, 1);
            else m.put(s, m.get(s) + 1); m.get(s) == null m.get(s) m.get m s null m.put(s, 1) m.put m s 1 m.put(s, m.get(s) + 1) m.put m s m.get(s) + 1 m.get(s) m.get m s 1 max = Math.max(max, m.get(s)) max Math.max(max, m.get(s)) Math.max Math max m.get(s) m.get m s SortedSet<String> k = new TreeSet<>(m.keySet()); k new TreeSet<>(m.keySet()) for(String s : k){
            if(m.get(s) == max) System.out.println(s);
        } String s k {
            if(m.get(s) == max) System.out.println(s);
        } {
            if(m.get(s) == max) System.out.println(s);
        } if(m.get(s) == max) System.out.println(s); m.get(s) == max m.get(s) m.get m s max System.out.println(s) System.out.println System.out System System.out s long mod_pow(long a, long r){ // return a^r (mod MOD)
        long sum = 1;
        while(r > 0){
            if((r & 1) == 1){
                sum *= a;
                sum %= MOD;
            }
            a *= a;
            a %= MOD;
            r >>= 1;
        }
        return sum;
    } mod_pow { // return a^r (mod MOD)
        long sum = 1;
        while(r > 0){
            if((r & 1) == 1){
                sum *= a;
                sum %= MOD;
            }
            a *= a;
            a %= MOD;
            r >>= 1;
        }
        return sum;
    } long sum = 1; sum 1 while(r > 0){
            if((r & 1) == 1){
                sum *= a;
                sum %= MOD;
            }
            a *= a;
            a %= MOD;
            r >>= 1;
        } r > 0 r 0 {
            if((r & 1) == 1){
                sum *= a;
                sum %= MOD;
            }
            a *= a;
            a %= MOD;
            r >>= 1;
        } if((r & 1) == 1){
                sum *= a;
                sum %= MOD;
            } (r & 1) == 1 (r & 1) r 1 1 {
                sum *= a;
                sum %= MOD;
            } sum *= a sum a sum %= MOD sum MOD a *= a a a a %= MOD a MOD r >>= 1 r 1 return sum; sum long a a long r r long mod_inv(long a){ // return aの逆元 (mod MOD)
        return mod_pow(a, MOD - 2);
    } mod_inv { // return aの逆元 (mod MOD)
        return mod_pow(a, MOD - 2);
    } return mod_pow(a, MOD - 2); mod_pow(a, MOD - 2) mod_pow a MOD - 2 MOD 2 long a a long fact(long n){ // return n!
        if(n == 0){
            return 1;
        }
        return n * fact(n - 1);
    } fact { // return n!
        if(n == 0){
            return 1;
        }
        return n * fact(n - 1);
    } if(n == 0){
            return 1;
        } n == 0 n 0 {
            return 1;
        } return 1; 1 return n * fact(n - 1); n * fact(n - 1) n fact(n - 1) fact n - 1 n 1 long n n long mod_fact(long n){ // retur n! (mod MOD)
        if(n == 0){
            return 1;
        }
        return n * mod_fact(n - 1) % MOD;
    } mod_fact { // retur n! (mod MOD)
        if(n == 0){
            return 1;
        }
        return n * mod_fact(n - 1) % MOD;
    } if(n == 0){
            return 1;
        } n == 0 n 0 {
            return 1;
        } return 1; 1 return n * mod_fact(n - 1) % MOD; n * mod_fact(n - 1) % MOD n * mod_fact(n - 1) n mod_fact(n - 1) mod_fact n - 1 n 1 MOD long n n int numOfCombination(int n, int r){ // return nCr
        int num = 1;
        for(int i = 1; i <= r; i++){
            num = num * (n - i + 1) / i;
        }
        return num;
    } numOfCombination { // return nCr
        int num = 1;
        for(int i = 1; i <= r; i++){
            num = num * (n - i + 1) / i;
        }
        return num;
    } int num = 1; num 1 for(int i = 1; i <= r; i++){
            num = num * (n - i + 1) / i;
        } int i = 1; int i = 1; i 1 i <= r i r i++ i++ i {
            num = num * (n - i + 1) / i;
        } {
            num = num * (n - i + 1) / i;
        } num = num * (n - i + 1) / i num num * (n - i + 1) / i num * (n - i + 1) num (n - i + 1) n - i n i 1 i return num; num int n n int r r long gcd(long a, long b){ // return aとbの最大公約数
        if(b == 0){
          return a;
        }
        return gcd(b, a % b);
    } gcd { // return aとbの最大公約数
        if(b == 0){
          return a;
        }
        return gcd(b, a % b);
    } if(b == 0){
          return a;
        } b == 0 b 0 {
          return a;
        } return a; a return gcd(b, a % b); gcd(b, a % b) gcd b a % b a b long a a long b b boolean is_prime(long a){ // aの素数判定
        if(a <= 1) return false;
        for(int i = 2; i * i <= a; i++){
            if(a % i == 0) return false;
        }
        return true;
    } is_prime { // aの素数判定
        if(a <= 1) return false;
        for(int i = 2; i * i <= a; i++){
            if(a % i == 0) return false;
        }
        return true;
    } if(a <= 1) return false; a <= 1 a 1 return false; false for(int i = 2; i * i <= a; i++){
            if(a % i == 0) return false;
        } int i = 2; int i = 2; i 2 i * i <= a i * i i i a i++ i++ i {
            if(a % i == 0) return false;
        } {
            if(a % i == 0) return false;
        } if(a % i == 0) return false; a % i == 0 a % i a i 0 return false; false return true; true long a a String nextPermutation(String s){ // return sの次の順列
        ArrayList<Character> list = new ArrayList<>();
        for(int i = 0; i < s.length(); i++) list.add(s.charAt(i));

        int pivotPos = -1;
        char pivot = 0;
        for(int i = list.size() - 2; i >= 0; i--){
            if(list.get(i) < list.get(i+1)){
    			pivotPos = i;
    			pivot = list.get(i);
    			break;
    		}
    	}

        if(pivotPos == -1 && pivot == 0) return null;

        int L = pivotPos + 1;
        int R = list.size() - 1;
    	int minPos = -1;
    	char min = Character.MAX_VALUE;
    	for(int i = R; i >= L; i--){
    		if(pivot < list.get(i)){
    			if(list.get(i) < min){
    				min = list.get(i);
    				minPos = i;
    			}
    		}
    	}

    	Collections.swap(list, pivotPos, minPos);
    	Collections.sort(list.subList(L, R + 1));

    	StringBuilder sb = new StringBuilder();
    	for(int i=0; i<list.size(); i++) sb.append(list.get(i));

    	return sb.toString();
    } nextPermutation { // return sの次の順列
        ArrayList<Character> list = new ArrayList<>();
        for(int i = 0; i < s.length(); i++) list.add(s.charAt(i));

        int pivotPos = -1;
        char pivot = 0;
        for(int i = list.size() - 2; i >= 0; i--){
            if(list.get(i) < list.get(i+1)){
    			pivotPos = i;
    			pivot = list.get(i);
    			break;
    		}
    	}

        if(pivotPos == -1 && pivot == 0) return null;

        int L = pivotPos + 1;
        int R = list.size() - 1;
    	int minPos = -1;
    	char min = Character.MAX_VALUE;
    	for(int i = R; i >= L; i--){
    		if(pivot < list.get(i)){
    			if(list.get(i) < min){
    				min = list.get(i);
    				minPos = i;
    			}
    		}
    	}

    	Collections.swap(list, pivotPos, minPos);
    	Collections.sort(list.subList(L, R + 1));

    	StringBuilder sb = new StringBuilder();
    	for(int i=0; i<list.size(); i++) sb.append(list.get(i));

    	return sb.toString();
    } ArrayList<Character> list = new ArrayList<>(); list new ArrayList<>() for(int i = 0; i < s.length(); i++) list.add(s.charAt(i)); int i = 0; int i = 0; i 0 i < s.length() i s.length() s.length s i++ i++ i list.add(s.charAt(i)); list.add(s.charAt(i)) list.add list s.charAt(i) s.charAt s i int pivotPos = -1; pivotPos -1 1 char pivot = 0; pivot 0 for(int i = list.size() - 2; i >= 0; i--){
            if(list.get(i) < list.get(i+1)){
    			pivotPos = i;
    			pivot = list.get(i);
    			break;
    		}
    	} int i = list.size() - 2; int i = list.size() - 2; i list.size() - 2 list.size() list.size list 2 i >= 0 i 0 i-- i-- i {
            if(list.get(i) < list.get(i+1)){
    			pivotPos = i;
    			pivot = list.get(i);
    			break;
    		}
    	} {
            if(list.get(i) < list.get(i+1)){
    			pivotPos = i;
    			pivot = list.get(i);
    			break;
    		}
    	} if(list.get(i) < list.get(i+1)){
    			pivotPos = i;
    			pivot = list.get(i);
    			break;
    		} list.get(i) < list.get(i+1) list.get(i) list.get list i list.get(i+1) list.get list i+1 i 1 {
    			pivotPos = i;
    			pivot = list.get(i);
    			break;
    		} pivotPos = i pivotPos i pivot = list.get(i) pivot list.get(i) list.get list i break; if(pivotPos == -1 && pivot == 0) return null; pivotPos == -1 && pivot == 0 pivotPos == -1 pivotPos -1 1 pivot == 0 pivot 0 return null; null int L = pivotPos + 1; L pivotPos + 1 pivotPos 1 int R = list.size() - 1; R list.size() - 1 list.size() list.size list 1 int minPos = -1; minPos -1 1 char min = Character.MAX_VALUE; min Character.MAX_VALUE Character Character.MAX_VALUE for(int i = R; i >= L; i--){
    		if(pivot < list.get(i)){
    			if(list.get(i) < min){
    				min = list.get(i);
    				minPos = i;
    			}
    		}
    	} int i = R; int i = R; i R i >= L i L i-- i-- i {
    		if(pivot < list.get(i)){
    			if(list.get(i) < min){
    				min = list.get(i);
    				minPos = i;
    			}
    		}
    	} {
    		if(pivot < list.get(i)){
    			if(list.get(i) < min){
    				min = list.get(i);
    				minPos = i;
    			}
    		}
    	} if(pivot < list.get(i)){
    			if(list.get(i) < min){
    				min = list.get(i);
    				minPos = i;
    			}
    		} pivot < list.get(i) pivot list.get(i) list.get list i {
    			if(list.get(i) < min){
    				min = list.get(i);
    				minPos = i;
    			}
    		} if(list.get(i) < min){
    				min = list.get(i);
    				minPos = i;
    			} list.get(i) < min list.get(i) list.get list i min {
    				min = list.get(i);
    				minPos = i;
    			} min = list.get(i) min list.get(i) list.get list i minPos = i minPos i Collections.swap(list, pivotPos, minPos) Collections.swap Collections list pivotPos minPos Collections.sort(list.subList(L, R + 1)) Collections.sort Collections list.subList(L, R + 1) list.subList list L R + 1 R 1 StringBuilder sb = new StringBuilder(); sb new StringBuilder() for(int i=0; i<list.size(); i++) sb.append(list.get(i)); int i=0; int i=0; i 0 i<list.size() i list.size() list.size list i++ i++ i sb.append(list.get(i)); sb.append(list.get(i)) sb.append sb list.get(i) list.get list i return sb.toString(); sb.toString() sb.toString sb String s s class FastScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;
    private boolean hasNextByte(){
        if(ptr < buflen){
            return true;
        }else{
            ptr = 0;
            try{
                buflen = in.read(buffer);
            }catch(IOException e){
                e.printStackTrace();
            }
            if(buflen <= 0){
                return false;
            }
        }
        return true;
    }
    private int readByte(){
        if(hasNextByte()) return buffer[ptr++];
        else return -1;
    }
    private static boolean isPrintableChar(int c){
        return 33 <= c && c <= 126;
    }
    public boolean hasNext(){
        while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;
        return hasNextByte();
    }
    public String next(){
        if(!hasNext()) throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while(isPrintableChar(b)){
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }
    public long nextLong(){
        if(!hasNext()) throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if(b == '-'){
            minus = true;
            b = readByte();
        }
        if(b < '0' || '9' < b){
            throw new NumberFormatException();
        }
        while(true){
            if('0' <= b && b <= '9'){
                n *= 10;
                n += b - '0';
            }else if(b == -1 || !isPrintableChar(b)){
                return minus ? -n : n;
            }else{
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }
    public int nextInt(){
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
        return (int) nl;
    }
    public double nextDouble(){
        return Double.parseDouble(next());
    }
} FastScanner private final InputStream in = System.in; in System.in System System.in private final byte[] buffer = new byte[1024]; buffer new byte[1024] 1024 private int ptr = 0; ptr 0 private int buflen = 0; buflen 0 private boolean hasNextByte(){
        if(ptr < buflen){
            return true;
        }else{
            ptr = 0;
            try{
                buflen = in.read(buffer);
            }catch(IOException e){
                e.printStackTrace();
            }
            if(buflen <= 0){
                return false;
            }
        }
        return true;
    } hasNextByte {
        if(ptr < buflen){
            return true;
        }else{
            ptr = 0;
            try{
                buflen = in.read(buffer);
            }catch(IOException e){
                e.printStackTrace();
            }
            if(buflen <= 0){
                return false;
            }
        }
        return true;
    } if(ptr < buflen){
            return true;
        }else{
            ptr = 0;
            try{
                buflen = in.read(buffer);
            }catch(IOException e){
                e.printStackTrace();
            }
            if(buflen <= 0){
                return false;
            }
        } ptr < buflen ptr buflen {
            return true;
        } return true; true {
            ptr = 0;
            try{
                buflen = in.read(buffer);
            }catch(IOException e){
                e.printStackTrace();
            }
            if(buflen <= 0){
                return false;
            }
        } ptr = 0 ptr 0 try{
                buflen = in.read(buffer);
            }catch(IOException e){
                e.printStackTrace();
            } catch(IOException e){
                e.printStackTrace();
            } IOException e {
                e.printStackTrace();
            } e.printStackTrace() e.printStackTrace e {
                buflen = in.read(buffer);
            } buflen = in.read(buffer) buflen in.read(buffer) in.read in buffer if(buflen <= 0){
                return false;
            } buflen <= 0 buflen 0 {
                return false;
            } return false; false return true; true private int readByte(){
        if(hasNextByte()) return buffer[ptr++];
        else return -1;
    } readByte {
        if(hasNextByte()) return buffer[ptr++];
        else return -1;
    } if(hasNextByte()) return buffer[ptr++];
        else return -1; hasNextByte() hasNextByte return buffer[ptr++]; buffer[ptr++] buffer ptr++ ptr return -1; -1 1 private static boolean isPrintableChar(int c){
        return 33 <= c && c <= 126;
    } isPrintableChar {
        return 33 <= c && c <= 126;
    } return 33 <= c && c <= 126; 33 <= c && c <= 126 33 <= c 33 c c <= 126 c 126 int c c public boolean hasNext(){
        while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;
        return hasNextByte();
    } hasNext {
        while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;
        return hasNextByte();
    } while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; hasNextByte() && !isPrintableChar(buffer[ptr]) hasNextByte() hasNextByte !isPrintableChar(buffer[ptr]) isPrintableChar(buffer[ptr]) isPrintableChar buffer[ptr] buffer ptr ptr++ ptr return hasNextByte(); hasNextByte() hasNextByte public String next(){
        if(!hasNext()) throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while(isPrintableChar(b)){
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    } next {
        if(!hasNext()) throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while(isPrintableChar(b)){
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    } if(!hasNext()) throw new NoSuchElementException(); !hasNext() hasNext() hasNext throw new NoSuchElementException(); new NoSuchElementException() StringBuilder sb = new StringBuilder(); sb new StringBuilder() int b = readByte(); b readByte() readByte while(isPrintableChar(b)){
            sb.appendCodePoint(b);
            b = readByte();
        } isPrintableChar(b) isPrintableChar b {
            sb.appendCodePoint(b);
            b = readByte();
        } sb.appendCodePoint(b) sb.appendCodePoint sb b b = readByte() b readByte() readByte return sb.toString(); sb.toString() sb.toString sb public long nextLong(){
        if(!hasNext()) throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if(b == '-'){
            minus = true;
            b = readByte();
        }
        if(b < '0' || '9' < b){
            throw new NumberFormatException();
        }
        while(true){
            if('0' <= b && b <= '9'){
                n *= 10;
                n += b - '0';
            }else if(b == -1 || !isPrintableChar(b)){
                return minus ? -n : n;
            }else{
                throw new NumberFormatException();
            }
            b = readByte();
        }
    } nextLong {
        if(!hasNext()) throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if(b == '-'){
            minus = true;
            b = readByte();
        }
        if(b < '0' || '9' < b){
            throw new NumberFormatException();
        }
        while(true){
            if('0' <= b && b <= '9'){
                n *= 10;
                n += b - '0';
            }else if(b == -1 || !isPrintableChar(b)){
                return minus ? -n : n;
            }else{
                throw new NumberFormatException();
            }
            b = readByte();
        }
    } if(!hasNext()) throw new NoSuchElementException(); !hasNext() hasNext() hasNext throw new NoSuchElementException(); new NoSuchElementException() long n = 0; n 0 boolean minus = false; minus false int b = readByte(); b readByte() readByte if(b == '-'){
            minus = true;
            b = readByte();
        } b == '-' b '-' {
            minus = true;
            b = readByte();
        } minus = true minus true b = readByte() b readByte() readByte if(b < '0' || '9' < b){
            throw new NumberFormatException();
        } b < '0' || '9' < b b < '0' b '0' '9' < b '9' b {
            throw new NumberFormatException();
        } throw new NumberFormatException(); new NumberFormatException() while(true){
            if('0' <= b && b <= '9'){
                n *= 10;
                n += b - '0';
            }else if(b == -1 || !isPrintableChar(b)){
                return minus ? -n : n;
            }else{
                throw new NumberFormatException();
            }
            b = readByte();
        } true {
            if('0' <= b && b <= '9'){
                n *= 10;
                n += b - '0';
            }else if(b == -1 || !isPrintableChar(b)){
                return minus ? -n : n;
            }else{
                throw new NumberFormatException();
            }
            b = readByte();
        } if('0' <= b && b <= '9'){
                n *= 10;
                n += b - '0';
            }else if(b == -1 || !isPrintableChar(b)){
                return minus ? -n : n;
            }else{
                throw new NumberFormatException();
            } '0' <= b && b <= '9' '0' <= b '0' b b <= '9' b '9' {
                n *= 10;
                n += b - '0';
            } n *= 10 n 10 n += b - '0' n b - '0' b '0' if(b == -1 || !isPrintableChar(b)){
                return minus ? -n : n;
            }else{
                throw new NumberFormatException();
            } b == -1 || !isPrintableChar(b) b == -1 b -1 1 !isPrintableChar(b) isPrintableChar(b) isPrintableChar b {
                return minus ? -n : n;
            } return minus ? -n : n; minus ? -n : n minus -n n n {
                throw new NumberFormatException();
            } throw new NumberFormatException(); new NumberFormatException() b = readByte() b readByte() readByte public int nextInt(){
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
        return (int) nl;
    } nextInt {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
        return (int) nl;
    } long nl = nextLong(); nl nextLong() nextLong if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException(); nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE nl < Integer.MIN_VALUE nl Integer.MIN_VALUE Integer Integer.MIN_VALUE nl > Integer.MAX_VALUE nl Integer.MAX_VALUE Integer Integer.MAX_VALUE throw new NumberFormatException(); new NumberFormatException() return (int) nl; (int) nl public double nextDouble(){
        return Double.parseDouble(next());
    } nextDouble {
        return Double.parseDouble(next());
    } return Double.parseDouble(next()); Double.parseDouble(next()) Double.parseDouble Double next() next class Pair implements Comparable<Pair>{
    long a, b;
    public Pair(long i, long j){
        a = i;
        b = j;
    }

    @Override
    public int compareTo(Pair p){
        if(this.b < p.b) return -1;
        else if(this.b > p.b) return 1;
        else return 0;
    }
} Pair long a a b; b public Pair(long i, long j){
        a = i;
        b = j;
    } Pair {
        a = i;
        b = j;
    } a = i a i b = j b j long i i long j j @Override
    public int compareTo(Pair p){
        if(this.b < p.b) return -1;
        else if(this.b > p.b) return 1;
        else return 0;
    } compareTo {
        if(this.b < p.b) return -1;
        else if(this.b > p.b) return 1;
        else return 0;
    } if(this.b < p.b) return -1;
        else if(this.b > p.b) return 1;
        else return 0; this.b < p.b this.b this this.b p.b p p.b return -1; -1 1 if(this.b > p.b) return 1;
        else return 0; this.b > p.b this.b this this.b p.b p p.b return 1; 1 return 0; 0 Pair p p Comparable
import java.io.*;
import java.util.*;

class Main{
    final static long MOD = 1000000007;
    FastScanner sc = new FastScanner();

    public static void main(String[] args) {
        new Main().solve();
    }

    void solve(){

        int n = sc.nextInt();
        Map<String, Integer> m = new HashMap<>();
        int max = 0;

        for(int i = 0; i < n; i++){
            String s = sc.next();
            if(m.get(s) == null) m.put(s, 1);
            else m.put(s, m.get(s) + 1);
            max = Math.max(max, m.get(s));
        }

        SortedSet<String> k = new TreeSet<>(m.keySet());

        for(String s : k){
            if(m.get(s) == max) System.out.println(s);
        }

    }

    long mod_pow(long a, long r){ // return a^r (mod MOD)
        long sum = 1;
        while(r > 0){
            if((r & 1) == 1){
                sum *= a;
                sum %= MOD;
            }
            a *= a;
            a %= MOD;
            r >>= 1;
        }
        return sum;
    }

    long mod_inv(long a){ // return aの逆元 (mod MOD)
        return mod_pow(a, MOD - 2);
    }

    long fact(long n){ // return n!
        if(n == 0){
            return 1;
        }
        return n * fact(n - 1);
    }

    long mod_fact(long n){ // retur n! (mod MOD)
        if(n == 0){
            return 1;
        }
        return n * mod_fact(n - 1) % MOD;
    }

    int numOfCombination(int n, int r){ // return nCr
        int num = 1;
        for(int i = 1; i <= r; i++){
            num = num * (n - i + 1) / i;
        }
        return num;
    }

    long gcd(long a, long b){ // return aとbの最大公約数
        if(b == 0){
          return a;
        }
        return gcd(b, a % b);
    }

    boolean is_prime(long a){ // aの素数判定
        if(a <= 1) return false;
        for(int i = 2; i * i <= a; i++){
            if(a % i == 0) return false;
        }
        return true;
    }

    String nextPermutation(String s){ // return sの次の順列
        ArrayList<Character> list = new ArrayList<>();
        for(int i = 0; i < s.length(); i++) list.add(s.charAt(i));

        int pivotPos = -1;
        char pivot = 0;
        for(int i = list.size() - 2; i >= 0; i--){
            if(list.get(i) < list.get(i+1)){
    			pivotPos = i;
    			pivot = list.get(i);
    			break;
    		}
    	}

        if(pivotPos == -1 && pivot == 0) return null;

        int L = pivotPos + 1;
        int R = list.size() - 1;
    	int minPos = -1;
    	char min = Character.MAX_VALUE;
    	for(int i = R; i >= L; i--){
    		if(pivot < list.get(i)){
    			if(list.get(i) < min){
    				min = list.get(i);
    				minPos = i;
    			}
    		}
    	}

    	Collections.swap(list, pivotPos, minPos);
    	Collections.sort(list.subList(L, R + 1));

    	StringBuilder sb = new StringBuilder();
    	for(int i=0; i<list.size(); i++) sb.append(list.get(i));

    	return sb.toString();
    }

}



class FastScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;
    private boolean hasNextByte(){
        if(ptr < buflen){
            return true;
        }else{
            ptr = 0;
            try{
                buflen = in.read(buffer);
            }catch(IOException e){
                e.printStackTrace();
            }
            if(buflen <= 0){
                return false;
            }
        }
        return true;
    }
    private int readByte(){
        if(hasNextByte()) return buffer[ptr++];
        else return -1;
    }
    private static boolean isPrintableChar(int c){
        return 33 <= c && c <= 126;
    }
    public boolean hasNext(){
        while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;
        return hasNextByte();
    }
    public String next(){
        if(!hasNext()) throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while(isPrintableChar(b)){
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }
    public long nextLong(){
        if(!hasNext()) throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if(b == '-'){
            minus = true;
            b = readByte();
        }
        if(b < '0' || '9' < b){
            throw new NumberFormatException();
        }
        while(true){
            if('0' <= b && b <= '9'){
                n *= 10;
                n += b - '0';
            }else if(b == -1 || !isPrintableChar(b)){
                return minus ? -n : n;
            }else{
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }
    public int nextInt(){
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
        return (int) nl;
    }
    public double nextDouble(){
        return Double.parseDouble(next());
    }
}



class Pair implements Comparable<Pair>{
    long a, b;
    public Pair(long i, long j){
        a = i;
        b = j;
    }

    @Override
    public int compareTo(Pair p){
        if(this.b < p.b) return -1;
        else if(this.b > p.b) return 1;
        else return 0;
    }
}
