//
import java.math.*;
import java.util.*;
import java.io.*;
  
public class Main { 
  
    static BufferedReader in;
    static PrintWriter out = new PrintWriter(System.out);
    static String file = "../in";
    static int test = 10; // 0 for local testing, 1 for std input
    static int inf = 1_000_000;

    void swap(int[]ary, int i, int j)
    {
        int t = ary[i];
        ary[i] = ary[j];
        ary[j] = t;
    }
    
    String[] split() throws Exception
    {
        return in.readLine().split(" ");
    }

    int readInt() throws Exception
    {
        return Integer.valueOf(in.readLine());
    }

    int[] toIntArray() throws Exception
    {
        String[] sp = split();
        int n = sp.length;
        int[] ary = new int[n];
        for(int i = 0; i < n; i++) ary[i] = Integer.valueOf(sp[i]);
        return ary;
    }

    String reverse(String str)
    {
        return new StringBuilder(str).reverse().toString();
    }

    public static void main(String[] args) throws Exception
    {
        int _k = Integer.valueOf("1");
        if(test > 0) in = new BufferedReader(new InputStreamReader(System.in));
        else in = new BufferedReader(new FileReader(file));
        if(test < 0) {String[] str = in.readLine().split(" ");}
/***********************************************************************/
/***********************************************************************/
/***********************************************************************/
/***********************************************************************/
        new Main().c();
        out.flush();
    }
    
    int mod = 1_000_000_007;

    long pow(long a, int pow)
    {
        long res = 1;
        while(pow > 0)
        {
            if(pow % 2 != 0) {
                res *= a;
                res %= mod;
            }
            a = a * a;
            a %= mod;
            pow /= 2;
        }

        return res;
    }

    long comb(int n, int k)
    {
        if(n < 0 || k < 0 || k > n) return 0;

        return (((f[n] * ff[k]) % mod) * f[n - k]) % mod;
    }

    long[] f = new long[2_000_010], ff = new long[2_000_010];

    void f() throws Exception
    {
        
    }

    void e2(int n, int k)
    {
        for(int i = 0; i <= n; i++)
        {
            int a = i;
            int c = 0;
            while(a > 0)
            {
                if(a % 10 != 0) c++;
                a /= 10;
            }
            if(c == k) System.out.println(i);
        }
    }

    long ehelper(String str, int k)
    {
        int idx = 0;
        while(str.charAt(idx) == '0') idx++;
        str = str.substring(idx);
        char[] chs = str.toCharArray();
        int n = chs.length;
        if(n < k)
        {
            // System.out.println(0);
            return 0;
        }
        long sum = 0;

        if(k == 1)
        {
            sum += chs[0] - '0';
            sum += (n - 1) * 9;
        }
        if(k == 2)
        {
            int val = chs[0] - '0';
            sum += (n - 1) * (n - 2) / 2 * 81;
            for(int i = 1; i < val; i++)
            {
                sum += (n - 1) * 9;
            }
            for(int i = 1; i < n; i++) {
                if(chs[i] != '0')
                {
                    sum += chs[i] - '0';
                    sum += 9 * (n - i - 1);
                    break;
                }
            }
        }
        if(k == 3)
        {
            int val = chs[0] - '0';
            sum += (n - 1) * (n - 2) * (n - 3) / 6 * 729;
            for(int i = 1; i < val; i++)
            {
                sum += (n - 1) * (n - 2) / 2 * 81;
            }
            // System.out.println("..." +sum);
            sum += ehelper(str.substring(1), k - 1);
        }
        
        return sum;
    }


    void e() throws Exception
    {
        String str = in.readLine();
        int k = readInt();
        
        // e2(Integer.valueOf(str), k);
        System.out.println(ehelper(str, k));
    }

    long gcd(long a, long b)
    {
        if(b == 0) return a;
        return gcd(b, a % b);
    }

    void d() throws Exception
    {
        String[] sp = split();
        int n = Integer.valueOf(sp[0]),
            k = Integer.valueOf(sp[1]);
        sp = split();

        double[] db = new double[n];
        for(int i = 0; i < n; i++)
        {
            int v = Integer.valueOf(sp[i]);
            int sum = (1 + v) * v / 2;
            double avg = 1.0 * sum / v;
            db[i] = avg;
        }

        // every k window
        double maxi = 0.0;
        double runsum = 0.0;

        for(int i = 0; i < n; i++)
        {
            runsum += db[i];
            if(i >= k - 1)
            {
                if(i >= k) runsum -= db[i - k];
                maxi = Math.max(maxi, runsum);
            }
        }
        System.out.println(maxi);

    }
    
    boolean satisfy(int a, int b)
    {
        String s1 = String.valueOf(a),
                s2 = String.valueOf(b);
        int m = s1.length(), n = s2.length();
        if(s1.charAt(0) == s2.charAt(n - 1) && 
            s1.charAt(m - 1) == s2.charAt(0)) return true;
        return false;
    }

    void c() throws Exception
    {
        int n = readInt();
        TreeMap<String, Integer> map = new TreeMap<>();
        int maxi = 0;

        for(int i = 0; i< n; i++)
        {
            String str = in.readLine();
            map.put(str, map.getOrDefault(str, 0) + 1);
            maxi = Math.max(maxi, map.get(str));
        }

        for(String str : map.keySet())
        {
            if(map.get(str) == maxi)
                out.println(str);
        }
    }

    void b() throws Exception
    {
        int n = readInt();
        int[] ary = toIntArray();
        boolean flag = true;
        for(int k : ary)
        {
            if((k & 1) == 0)
            {
                if(k % 3 != 0 && k % 5 != 0)
                {
                    flag = false;
                }
            }
        }
        if(flag) System.out.println("APPROVED");
        else System.out.println("DENIED");
    }

    void a() throws Exception
    {
        int[] ary = toIntArray();
        Arrays.sort(ary);
        if(ary[0] == ary[1] && ary[1] != ary[2])
        {
            out.println("Yes");
        }
        else if(ary[0] != ary[1] && ary[1] == ary[2])
        {
            out.println("Yes");
        }
        else out.println("No");
    }
} import java.math.*; math.* java import java.util.*; util.* java import java.io.*; io.* java public class Main { 
  
    static BufferedReader in;
    static PrintWriter out = new PrintWriter(System.out);
    static String file = "../in";
    static int test = 10; // 0 for local testing, 1 for std input
    static int inf = 1_000_000;

    void swap(int[]ary, int i, int j)
    {
        int t = ary[i];
        ary[i] = ary[j];
        ary[j] = t;
    }
    
    String[] split() throws Exception
    {
        return in.readLine().split(" ");
    }

    int readInt() throws Exception
    {
        return Integer.valueOf(in.readLine());
    }

    int[] toIntArray() throws Exception
    {
        String[] sp = split();
        int n = sp.length;
        int[] ary = new int[n];
        for(int i = 0; i < n; i++) ary[i] = Integer.valueOf(sp[i]);
        return ary;
    }

    String reverse(String str)
    {
        return new StringBuilder(str).reverse().toString();
    }

    public static void main(String[] args) throws Exception
    {
        int _k = Integer.valueOf("1");
        if(test > 0) in = new BufferedReader(new InputStreamReader(System.in));
        else in = new BufferedReader(new FileReader(file));
        if(test < 0) {String[] str = in.readLine().split(" ");}
/***********************************************************************/
/***********************************************************************/
/***********************************************************************/
/***********************************************************************/
        new Main().c();
        out.flush();
    }
    
    int mod = 1_000_000_007;

    long pow(long a, int pow)
    {
        long res = 1;
        while(pow > 0)
        {
            if(pow % 2 != 0) {
                res *= a;
                res %= mod;
            }
            a = a * a;
            a %= mod;
            pow /= 2;
        }

        return res;
    }

    long comb(int n, int k)
    {
        if(n < 0 || k < 0 || k > n) return 0;

        return (((f[n] * ff[k]) % mod) * f[n - k]) % mod;
    }

    long[] f = new long[2_000_010], ff = new long[2_000_010];

    void f() throws Exception
    {
        
    }

    void e2(int n, int k)
    {
        for(int i = 0; i <= n; i++)
        {
            int a = i;
            int c = 0;
            while(a > 0)
            {
                if(a % 10 != 0) c++;
                a /= 10;
            }
            if(c == k) System.out.println(i);
        }
    }

    long ehelper(String str, int k)
    {
        int idx = 0;
        while(str.charAt(idx) == '0') idx++;
        str = str.substring(idx);
        char[] chs = str.toCharArray();
        int n = chs.length;
        if(n < k)
        {
            // System.out.println(0);
            return 0;
        }
        long sum = 0;

        if(k == 1)
        {
            sum += chs[0] - '0';
            sum += (n - 1) * 9;
        }
        if(k == 2)
        {
            int val = chs[0] - '0';
            sum += (n - 1) * (n - 2) / 2 * 81;
            for(int i = 1; i < val; i++)
            {
                sum += (n - 1) * 9;
            }
            for(int i = 1; i < n; i++) {
                if(chs[i] != '0')
                {
                    sum += chs[i] - '0';
                    sum += 9 * (n - i - 1);
                    break;
                }
            }
        }
        if(k == 3)
        {
            int val = chs[0] - '0';
            sum += (n - 1) * (n - 2) * (n - 3) / 6 * 729;
            for(int i = 1; i < val; i++)
            {
                sum += (n - 1) * (n - 2) / 2 * 81;
            }
            // System.out.println("..." +sum);
            sum += ehelper(str.substring(1), k - 1);
        }
        
        return sum;
    }


    void e() throws Exception
    {
        String str = in.readLine();
        int k = readInt();
        
        // e2(Integer.valueOf(str), k);
        System.out.println(ehelper(str, k));
    }

    long gcd(long a, long b)
    {
        if(b == 0) return a;
        return gcd(b, a % b);
    }

    void d() throws Exception
    {
        String[] sp = split();
        int n = Integer.valueOf(sp[0]),
            k = Integer.valueOf(sp[1]);
        sp = split();

        double[] db = new double[n];
        for(int i = 0; i < n; i++)
        {
            int v = Integer.valueOf(sp[i]);
            int sum = (1 + v) * v / 2;
            double avg = 1.0 * sum / v;
            db[i] = avg;
        }

        // every k window
        double maxi = 0.0;
        double runsum = 0.0;

        for(int i = 0; i < n; i++)
        {
            runsum += db[i];
            if(i >= k - 1)
            {
                if(i >= k) runsum -= db[i - k];
                maxi = Math.max(maxi, runsum);
            }
        }
        System.out.println(maxi);

    }
    
    boolean satisfy(int a, int b)
    {
        String s1 = String.valueOf(a),
                s2 = String.valueOf(b);
        int m = s1.length(), n = s2.length();
        if(s1.charAt(0) == s2.charAt(n - 1) && 
            s1.charAt(m - 1) == s2.charAt(0)) return true;
        return false;
    }

    void c() throws Exception
    {
        int n = readInt();
        TreeMap<String, Integer> map = new TreeMap<>();
        int maxi = 0;

        for(int i = 0; i< n; i++)
        {
            String str = in.readLine();
            map.put(str, map.getOrDefault(str, 0) + 1);
            maxi = Math.max(maxi, map.get(str));
        }

        for(String str : map.keySet())
        {
            if(map.get(str) == maxi)
                out.println(str);
        }
    }

    void b() throws Exception
    {
        int n = readInt();
        int[] ary = toIntArray();
        boolean flag = true;
        for(int k : ary)
        {
            if((k & 1) == 0)
            {
                if(k % 3 != 0 && k % 5 != 0)
                {
                    flag = false;
                }
            }
        }
        if(flag) System.out.println("APPROVED");
        else System.out.println("DENIED");
    }

    void a() throws Exception
    {
        int[] ary = toIntArray();
        Arrays.sort(ary);
        if(ary[0] == ary[1] && ary[1] != ary[2])
        {
            out.println("Yes");
        }
        else if(ary[0] != ary[1] && ary[1] == ary[2])
        {
            out.println("Yes");
        }
        else out.println("No");
    }
} Main static BufferedReader in; in static PrintWriter out = new PrintWriter(System.out); out new PrintWriter(System.out) static String file = "../in"; file "../in" static int test = 10; // 0 for local testing, 1 for std input test 10 static int inf = 1_000_000; inf 1_000_000 int mod = 1_000_000_007; mod 1_000_000_007 long[] f = new long[2_000_010] f new long[2_000_010] 2_000_010 ff = new long[2_000_010]; ff new long[2_000_010] 2_000_010 void swap(int[]ary, int i, int j)
    {
        int t = ary[i];
        ary[i] = ary[j];
        ary[j] = t;
    } swap {
        int t = ary[i];
        ary[i] = ary[j];
        ary[j] = t;
    } int t = ary[i]; t ary[i] ary i ary[i] = ary[j] ary[i] ary i ary[j] ary j ary[j] = t ary[j] ary j t int[]ary ary int i i int j j String[] split() throws Exception
    {
        return in.readLine().split(" ");
    } split {
        return in.readLine().split(" ");
    } return in.readLine().split(" "); in.readLine().split(" ") in.readLine().split in.readLine() in.readLine in " " int readInt() throws Exception
    {
        return Integer.valueOf(in.readLine());
    } readInt {
        return Integer.valueOf(in.readLine());
    } return Integer.valueOf(in.readLine()); Integer.valueOf(in.readLine()) Integer.valueOf Integer in.readLine() in.readLine in int[] toIntArray() throws Exception
    {
        String[] sp = split();
        int n = sp.length;
        int[] ary = new int[n];
        for(int i = 0; i < n; i++) ary[i] = Integer.valueOf(sp[i]);
        return ary;
    } toIntArray {
        String[] sp = split();
        int n = sp.length;
        int[] ary = new int[n];
        for(int i = 0; i < n; i++) ary[i] = Integer.valueOf(sp[i]);
        return ary;
    } String[] sp = split(); sp split() split int n = sp.length; n sp.length sp sp.length int[] ary = new int[n]; ary new int[n] n for(int i = 0; i < n; i++) ary[i] = Integer.valueOf(sp[i]); int i = 0; int i = 0; i 0 i < n i n i++ i++ i ary[i] = Integer.valueOf(sp[i]); ary[i] = Integer.valueOf(sp[i]) ary[i] ary i Integer.valueOf(sp[i]) Integer.valueOf Integer sp[i] sp i return ary; ary String reverse(String str)
    {
        return new StringBuilder(str).reverse().toString();
    } reverse {
        return new StringBuilder(str).reverse().toString();
    } return new StringBuilder(str).reverse().toString(); new StringBuilder(str).reverse().toString() new StringBuilder(str).reverse().toString new StringBuilder(str).reverse() new StringBuilder(str).reverse new StringBuilder(str) String str str public static void main(String[] args) throws Exception
    {
        int _k = Integer.valueOf("1");
        if(test > 0) in = new BufferedReader(new InputStreamReader(System.in));
        else in = new BufferedReader(new FileReader(file));
        if(test < 0) {String[] str = in.readLine().split(" ");}
/***********************************************************************/
/***********************************************************************/
/***********************************************************************/
/***********************************************************************/
        new Main().c();
        out.flush();
    } main {
        int _k = Integer.valueOf("1");
        if(test > 0) in = new BufferedReader(new InputStreamReader(System.in));
        else in = new BufferedReader(new FileReader(file));
        if(test < 0) {String[] str = in.readLine().split(" ");}
/***********************************************************************/
/***********************************************************************/
/***********************************************************************/
/***********************************************************************/
        new Main().c();
        out.flush();
    } int _k = Integer.valueOf("1"); _k Integer.valueOf("1") Integer.valueOf Integer "1" if(test > 0) in = new BufferedReader(new InputStreamReader(System.in));
        else in = new BufferedReader(new FileReader(file)); test > 0 test 0 in = new BufferedReader(new InputStreamReader(System.in)) in new BufferedReader(new InputStreamReader(System.in)) in = new BufferedReader(new FileReader(file)) in new BufferedReader(new FileReader(file)) if(test < 0) {String[] str = in.readLine().split(" ");} test < 0 test 0 {String[] str = in.readLine().split(" ");} String[] str = in.readLine().split(" "); str in.readLine().split(" ") in.readLine().split in.readLine() in.readLine in " " new Main().c() new Main().c new Main() out.flush() out.flush out String[] args args long pow(long a, int pow)
    {
        long res = 1;
        while(pow > 0)
        {
            if(pow % 2 != 0) {
                res *= a;
                res %= mod;
            }
            a = a * a;
            a %= mod;
            pow /= 2;
        }

        return res;
    } pow {
        long res = 1;
        while(pow > 0)
        {
            if(pow % 2 != 0) {
                res *= a;
                res %= mod;
            }
            a = a * a;
            a %= mod;
            pow /= 2;
        }

        return res;
    } long res = 1; res 1 while(pow > 0)
        {
            if(pow % 2 != 0) {
                res *= a;
                res %= mod;
            }
            a = a * a;
            a %= mod;
            pow /= 2;
        } pow > 0 pow 0 {
            if(pow % 2 != 0) {
                res *= a;
                res %= mod;
            }
            a = a * a;
            a %= mod;
            pow /= 2;
        } if(pow % 2 != 0) {
                res *= a;
                res %= mod;
            } pow % 2 != 0 pow % 2 pow 2 0 {
                res *= a;
                res %= mod;
            } res *= a res a res %= mod res mod a = a * a a a * a a a a %= mod a mod pow /= 2 pow 2 return res; res long a a int pow pow long comb(int n, int k)
    {
        if(n < 0 || k < 0 || k > n) return 0;

        return (((f[n] * ff[k]) % mod) * f[n - k]) % mod;
    } comb {
        if(n < 0 || k < 0 || k > n) return 0;

        return (((f[n] * ff[k]) % mod) * f[n - k]) % mod;
    } if(n < 0 || k < 0 || k > n) return 0; n < 0 || k < 0 || k > n n < 0 || k < 0 || k > n n < 0 n 0 k < 0 k 0 k > n k n return 0; 0 return (((f[n] * ff[k]) % mod) * f[n - k]) % mod; (((f[n] * ff[k]) % mod) * f[n - k]) % mod (((f[n] * ff[k]) % mod) * f[n - k]) ((f[n] * ff[k]) % mod) (f[n] * ff[k]) f[n] f n ff[k] ff k mod f[n - k] f n - k n k mod int n n int k k void f() throws Exception
    {
        
    } f {
        
    } void e2(int n, int k)
    {
        for(int i = 0; i <= n; i++)
        {
            int a = i;
            int c = 0;
            while(a > 0)
            {
                if(a % 10 != 0) c++;
                a /= 10;
            }
            if(c == k) System.out.println(i);
        }
    } e2 {
        for(int i = 0; i <= n; i++)
        {
            int a = i;
            int c = 0;
            while(a > 0)
            {
                if(a % 10 != 0) c++;
                a /= 10;
            }
            if(c == k) System.out.println(i);
        }
    } for(int i = 0; i <= n; i++)
        {
            int a = i;
            int c = 0;
            while(a > 0)
            {
                if(a % 10 != 0) c++;
                a /= 10;
            }
            if(c == k) System.out.println(i);
        } int i = 0; int i = 0; i 0 i <= n i n i++ i++ i {
            int a = i;
            int c = 0;
            while(a > 0)
            {
                if(a % 10 != 0) c++;
                a /= 10;
            }
            if(c == k) System.out.println(i);
        } {
            int a = i;
            int c = 0;
            while(a > 0)
            {
                if(a % 10 != 0) c++;
                a /= 10;
            }
            if(c == k) System.out.println(i);
        } int a = i; a i int c = 0; c 0 while(a > 0)
            {
                if(a % 10 != 0) c++;
                a /= 10;
            } a > 0 a 0 {
                if(a % 10 != 0) c++;
                a /= 10;
            } if(a % 10 != 0) c++; a % 10 != 0 a % 10 a 10 0 c++ c a /= 10 a 10 if(c == k) System.out.println(i); c == k c k System.out.println(i) System.out.println System.out System System.out i int n n int k k long ehelper(String str, int k)
    {
        int idx = 0;
        while(str.charAt(idx) == '0') idx++;
        str = str.substring(idx);
        char[] chs = str.toCharArray();
        int n = chs.length;
        if(n < k)
        {
            // System.out.println(0);
            return 0;
        }
        long sum = 0;

        if(k == 1)
        {
            sum += chs[0] - '0';
            sum += (n - 1) * 9;
        }
        if(k == 2)
        {
            int val = chs[0] - '0';
            sum += (n - 1) * (n - 2) / 2 * 81;
            for(int i = 1; i < val; i++)
            {
                sum += (n - 1) * 9;
            }
            for(int i = 1; i < n; i++) {
                if(chs[i] != '0')
                {
                    sum += chs[i] - '0';
                    sum += 9 * (n - i - 1);
                    break;
                }
            }
        }
        if(k == 3)
        {
            int val = chs[0] - '0';
            sum += (n - 1) * (n - 2) * (n - 3) / 6 * 729;
            for(int i = 1; i < val; i++)
            {
                sum += (n - 1) * (n - 2) / 2 * 81;
            }
            // System.out.println("..." +sum);
            sum += ehelper(str.substring(1), k - 1);
        }
        
        return sum;
    } ehelper {
        int idx = 0;
        while(str.charAt(idx) == '0') idx++;
        str = str.substring(idx);
        char[] chs = str.toCharArray();
        int n = chs.length;
        if(n < k)
        {
            // System.out.println(0);
            return 0;
        }
        long sum = 0;

        if(k == 1)
        {
            sum += chs[0] - '0';
            sum += (n - 1) * 9;
        }
        if(k == 2)
        {
            int val = chs[0] - '0';
            sum += (n - 1) * (n - 2) / 2 * 81;
            for(int i = 1; i < val; i++)
            {
                sum += (n - 1) * 9;
            }
            for(int i = 1; i < n; i++) {
                if(chs[i] != '0')
                {
                    sum += chs[i] - '0';
                    sum += 9 * (n - i - 1);
                    break;
                }
            }
        }
        if(k == 3)
        {
            int val = chs[0] - '0';
            sum += (n - 1) * (n - 2) * (n - 3) / 6 * 729;
            for(int i = 1; i < val; i++)
            {
                sum += (n - 1) * (n - 2) / 2 * 81;
            }
            // System.out.println("..." +sum);
            sum += ehelper(str.substring(1), k - 1);
        }
        
        return sum;
    } int idx = 0; idx 0 while(str.charAt(idx) == '0') idx++; str.charAt(idx) == '0' str.charAt(idx) str.charAt str idx '0' idx++ idx str = str.substring(idx) str str.substring(idx) str.substring str idx char[] chs = str.toCharArray(); chs str.toCharArray() str.toCharArray str int n = chs.length; n chs.length chs chs.length if(n < k)
        {
            // System.out.println(0);
            return 0;
        } n < k n k {
            // System.out.println(0);
            return 0;
        } return 0; 0 long sum = 0; sum 0 if(k == 1)
        {
            sum += chs[0] - '0';
            sum += (n - 1) * 9;
        } k == 1 k 1 {
            sum += chs[0] - '0';
            sum += (n - 1) * 9;
        } sum += chs[0] - '0' sum chs[0] - '0' chs[0] chs 0 '0' sum += (n - 1) * 9 sum (n - 1) * 9 (n - 1) n 1 9 if(k == 2)
        {
            int val = chs[0] - '0';
            sum += (n - 1) * (n - 2) / 2 * 81;
            for(int i = 1; i < val; i++)
            {
                sum += (n - 1) * 9;
            }
            for(int i = 1; i < n; i++) {
                if(chs[i] != '0')
                {
                    sum += chs[i] - '0';
                    sum += 9 * (n - i - 1);
                    break;
                }
            }
        } k == 2 k 2 {
            int val = chs[0] - '0';
            sum += (n - 1) * (n - 2) / 2 * 81;
            for(int i = 1; i < val; i++)
            {
                sum += (n - 1) * 9;
            }
            for(int i = 1; i < n; i++) {
                if(chs[i] != '0')
                {
                    sum += chs[i] - '0';
                    sum += 9 * (n - i - 1);
                    break;
                }
            }
        } int val = chs[0] - '0'; val chs[0] - '0' chs[0] chs 0 '0' sum += (n - 1) * (n - 2) / 2 * 81 sum (n - 1) * (n - 2) / 2 * 81 (n - 1) * (n - 2) / 2 (n - 1) * (n - 2) (n - 1) n 1 (n - 2) n 2 2 81 for(int i = 1; i < val; i++)
            {
                sum += (n - 1) * 9;
            } int i = 1; int i = 1; i 1 i < val i val i++ i++ i {
                sum += (n - 1) * 9;
            } {
                sum += (n - 1) * 9;
            } sum += (n - 1) * 9 sum (n - 1) * 9 (n - 1) n 1 9 for(int i = 1; i < n; i++) {
                if(chs[i] != '0')
                {
                    sum += chs[i] - '0';
                    sum += 9 * (n - i - 1);
                    break;
                }
            } int i = 1; int i = 1; i 1 i < n i n i++ i++ i {
                if(chs[i] != '0')
                {
                    sum += chs[i] - '0';
                    sum += 9 * (n - i - 1);
                    break;
                }
            } {
                if(chs[i] != '0')
                {
                    sum += chs[i] - '0';
                    sum += 9 * (n - i - 1);
                    break;
                }
            } if(chs[i] != '0')
                {
                    sum += chs[i] - '0';
                    sum += 9 * (n - i - 1);
                    break;
                } chs[i] != '0' chs[i] chs i '0' {
                    sum += chs[i] - '0';
                    sum += 9 * (n - i - 1);
                    break;
                } sum += chs[i] - '0' sum chs[i] - '0' chs[i] chs i '0' sum += 9 * (n - i - 1) sum 9 * (n - i - 1) 9 (n - i - 1) n - i - 1 n i 1 break; if(k == 3)
        {
            int val = chs[0] - '0';
            sum += (n - 1) * (n - 2) * (n - 3) / 6 * 729;
            for(int i = 1; i < val; i++)
            {
                sum += (n - 1) * (n - 2) / 2 * 81;
            }
            // System.out.println("..." +sum);
            sum += ehelper(str.substring(1), k - 1);
        } k == 3 k 3 {
            int val = chs[0] - '0';
            sum += (n - 1) * (n - 2) * (n - 3) / 6 * 729;
            for(int i = 1; i < val; i++)
            {
                sum += (n - 1) * (n - 2) / 2 * 81;
            }
            // System.out.println("..." +sum);
            sum += ehelper(str.substring(1), k - 1);
        } int val = chs[0] - '0'; val chs[0] - '0' chs[0] chs 0 '0' sum += (n - 1) * (n - 2) * (n - 3) / 6 * 729 sum (n - 1) * (n - 2) * (n - 3) / 6 * 729 (n - 1) * (n - 2) * (n - 3) / 6 (n - 1) * (n - 2) * (n - 3) (n - 1) * (n - 2) * (n - 3) (n - 1) n 1 (n - 2) n 2 (n - 3) n 3 6 729 for(int i = 1; i < val; i++)
            {
                sum += (n - 1) * (n - 2) / 2 * 81;
            } int i = 1; int i = 1; i 1 i < val i val i++ i++ i {
                sum += (n - 1) * (n - 2) / 2 * 81;
            } {
                sum += (n - 1) * (n - 2) / 2 * 81;
            } sum += (n - 1) * (n - 2) / 2 * 81 sum (n - 1) * (n - 2) / 2 * 81 (n - 1) * (n - 2) / 2 (n - 1) * (n - 2) (n - 1) n 1 (n - 2) n 2 2 81 sum += ehelper(str.substring(1), k - 1) sum ehelper(str.substring(1), k - 1) ehelper str.substring(1) str.substring str 1 k - 1 k 1 return sum; sum String str str int k k void e() throws Exception
    {
        String str = in.readLine();
        int k = readInt();
        
        // e2(Integer.valueOf(str), k);
        System.out.println(ehelper(str, k));
    } e {
        String str = in.readLine();
        int k = readInt();
        
        // e2(Integer.valueOf(str), k);
        System.out.println(ehelper(str, k));
    } String str = in.readLine(); str in.readLine() in.readLine in int k = readInt(); k readInt() readInt System.out.println(ehelper(str, k)) System.out.println System.out System System.out ehelper(str, k) ehelper str k long gcd(long a, long b)
    {
        if(b == 0) return a;
        return gcd(b, a % b);
    } gcd {
        if(b == 0) return a;
        return gcd(b, a % b);
    } if(b == 0) return a; b == 0 b 0 return a; a return gcd(b, a % b); gcd(b, a % b) gcd b a % b a b long a a long b b void d() throws Exception
    {
        String[] sp = split();
        int n = Integer.valueOf(sp[0]),
            k = Integer.valueOf(sp[1]);
        sp = split();

        double[] db = new double[n];
        for(int i = 0; i < n; i++)
        {
            int v = Integer.valueOf(sp[i]);
            int sum = (1 + v) * v / 2;
            double avg = 1.0 * sum / v;
            db[i] = avg;
        }

        // every k window
        double maxi = 0.0;
        double runsum = 0.0;

        for(int i = 0; i < n; i++)
        {
            runsum += db[i];
            if(i >= k - 1)
            {
                if(i >= k) runsum -= db[i - k];
                maxi = Math.max(maxi, runsum);
            }
        }
        System.out.println(maxi);

    } d {
        String[] sp = split();
        int n = Integer.valueOf(sp[0]),
            k = Integer.valueOf(sp[1]);
        sp = split();

        double[] db = new double[n];
        for(int i = 0; i < n; i++)
        {
            int v = Integer.valueOf(sp[i]);
            int sum = (1 + v) * v / 2;
            double avg = 1.0 * sum / v;
            db[i] = avg;
        }

        // every k window
        double maxi = 0.0;
        double runsum = 0.0;

        for(int i = 0; i < n; i++)
        {
            runsum += db[i];
            if(i >= k - 1)
            {
                if(i >= k) runsum -= db[i - k];
                maxi = Math.max(maxi, runsum);
            }
        }
        System.out.println(maxi);

    } String[] sp = split(); sp split() split int n = Integer.valueOf(sp[0]) n Integer.valueOf(sp[0]) Integer.valueOf Integer sp[0] sp 0 k = Integer.valueOf(sp[1]); k Integer.valueOf(sp[1]) Integer.valueOf Integer sp[1] sp 1 sp = split() sp split() split double[] db = new double[n]; db new double[n] n for(int i = 0; i < n; i++)
        {
            int v = Integer.valueOf(sp[i]);
            int sum = (1 + v) * v / 2;
            double avg = 1.0 * sum / v;
            db[i] = avg;
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            int v = Integer.valueOf(sp[i]);
            int sum = (1 + v) * v / 2;
            double avg = 1.0 * sum / v;
            db[i] = avg;
        } {
            int v = Integer.valueOf(sp[i]);
            int sum = (1 + v) * v / 2;
            double avg = 1.0 * sum / v;
            db[i] = avg;
        } int v = Integer.valueOf(sp[i]); v Integer.valueOf(sp[i]) Integer.valueOf Integer sp[i] sp i int sum = (1 + v) * v / 2; sum (1 + v) * v / 2 (1 + v) * v (1 + v) 1 v v 2 double avg = 1.0 * sum / v; avg 1.0 * sum / v 1.0 * sum 1.0 sum v db[i] = avg db[i] db i avg double maxi = 0.0; maxi 0.0 double runsum = 0.0; runsum 0.0 for(int i = 0; i < n; i++)
        {
            runsum += db[i];
            if(i >= k - 1)
            {
                if(i >= k) runsum -= db[i - k];
                maxi = Math.max(maxi, runsum);
            }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            runsum += db[i];
            if(i >= k - 1)
            {
                if(i >= k) runsum -= db[i - k];
                maxi = Math.max(maxi, runsum);
            }
        } {
            runsum += db[i];
            if(i >= k - 1)
            {
                if(i >= k) runsum -= db[i - k];
                maxi = Math.max(maxi, runsum);
            }
        } runsum += db[i] runsum db[i] db i if(i >= k - 1)
            {
                if(i >= k) runsum -= db[i - k];
                maxi = Math.max(maxi, runsum);
            } i >= k - 1 i k - 1 k 1 {
                if(i >= k) runsum -= db[i - k];
                maxi = Math.max(maxi, runsum);
            } if(i >= k) runsum -= db[i - k]; i >= k i k runsum -= db[i - k] runsum db[i - k] db i - k i k maxi = Math.max(maxi, runsum) maxi Math.max(maxi, runsum) Math.max Math maxi runsum System.out.println(maxi) System.out.println System.out System System.out maxi boolean satisfy(int a, int b)
    {
        String s1 = String.valueOf(a),
                s2 = String.valueOf(b);
        int m = s1.length(), n = s2.length();
        if(s1.charAt(0) == s2.charAt(n - 1) && 
            s1.charAt(m - 1) == s2.charAt(0)) return true;
        return false;
    } satisfy {
        String s1 = String.valueOf(a),
                s2 = String.valueOf(b);
        int m = s1.length(), n = s2.length();
        if(s1.charAt(0) == s2.charAt(n - 1) && 
            s1.charAt(m - 1) == s2.charAt(0)) return true;
        return false;
    } String s1 = String.valueOf(a) s1 String.valueOf(a) String.valueOf String a s2 = String.valueOf(b); s2 String.valueOf(b) String.valueOf String b int m = s1.length() m s1.length() s1.length s1 n = s2.length(); n s2.length() s2.length s2 if(s1.charAt(0) == s2.charAt(n - 1) && 
            s1.charAt(m - 1) == s2.charAt(0)) return true; s1.charAt(0) == s2.charAt(n - 1) && 
            s1.charAt(m - 1) == s2.charAt(0) s1.charAt(0) == s2.charAt(n - 1) s1.charAt(0) s1.charAt s1 0 s2.charAt(n - 1) s2.charAt s2 n - 1 n 1 s1.charAt(m - 1) == s2.charAt(0) s1.charAt(m - 1) s1.charAt s1 m - 1 m 1 s2.charAt(0) s2.charAt s2 0 return true; true return false; false int a a int b b void c() throws Exception
    {
        int n = readInt();
        TreeMap<String, Integer> map = new TreeMap<>();
        int maxi = 0;

        for(int i = 0; i< n; i++)
        {
            String str = in.readLine();
            map.put(str, map.getOrDefault(str, 0) + 1);
            maxi = Math.max(maxi, map.get(str));
        }

        for(String str : map.keySet())
        {
            if(map.get(str) == maxi)
                out.println(str);
        }
    } c {
        int n = readInt();
        TreeMap<String, Integer> map = new TreeMap<>();
        int maxi = 0;

        for(int i = 0; i< n; i++)
        {
            String str = in.readLine();
            map.put(str, map.getOrDefault(str, 0) + 1);
            maxi = Math.max(maxi, map.get(str));
        }

        for(String str : map.keySet())
        {
            if(map.get(str) == maxi)
                out.println(str);
        }
    } int n = readInt(); n readInt() readInt TreeMap<String, Integer> map = new TreeMap<>(); map new TreeMap<>() int maxi = 0; maxi 0 for(int i = 0; i< n; i++)
        {
            String str = in.readLine();
            map.put(str, map.getOrDefault(str, 0) + 1);
            maxi = Math.max(maxi, map.get(str));
        } int i = 0; int i = 0; i 0 i< n i n i++ i++ i {
            String str = in.readLine();
            map.put(str, map.getOrDefault(str, 0) + 1);
            maxi = Math.max(maxi, map.get(str));
        } {
            String str = in.readLine();
            map.put(str, map.getOrDefault(str, 0) + 1);
            maxi = Math.max(maxi, map.get(str));
        } String str = in.readLine(); str in.readLine() in.readLine in map.put(str, map.getOrDefault(str, 0) + 1) map.put map str map.getOrDefault(str, 0) + 1 map.getOrDefault(str, 0) map.getOrDefault map str 0 1 maxi = Math.max(maxi, map.get(str)) maxi Math.max(maxi, map.get(str)) Math.max Math maxi map.get(str) map.get map str for(String str : map.keySet())
        {
            if(map.get(str) == maxi)
                out.println(str);
        } String str map.keySet() map.keySet map {
            if(map.get(str) == maxi)
                out.println(str);
        } {
            if(map.get(str) == maxi)
                out.println(str);
        } if(map.get(str) == maxi)
                out.println(str); map.get(str) == maxi map.get(str) map.get map str maxi out.println(str) out.println out str void b() throws Exception
    {
        int n = readInt();
        int[] ary = toIntArray();
        boolean flag = true;
        for(int k : ary)
        {
            if((k & 1) == 0)
            {
                if(k % 3 != 0 && k % 5 != 0)
                {
                    flag = false;
                }
            }
        }
        if(flag) System.out.println("APPROVED");
        else System.out.println("DENIED");
    } b {
        int n = readInt();
        int[] ary = toIntArray();
        boolean flag = true;
        for(int k : ary)
        {
            if((k & 1) == 0)
            {
                if(k % 3 != 0 && k % 5 != 0)
                {
                    flag = false;
                }
            }
        }
        if(flag) System.out.println("APPROVED");
        else System.out.println("DENIED");
    } int n = readInt(); n readInt() readInt int[] ary = toIntArray(); ary toIntArray() toIntArray boolean flag = true; flag true for(int k : ary)
        {
            if((k & 1) == 0)
            {
                if(k % 3 != 0 && k % 5 != 0)
                {
                    flag = false;
                }
            }
        } int k ary {
            if((k & 1) == 0)
            {
                if(k % 3 != 0 && k % 5 != 0)
                {
                    flag = false;
                }
            }
        } {
            if((k & 1) == 0)
            {
                if(k % 3 != 0 && k % 5 != 0)
                {
                    flag = false;
                }
            }
        } if((k & 1) == 0)
            {
                if(k % 3 != 0 && k % 5 != 0)
                {
                    flag = false;
                }
            } (k & 1) == 0 (k & 1) k 1 0 {
                if(k % 3 != 0 && k % 5 != 0)
                {
                    flag = false;
                }
            } if(k % 3 != 0 && k % 5 != 0)
                {
                    flag = false;
                } k % 3 != 0 && k % 5 != 0 k % 3 != 0 k % 3 k 3 0 k % 5 != 0 k % 5 k 5 0 {
                    flag = false;
                } flag = false flag false if(flag) System.out.println("APPROVED");
        else System.out.println("DENIED"); flag System.out.println("APPROVED") System.out.println System.out System System.out "APPROVED" System.out.println("DENIED") System.out.println System.out System System.out "DENIED" void a() throws Exception
    {
        int[] ary = toIntArray();
        Arrays.sort(ary);
        if(ary[0] == ary[1] && ary[1] != ary[2])
        {
            out.println("Yes");
        }
        else if(ary[0] != ary[1] && ary[1] == ary[2])
        {
            out.println("Yes");
        }
        else out.println("No");
    } a {
        int[] ary = toIntArray();
        Arrays.sort(ary);
        if(ary[0] == ary[1] && ary[1] != ary[2])
        {
            out.println("Yes");
        }
        else if(ary[0] != ary[1] && ary[1] == ary[2])
        {
            out.println("Yes");
        }
        else out.println("No");
    } int[] ary = toIntArray(); ary toIntArray() toIntArray Arrays.sort(ary) Arrays.sort Arrays ary if(ary[0] == ary[1] && ary[1] != ary[2])
        {
            out.println("Yes");
        }
        else if(ary[0] != ary[1] && ary[1] == ary[2])
        {
            out.println("Yes");
        }
        else out.println("No"); ary[0] == ary[1] && ary[1] != ary[2] ary[0] == ary[1] ary[0] ary 0 ary[1] ary 1 ary[1] != ary[2] ary[1] ary 1 ary[2] ary 2 {
            out.println("Yes");
        } out.println("Yes") out.println out "Yes" if(ary[0] != ary[1] && ary[1] == ary[2])
        {
            out.println("Yes");
        }
        else out.println("No"); ary[0] != ary[1] && ary[1] == ary[2] ary[0] != ary[1] ary[0] ary 0 ary[1] ary 1 ary[1] == ary[2] ary[1] ary 1 ary[2] ary 2 {
            out.println("Yes");
        } out.println("Yes") out.println out "Yes" out.println("No") out.println out "No" public class Main { 
  
    static BufferedReader in;
    static PrintWriter out = new PrintWriter(System.out);
    static String file = "../in";
    static int test = 10; // 0 for local testing, 1 for std input
    static int inf = 1_000_000;

    void swap(int[]ary, int i, int j)
    {
        int t = ary[i];
        ary[i] = ary[j];
        ary[j] = t;
    }
    
    String[] split() throws Exception
    {
        return in.readLine().split(" ");
    }

    int readInt() throws Exception
    {
        return Integer.valueOf(in.readLine());
    }

    int[] toIntArray() throws Exception
    {
        String[] sp = split();
        int n = sp.length;
        int[] ary = new int[n];
        for(int i = 0; i < n; i++) ary[i] = Integer.valueOf(sp[i]);
        return ary;
    }

    String reverse(String str)
    {
        return new StringBuilder(str).reverse().toString();
    }

    public static void main(String[] args) throws Exception
    {
        int _k = Integer.valueOf("1");
        if(test > 0) in = new BufferedReader(new InputStreamReader(System.in));
        else in = new BufferedReader(new FileReader(file));
        if(test < 0) {String[] str = in.readLine().split(" ");}
/***********************************************************************/
/***********************************************************************/
/***********************************************************************/
/***********************************************************************/
        new Main().c();
        out.flush();
    }
    
    int mod = 1_000_000_007;

    long pow(long a, int pow)
    {
        long res = 1;
        while(pow > 0)
        {
            if(pow % 2 != 0) {
                res *= a;
                res %= mod;
            }
            a = a * a;
            a %= mod;
            pow /= 2;
        }

        return res;
    }

    long comb(int n, int k)
    {
        if(n < 0 || k < 0 || k > n) return 0;

        return (((f[n] * ff[k]) % mod) * f[n - k]) % mod;
    }

    long[] f = new long[2_000_010], ff = new long[2_000_010];

    void f() throws Exception
    {
        
    }

    void e2(int n, int k)
    {
        for(int i = 0; i <= n; i++)
        {
            int a = i;
            int c = 0;
            while(a > 0)
            {
                if(a % 10 != 0) c++;
                a /= 10;
            }
            if(c == k) System.out.println(i);
        }
    }

    long ehelper(String str, int k)
    {
        int idx = 0;
        while(str.charAt(idx) == '0') idx++;
        str = str.substring(idx);
        char[] chs = str.toCharArray();
        int n = chs.length;
        if(n < k)
        {
            // System.out.println(0);
            return 0;
        }
        long sum = 0;

        if(k == 1)
        {
            sum += chs[0] - '0';
            sum += (n - 1) * 9;
        }
        if(k == 2)
        {
            int val = chs[0] - '0';
            sum += (n - 1) * (n - 2) / 2 * 81;
            for(int i = 1; i < val; i++)
            {
                sum += (n - 1) * 9;
            }
            for(int i = 1; i < n; i++) {
                if(chs[i] != '0')
                {
                    sum += chs[i] - '0';
                    sum += 9 * (n - i - 1);
                    break;
                }
            }
        }
        if(k == 3)
        {
            int val = chs[0] - '0';
            sum += (n - 1) * (n - 2) * (n - 3) / 6 * 729;
            for(int i = 1; i < val; i++)
            {
                sum += (n - 1) * (n - 2) / 2 * 81;
            }
            // System.out.println("..." +sum);
            sum += ehelper(str.substring(1), k - 1);
        }
        
        return sum;
    }


    void e() throws Exception
    {
        String str = in.readLine();
        int k = readInt();
        
        // e2(Integer.valueOf(str), k);
        System.out.println(ehelper(str, k));
    }

    long gcd(long a, long b)
    {
        if(b == 0) return a;
        return gcd(b, a % b);
    }

    void d() throws Exception
    {
        String[] sp = split();
        int n = Integer.valueOf(sp[0]),
            k = Integer.valueOf(sp[1]);
        sp = split();

        double[] db = new double[n];
        for(int i = 0; i < n; i++)
        {
            int v = Integer.valueOf(sp[i]);
            int sum = (1 + v) * v / 2;
            double avg = 1.0 * sum / v;
            db[i] = avg;
        }

        // every k window
        double maxi = 0.0;
        double runsum = 0.0;

        for(int i = 0; i < n; i++)
        {
            runsum += db[i];
            if(i >= k - 1)
            {
                if(i >= k) runsum -= db[i - k];
                maxi = Math.max(maxi, runsum);
            }
        }
        System.out.println(maxi);

    }
    
    boolean satisfy(int a, int b)
    {
        String s1 = String.valueOf(a),
                s2 = String.valueOf(b);
        int m = s1.length(), n = s2.length();
        if(s1.charAt(0) == s2.charAt(n - 1) && 
            s1.charAt(m - 1) == s2.charAt(0)) return true;
        return false;
    }

    void c() throws Exception
    {
        int n = readInt();
        TreeMap<String, Integer> map = new TreeMap<>();
        int maxi = 0;

        for(int i = 0; i< n; i++)
        {
            String str = in.readLine();
            map.put(str, map.getOrDefault(str, 0) + 1);
            maxi = Math.max(maxi, map.get(str));
        }

        for(String str : map.keySet())
        {
            if(map.get(str) == maxi)
                out.println(str);
        }
    }

    void b() throws Exception
    {
        int n = readInt();
        int[] ary = toIntArray();
        boolean flag = true;
        for(int k : ary)
        {
            if((k & 1) == 0)
            {
                if(k % 3 != 0 && k % 5 != 0)
                {
                    flag = false;
                }
            }
        }
        if(flag) System.out.println("APPROVED");
        else System.out.println("DENIED");
    }

    void a() throws Exception
    {
        int[] ary = toIntArray();
        Arrays.sort(ary);
        if(ary[0] == ary[1] && ary[1] != ary[2])
        {
            out.println("Yes");
        }
        else if(ary[0] != ary[1] && ary[1] == ary[2])
        {
            out.println("Yes");
        }
        else out.println("No");
    }
} public class Main { 
  
    static BufferedReader in;
    static PrintWriter out = new PrintWriter(System.out);
    static String file = "../in";
    static int test = 10; // 0 for local testing, 1 for std input
    static int inf = 1_000_000;

    void swap(int[]ary, int i, int j)
    {
        int t = ary[i];
        ary[i] = ary[j];
        ary[j] = t;
    }
    
    String[] split() throws Exception
    {
        return in.readLine().split(" ");
    }

    int readInt() throws Exception
    {
        return Integer.valueOf(in.readLine());
    }

    int[] toIntArray() throws Exception
    {
        String[] sp = split();
        int n = sp.length;
        int[] ary = new int[n];
        for(int i = 0; i < n; i++) ary[i] = Integer.valueOf(sp[i]);
        return ary;
    }

    String reverse(String str)
    {
        return new StringBuilder(str).reverse().toString();
    }

    public static void main(String[] args) throws Exception
    {
        int _k = Integer.valueOf("1");
        if(test > 0) in = new BufferedReader(new InputStreamReader(System.in));
        else in = new BufferedReader(new FileReader(file));
        if(test < 0) {String[] str = in.readLine().split(" ");}
/***********************************************************************/
/***********************************************************************/
/***********************************************************************/
/***********************************************************************/
        new Main().c();
        out.flush();
    }
    
    int mod = 1_000_000_007;

    long pow(long a, int pow)
    {
        long res = 1;
        while(pow > 0)
        {
            if(pow % 2 != 0) {
                res *= a;
                res %= mod;
            }
            a = a * a;
            a %= mod;
            pow /= 2;
        }

        return res;
    }

    long comb(int n, int k)
    {
        if(n < 0 || k < 0 || k > n) return 0;

        return (((f[n] * ff[k]) % mod) * f[n - k]) % mod;
    }

    long[] f = new long[2_000_010], ff = new long[2_000_010];

    void f() throws Exception
    {
        
    }

    void e2(int n, int k)
    {
        for(int i = 0; i <= n; i++)
        {
            int a = i;
            int c = 0;
            while(a > 0)
            {
                if(a % 10 != 0) c++;
                a /= 10;
            }
            if(c == k) System.out.println(i);
        }
    }

    long ehelper(String str, int k)
    {
        int idx = 0;
        while(str.charAt(idx) == '0') idx++;
        str = str.substring(idx);
        char[] chs = str.toCharArray();
        int n = chs.length;
        if(n < k)
        {
            // System.out.println(0);
            return 0;
        }
        long sum = 0;

        if(k == 1)
        {
            sum += chs[0] - '0';
            sum += (n - 1) * 9;
        }
        if(k == 2)
        {
            int val = chs[0] - '0';
            sum += (n - 1) * (n - 2) / 2 * 81;
            for(int i = 1; i < val; i++)
            {
                sum += (n - 1) * 9;
            }
            for(int i = 1; i < n; i++) {
                if(chs[i] != '0')
                {
                    sum += chs[i] - '0';
                    sum += 9 * (n - i - 1);
                    break;
                }
            }
        }
        if(k == 3)
        {
            int val = chs[0] - '0';
            sum += (n - 1) * (n - 2) * (n - 3) / 6 * 729;
            for(int i = 1; i < val; i++)
            {
                sum += (n - 1) * (n - 2) / 2 * 81;
            }
            // System.out.println("..." +sum);
            sum += ehelper(str.substring(1), k - 1);
        }
        
        return sum;
    }


    void e() throws Exception
    {
        String str = in.readLine();
        int k = readInt();
        
        // e2(Integer.valueOf(str), k);
        System.out.println(ehelper(str, k));
    }

    long gcd(long a, long b)
    {
        if(b == 0) return a;
        return gcd(b, a % b);
    }

    void d() throws Exception
    {
        String[] sp = split();
        int n = Integer.valueOf(sp[0]),
            k = Integer.valueOf(sp[1]);
        sp = split();

        double[] db = new double[n];
        for(int i = 0; i < n; i++)
        {
            int v = Integer.valueOf(sp[i]);
            int sum = (1 + v) * v / 2;
            double avg = 1.0 * sum / v;
            db[i] = avg;
        }

        // every k window
        double maxi = 0.0;
        double runsum = 0.0;

        for(int i = 0; i < n; i++)
        {
            runsum += db[i];
            if(i >= k - 1)
            {
                if(i >= k) runsum -= db[i - k];
                maxi = Math.max(maxi, runsum);
            }
        }
        System.out.println(maxi);

    }
    
    boolean satisfy(int a, int b)
    {
        String s1 = String.valueOf(a),
                s2 = String.valueOf(b);
        int m = s1.length(), n = s2.length();
        if(s1.charAt(0) == s2.charAt(n - 1) && 
            s1.charAt(m - 1) == s2.charAt(0)) return true;
        return false;
    }

    void c() throws Exception
    {
        int n = readInt();
        TreeMap<String, Integer> map = new TreeMap<>();
        int maxi = 0;

        for(int i = 0; i< n; i++)
        {
            String str = in.readLine();
            map.put(str, map.getOrDefault(str, 0) + 1);
            maxi = Math.max(maxi, map.get(str));
        }

        for(String str : map.keySet())
        {
            if(map.get(str) == maxi)
                out.println(str);
        }
    }

    void b() throws Exception
    {
        int n = readInt();
        int[] ary = toIntArray();
        boolean flag = true;
        for(int k : ary)
        {
            if((k & 1) == 0)
            {
                if(k % 3 != 0 && k % 5 != 0)
                {
                    flag = false;
                }
            }
        }
        if(flag) System.out.println("APPROVED");
        else System.out.println("DENIED");
    }

    void a() throws Exception
    {
        int[] ary = toIntArray();
        Arrays.sort(ary);
        if(ary[0] == ary[1] && ary[1] != ary[2])
        {
            out.println("Yes");
        }
        else if(ary[0] != ary[1] && ary[1] == ary[2])
        {
            out.println("Yes");
        }
        else out.println("No");
    }
} Main
//
import java.math.*;
import java.util.*;
import java.io.*;
  
public class Main { 
  
    static BufferedReader in;
    static PrintWriter out = new PrintWriter(System.out);
    static String file = "../in";
    static int test = 10; // 0 for local testing, 1 for std input
    static int inf = 1_000_000;

    void swap(int[]ary, int i, int j)
    {
        int t = ary[i];
        ary[i] = ary[j];
        ary[j] = t;
    }
    
    String[] split() throws Exception
    {
        return in.readLine().split(" ");
    }

    int readInt() throws Exception
    {
        return Integer.valueOf(in.readLine());
    }

    int[] toIntArray() throws Exception
    {
        String[] sp = split();
        int n = sp.length;
        int[] ary = new int[n];
        for(int i = 0; i < n; i++) ary[i] = Integer.valueOf(sp[i]);
        return ary;
    }

    String reverse(String str)
    {
        return new StringBuilder(str).reverse().toString();
    }

    public static void main(String[] args) throws Exception
    {
        int _k = Integer.valueOf("1");
        if(test > 0) in = new BufferedReader(new InputStreamReader(System.in));
        else in = new BufferedReader(new FileReader(file));
        if(test < 0) {String[] str = in.readLine().split(" ");}
/***********************************************************************/
/***********************************************************************/
/***********************************************************************/
/***********************************************************************/
        new Main().c();
        out.flush();
    }
    
    int mod = 1_000_000_007;

    long pow(long a, int pow)
    {
        long res = 1;
        while(pow > 0)
        {
            if(pow % 2 != 0) {
                res *= a;
                res %= mod;
            }
            a = a * a;
            a %= mod;
            pow /= 2;
        }

        return res;
    }

    long comb(int n, int k)
    {
        if(n < 0 || k < 0 || k > n) return 0;

        return (((f[n] * ff[k]) % mod) * f[n - k]) % mod;
    }

    long[] f = new long[2_000_010], ff = new long[2_000_010];

    void f() throws Exception
    {
        
    }

    void e2(int n, int k)
    {
        for(int i = 0; i <= n; i++)
        {
            int a = i;
            int c = 0;
            while(a > 0)
            {
                if(a % 10 != 0) c++;
                a /= 10;
            }
            if(c == k) System.out.println(i);
        }
    }

    long ehelper(String str, int k)
    {
        int idx = 0;
        while(str.charAt(idx) == '0') idx++;
        str = str.substring(idx);
        char[] chs = str.toCharArray();
        int n = chs.length;
        if(n < k)
        {
            // System.out.println(0);
            return 0;
        }
        long sum = 0;

        if(k == 1)
        {
            sum += chs[0] - '0';
            sum += (n - 1) * 9;
        }
        if(k == 2)
        {
            int val = chs[0] - '0';
            sum += (n - 1) * (n - 2) / 2 * 81;
            for(int i = 1; i < val; i++)
            {
                sum += (n - 1) * 9;
            }
            for(int i = 1; i < n; i++) {
                if(chs[i] != '0')
                {
                    sum += chs[i] - '0';
                    sum += 9 * (n - i - 1);
                    break;
                }
            }
        }
        if(k == 3)
        {
            int val = chs[0] - '0';
            sum += (n - 1) * (n - 2) * (n - 3) / 6 * 729;
            for(int i = 1; i < val; i++)
            {
                sum += (n - 1) * (n - 2) / 2 * 81;
            }
            // System.out.println("..." +sum);
            sum += ehelper(str.substring(1), k - 1);
        }
        
        return sum;
    }


    void e() throws Exception
    {
        String str = in.readLine();
        int k = readInt();
        
        // e2(Integer.valueOf(str), k);
        System.out.println(ehelper(str, k));
    }

    long gcd(long a, long b)
    {
        if(b == 0) return a;
        return gcd(b, a % b);
    }

    void d() throws Exception
    {
        String[] sp = split();
        int n = Integer.valueOf(sp[0]),
            k = Integer.valueOf(sp[1]);
        sp = split();

        double[] db = new double[n];
        for(int i = 0; i < n; i++)
        {
            int v = Integer.valueOf(sp[i]);
            int sum = (1 + v) * v / 2;
            double avg = 1.0 * sum / v;
            db[i] = avg;
        }

        // every k window
        double maxi = 0.0;
        double runsum = 0.0;

        for(int i = 0; i < n; i++)
        {
            runsum += db[i];
            if(i >= k - 1)
            {
                if(i >= k) runsum -= db[i - k];
                maxi = Math.max(maxi, runsum);
            }
        }
        System.out.println(maxi);

    }
    
    boolean satisfy(int a, int b)
    {
        String s1 = String.valueOf(a),
                s2 = String.valueOf(b);
        int m = s1.length(), n = s2.length();
        if(s1.charAt(0) == s2.charAt(n - 1) && 
            s1.charAt(m - 1) == s2.charAt(0)) return true;
        return false;
    }

    void c() throws Exception
    {
        int n = readInt();
        TreeMap<String, Integer> map = new TreeMap<>();
        int maxi = 0;

        for(int i = 0; i< n; i++)
        {
            String str = in.readLine();
            map.put(str, map.getOrDefault(str, 0) + 1);
            maxi = Math.max(maxi, map.get(str));
        }

        for(String str : map.keySet())
        {
            if(map.get(str) == maxi)
                out.println(str);
        }
    }

    void b() throws Exception
    {
        int n = readInt();
        int[] ary = toIntArray();
        boolean flag = true;
        for(int k : ary)
        {
            if((k & 1) == 0)
            {
                if(k % 3 != 0 && k % 5 != 0)
                {
                    flag = false;
                }
            }
        }
        if(flag) System.out.println("APPROVED");
        else System.out.println("DENIED");
    }

    void a() throws Exception
    {
        int[] ary = toIntArray();
        Arrays.sort(ary);
        if(ary[0] == ary[1] && ary[1] != ary[2])
        {
            out.println("Yes");
        }
        else if(ary[0] != ary[1] && ary[1] == ary[2])
        {
            out.println("Yes");
        }
        else out.println("No");
    }
}