
import java.lang.reflect.Array;
import java.util.*; import java.io.*;
/*
 * untitled.java
 * Copyright 2019 Karan Kanojia <karankanojia@Karans-MacBook-Air.local>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 * MA 02110-1301, USA.
 */ public class Main{

    static Reader scan = new Reader(); static Scanner scanner = new Scanner(System.in);
    static int MAX = 111111, bit_max = 32, ALPHA_LIMIT = 30, SQRT_BUCKET = 555, lim = 1000000007;
    static HashMap<Long, Long> quickHash = new HashMap<>();
    static long watcher = 0;
    static StringBuffer stringBuffer;

    static long permutes(ArrayList<ArrayList<Long>> ptr){
        long sum = 0; if(ptr.size() < 3){return 0L;}
        for(ArrayList<Long> bucket : ptr) {
            sum+= bucket.size();
        }
        if(sum < 3){return 0L;} long jojo = 0;
        for(ArrayList<Long> bucket : ptr){
            if(bucket.size() > 1){
                jojo += (bucket.size()*(bucket.size()-1))/2;
            }
        }
        long mojo = (sum*(sum-1)*(sum-2))/6;
        //System.out.println(sum+" "+mojo+" "+jojo);
        return mojo-(jojo*(sum-2));
    }

    public static long solve(HashMap<Integer, HashSet<Integer>> map, int n){
        long answer =0 ;
        for(int center=0; center<n; center++){
            if(map.get(center).size() < 3){continue;}
            HashSet<Integer> vis = new HashSet<>();
            ArrayList<ArrayList<Integer>> buk = new ArrayList<>();
            for(int i : map.get(center)){buk.add(new ArrayList<>()); buk.get(buk.size()-1).add(i);}

        }
        return answer;
    }


    public static void main(String[] args) throws IOException {
        int n = scanner.nextInt();
        HashMap<String, Long> map = new HashMap<>();
        long max = 0;
        for (int i = 0; i < n; i++) {
            String curr = scanner.next();
            if (!map.containsKey(curr)) {
                map.put(curr, 0L);
            }
            map.put(curr, map.get(curr) + 1);
            max = Long.max(max, map.get(curr));
        }
        ArrayList<String> arr = new ArrayList<>();
        for(String s : map.keySet()){
            if(map.get(s) == max){arr.add(s);}
        }
        //System.out.println(map);
        Collections.sort(arr);
        for(String s : arr){
            System.out.print(s+" ");
        }System.out.println();
    }





    static class Reader {
        final private int BUFFER_SIZE = 1 << 16;
        private DataInputStream din;
        private byte[] buffer;
        private int bufferPointer, bytesRead;

        public Reader()
        {
            din = new DataInputStream(System.in);
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public Reader(String file_name) throws IOException
        {
            din = new DataInputStream(new FileInputStream(file_name));
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public String readLine() throws IOException
        {
            byte[] buf = new byte[64]; // line length
            int cnt = 0, c;
            while ((c = read()) != -1)
            {
                if (c == '\n')
                    break;
                buf[cnt++] = (byte) c;
            }
            return new String(buf, 0, cnt);
        }

        public int nextInt() throws IOException
        {
            int ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do
            {
                ret = ret * 10 + c - '0';
            }  while ((c = read()) >= '0' && c <= '9');

            if (neg)
                return -ret;
            return ret;
        }

        public long nextLong() throws IOException
        {
            long ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');
            if (neg)
                return -ret;
            return ret;
        }

        public double nextDouble() throws IOException
        {
            double ret = 0, div = 1;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();

            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');

            if (c == '.')
            {
                while ((c = read()) >= '0' && c <= '9')
                {
                    ret += (c - '0') / (div *= 10);
                }
            }

            if (neg)
                return -ret;
            return ret;
        }

        private void fillBuffer() throws IOException
        {
            bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
            if (bytesRead == -1)
                buffer[0] = -1;
        }

        private byte read() throws IOException
        {
            if (bufferPointer == bytesRead)
                fillBuffer();
            return buffer[bufferPointer++];
        }

        public void close() throws IOException
        {
            if (din == null)
                return;
            din.close();
        }
    }


} import java.lang.reflect.Array; Array java.lang.reflect import java.util.*; util.* java import java.io.*; io.* java  */ public class Main{

    static Reader scan = new Reader(); static Scanner scanner = new Scanner(System.in);
    static int MAX = 111111, bit_max = 32, ALPHA_LIMIT = 30, SQRT_BUCKET = 555, lim = 1000000007;
    static HashMap<Long, Long> quickHash = new HashMap<>();
    static long watcher = 0;
    static StringBuffer stringBuffer;

    static long permutes(ArrayList<ArrayList<Long>> ptr){
        long sum = 0; if(ptr.size() < 3){return 0L;}
        for(ArrayList<Long> bucket : ptr) {
            sum+= bucket.size();
        }
        if(sum < 3){return 0L;} long jojo = 0;
        for(ArrayList<Long> bucket : ptr){
            if(bucket.size() > 1){
                jojo += (bucket.size()*(bucket.size()-1))/2;
            }
        }
        long mojo = (sum*(sum-1)*(sum-2))/6;
        //System.out.println(sum+" "+mojo+" "+jojo);
        return mojo-(jojo*(sum-2));
    }

    public static long solve(HashMap<Integer, HashSet<Integer>> map, int n){
        long answer =0 ;
        for(int center=0; center<n; center++){
            if(map.get(center).size() < 3){continue;}
            HashSet<Integer> vis = new HashSet<>();
            ArrayList<ArrayList<Integer>> buk = new ArrayList<>();
            for(int i : map.get(center)){buk.add(new ArrayList<>()); buk.get(buk.size()-1).add(i);}

        }
        return answer;
    }


    public static void main(String[] args) throws IOException {
        int n = scanner.nextInt();
        HashMap<String, Long> map = new HashMap<>();
        long max = 0;
        for (int i = 0; i < n; i++) {
            String curr = scanner.next();
            if (!map.containsKey(curr)) {
                map.put(curr, 0L);
            }
            map.put(curr, map.get(curr) + 1);
            max = Long.max(max, map.get(curr));
        }
        ArrayList<String> arr = new ArrayList<>();
        for(String s : map.keySet()){
            if(map.get(s) == max){arr.add(s);}
        }
        //System.out.println(map);
        Collections.sort(arr);
        for(String s : arr){
            System.out.print(s+" ");
        }System.out.println();
    }





    static class Reader {
        final private int BUFFER_SIZE = 1 << 16;
        private DataInputStream din;
        private byte[] buffer;
        private int bufferPointer, bytesRead;

        public Reader()
        {
            din = new DataInputStream(System.in);
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public Reader(String file_name) throws IOException
        {
            din = new DataInputStream(new FileInputStream(file_name));
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public String readLine() throws IOException
        {
            byte[] buf = new byte[64]; // line length
            int cnt = 0, c;
            while ((c = read()) != -1)
            {
                if (c == '\n')
                    break;
                buf[cnt++] = (byte) c;
            }
            return new String(buf, 0, cnt);
        }

        public int nextInt() throws IOException
        {
            int ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do
            {
                ret = ret * 10 + c - '0';
            }  while ((c = read()) >= '0' && c <= '9');

            if (neg)
                return -ret;
            return ret;
        }

        public long nextLong() throws IOException
        {
            long ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');
            if (neg)
                return -ret;
            return ret;
        }

        public double nextDouble() throws IOException
        {
            double ret = 0, div = 1;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();

            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');

            if (c == '.')
            {
                while ((c = read()) >= '0' && c <= '9')
                {
                    ret += (c - '0') / (div *= 10);
                }
            }

            if (neg)
                return -ret;
            return ret;
        }

        private void fillBuffer() throws IOException
        {
            bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
            if (bytesRead == -1)
                buffer[0] = -1;
        }

        private byte read() throws IOException
        {
            if (bufferPointer == bytesRead)
                fillBuffer();
            return buffer[bufferPointer++];
        }

        public void close() throws IOException
        {
            if (din == null)
                return;
            din.close();
        }
    }


} Main static Reader scan = new Reader(); scan new Reader() static Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) static int MAX = 111111 MAX 111111 bit_max = 32 bit_max 32 ALPHA_LIMIT = 30 ALPHA_LIMIT 30 SQRT_BUCKET = 555 SQRT_BUCKET 555 lim = 1000000007; lim 1000000007 static HashMap<Long, Long> quickHash = new HashMap<>(); quickHash new HashMap<>() static long watcher = 0; watcher 0 static StringBuffer stringBuffer; stringBuffer static long permutes(ArrayList<ArrayList<Long>> ptr){
        long sum = 0; if(ptr.size() < 3){return 0L;}
        for(ArrayList<Long> bucket : ptr) {
            sum+= bucket.size();
        }
        if(sum < 3){return 0L;} long jojo = 0;
        for(ArrayList<Long> bucket : ptr){
            if(bucket.size() > 1){
                jojo += (bucket.size()*(bucket.size()-1))/2;
            }
        }
        long mojo = (sum*(sum-1)*(sum-2))/6;
        //System.out.println(sum+" "+mojo+" "+jojo);
        return mojo-(jojo*(sum-2));
    } permutes {
        long sum = 0; if(ptr.size() < 3){return 0L;}
        for(ArrayList<Long> bucket : ptr) {
            sum+= bucket.size();
        }
        if(sum < 3){return 0L;} long jojo = 0;
        for(ArrayList<Long> bucket : ptr){
            if(bucket.size() > 1){
                jojo += (bucket.size()*(bucket.size()-1))/2;
            }
        }
        long mojo = (sum*(sum-1)*(sum-2))/6;
        //System.out.println(sum+" "+mojo+" "+jojo);
        return mojo-(jojo*(sum-2));
    } long sum = 0; sum 0 if(ptr.size() < 3){return 0L;} ptr.size() < 3 ptr.size() ptr.size ptr 3 {return 0L;} return 0L; 0L for(ArrayList<Long> bucket : ptr) {
            sum+= bucket.size();
        } ArrayList<Long> bucket ptr {
            sum+= bucket.size();
        } {
            sum+= bucket.size();
        } sum+= bucket.size() sum bucket.size() bucket.size bucket if(sum < 3){return 0L;} sum < 3 sum 3 {return 0L;} return 0L; 0L long jojo = 0; jojo 0 for(ArrayList<Long> bucket : ptr){
            if(bucket.size() > 1){
                jojo += (bucket.size()*(bucket.size()-1))/2;
            }
        } ArrayList<Long> bucket ptr {
            if(bucket.size() > 1){
                jojo += (bucket.size()*(bucket.size()-1))/2;
            }
        } {
            if(bucket.size() > 1){
                jojo += (bucket.size()*(bucket.size()-1))/2;
            }
        } if(bucket.size() > 1){
                jojo += (bucket.size()*(bucket.size()-1))/2;
            } bucket.size() > 1 bucket.size() bucket.size bucket 1 {
                jojo += (bucket.size()*(bucket.size()-1))/2;
            } jojo += (bucket.size()*(bucket.size()-1))/2 jojo (bucket.size()*(bucket.size()-1))/2 (bucket.size()*(bucket.size()-1)) bucket.size() bucket.size bucket (bucket.size()-1) bucket.size() bucket.size bucket 1 2 long mojo = (sum*(sum-1)*(sum-2))/6; mojo (sum*(sum-1)*(sum-2))/6 (sum*(sum-1)*(sum-2)) sum*(sum-1)*(sum-2) sum (sum-1) sum 1 (sum-2) sum 2 6 return mojo-(jojo*(sum-2)); mojo-(jojo*(sum-2)) mojo (jojo*(sum-2)) jojo (sum-2) sum 2 ArrayList<ArrayList<Long>> ptr ptr public static long solve(HashMap<Integer, HashSet<Integer>> map, int n){
        long answer =0 ;
        for(int center=0; center<n; center++){
            if(map.get(center).size() < 3){continue;}
            HashSet<Integer> vis = new HashSet<>();
            ArrayList<ArrayList<Integer>> buk = new ArrayList<>();
            for(int i : map.get(center)){buk.add(new ArrayList<>()); buk.get(buk.size()-1).add(i);}

        }
        return answer;
    } solve {
        long answer =0 ;
        for(int center=0; center<n; center++){
            if(map.get(center).size() < 3){continue;}
            HashSet<Integer> vis = new HashSet<>();
            ArrayList<ArrayList<Integer>> buk = new ArrayList<>();
            for(int i : map.get(center)){buk.add(new ArrayList<>()); buk.get(buk.size()-1).add(i);}

        }
        return answer;
    } long answer =0 ; answer 0 for(int center=0; center<n; center++){
            if(map.get(center).size() < 3){continue;}
            HashSet<Integer> vis = new HashSet<>();
            ArrayList<ArrayList<Integer>> buk = new ArrayList<>();
            for(int i : map.get(center)){buk.add(new ArrayList<>()); buk.get(buk.size()-1).add(i);}

        } int center=0; int center=0; center 0 center<n center n center++ center++ center {
            if(map.get(center).size() < 3){continue;}
            HashSet<Integer> vis = new HashSet<>();
            ArrayList<ArrayList<Integer>> buk = new ArrayList<>();
            for(int i : map.get(center)){buk.add(new ArrayList<>()); buk.get(buk.size()-1).add(i);}

        } {
            if(map.get(center).size() < 3){continue;}
            HashSet<Integer> vis = new HashSet<>();
            ArrayList<ArrayList<Integer>> buk = new ArrayList<>();
            for(int i : map.get(center)){buk.add(new ArrayList<>()); buk.get(buk.size()-1).add(i);}

        } if(map.get(center).size() < 3){continue;} map.get(center).size() < 3 map.get(center).size() map.get(center).size map.get(center) map.get map center 3 {continue;} continue; HashSet<Integer> vis = new HashSet<>(); vis new HashSet<>() ArrayList<ArrayList<Integer>> buk = new ArrayList<>(); buk new ArrayList<>() for(int i : map.get(center)){buk.add(new ArrayList<>()); buk.get(buk.size()-1).add(i);} int i map.get(center) map.get map center {buk.add(new ArrayList<>()); buk.get(buk.size()-1).add(i);} {buk.add(new ArrayList<>()); buk.get(buk.size()-1).add(i);} buk.add(new ArrayList<>()) buk.add buk new ArrayList<>() buk.get(buk.size()-1).add(i) buk.get(buk.size()-1).add buk.get(buk.size()-1) buk.get buk buk.size()-1 buk.size() buk.size buk 1 i return answer; answer HashMap<Integer, HashSet<Integer>> map map int n n public static void main(String[] args) throws IOException {
        int n = scanner.nextInt();
        HashMap<String, Long> map = new HashMap<>();
        long max = 0;
        for (int i = 0; i < n; i++) {
            String curr = scanner.next();
            if (!map.containsKey(curr)) {
                map.put(curr, 0L);
            }
            map.put(curr, map.get(curr) + 1);
            max = Long.max(max, map.get(curr));
        }
        ArrayList<String> arr = new ArrayList<>();
        for(String s : map.keySet()){
            if(map.get(s) == max){arr.add(s);}
        }
        //System.out.println(map);
        Collections.sort(arr);
        for(String s : arr){
            System.out.print(s+" ");
        }System.out.println();
    } main {
        int n = scanner.nextInt();
        HashMap<String, Long> map = new HashMap<>();
        long max = 0;
        for (int i = 0; i < n; i++) {
            String curr = scanner.next();
            if (!map.containsKey(curr)) {
                map.put(curr, 0L);
            }
            map.put(curr, map.get(curr) + 1);
            max = Long.max(max, map.get(curr));
        }
        ArrayList<String> arr = new ArrayList<>();
        for(String s : map.keySet()){
            if(map.get(s) == max){arr.add(s);}
        }
        //System.out.println(map);
        Collections.sort(arr);
        for(String s : arr){
            System.out.print(s+" ");
        }System.out.println();
    } int n = scanner.nextInt(); n scanner.nextInt() scanner.nextInt scanner HashMap<String, Long> map = new HashMap<>(); map new HashMap<>() long max = 0; max 0 for (int i = 0; i < n; i++) {
            String curr = scanner.next();
            if (!map.containsKey(curr)) {
                map.put(curr, 0L);
            }
            map.put(curr, map.get(curr) + 1);
            max = Long.max(max, map.get(curr));
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            String curr = scanner.next();
            if (!map.containsKey(curr)) {
                map.put(curr, 0L);
            }
            map.put(curr, map.get(curr) + 1);
            max = Long.max(max, map.get(curr));
        } {
            String curr = scanner.next();
            if (!map.containsKey(curr)) {
                map.put(curr, 0L);
            }
            map.put(curr, map.get(curr) + 1);
            max = Long.max(max, map.get(curr));
        } String curr = scanner.next(); curr scanner.next() scanner.next scanner if (!map.containsKey(curr)) {
                map.put(curr, 0L);
            } !map.containsKey(curr) map.containsKey(curr) map.containsKey map curr {
                map.put(curr, 0L);
            } map.put(curr, 0L) map.put map curr 0L map.put(curr, map.get(curr) + 1) map.put map curr map.get(curr) + 1 map.get(curr) map.get map curr 1 max = Long.max(max, map.get(curr)) max Long.max(max, map.get(curr)) Long.max Long max map.get(curr) map.get map curr ArrayList<String> arr = new ArrayList<>(); arr new ArrayList<>() for(String s : map.keySet()){
            if(map.get(s) == max){arr.add(s);}
        } String s map.keySet() map.keySet map {
            if(map.get(s) == max){arr.add(s);}
        } {
            if(map.get(s) == max){arr.add(s);}
        } if(map.get(s) == max){arr.add(s);} map.get(s) == max map.get(s) map.get map s max {arr.add(s);} arr.add(s) arr.add arr s Collections.sort(arr) Collections.sort Collections arr for(String s : arr){
            System.out.print(s+" ");
        } String s arr {
            System.out.print(s+" ");
        } {
            System.out.print(s+" ");
        } System.out.print(s+" ") System.out.print System.out System System.out s+" " s " " System.out.println() System.out.println System.out System System.out String[] args args static class Reader {
        final private int BUFFER_SIZE = 1 << 16;
        private DataInputStream din;
        private byte[] buffer;
        private int bufferPointer, bytesRead;

        public Reader()
        {
            din = new DataInputStream(System.in);
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public Reader(String file_name) throws IOException
        {
            din = new DataInputStream(new FileInputStream(file_name));
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public String readLine() throws IOException
        {
            byte[] buf = new byte[64]; // line length
            int cnt = 0, c;
            while ((c = read()) != -1)
            {
                if (c == '\n')
                    break;
                buf[cnt++] = (byte) c;
            }
            return new String(buf, 0, cnt);
        }

        public int nextInt() throws IOException
        {
            int ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do
            {
                ret = ret * 10 + c - '0';
            }  while ((c = read()) >= '0' && c <= '9');

            if (neg)
                return -ret;
            return ret;
        }

        public long nextLong() throws IOException
        {
            long ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');
            if (neg)
                return -ret;
            return ret;
        }

        public double nextDouble() throws IOException
        {
            double ret = 0, div = 1;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();

            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');

            if (c == '.')
            {
                while ((c = read()) >= '0' && c <= '9')
                {
                    ret += (c - '0') / (div *= 10);
                }
            }

            if (neg)
                return -ret;
            return ret;
        }

        private void fillBuffer() throws IOException
        {
            bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
            if (bytesRead == -1)
                buffer[0] = -1;
        }

        private byte read() throws IOException
        {
            if (bufferPointer == bytesRead)
                fillBuffer();
            return buffer[bufferPointer++];
        }

        public void close() throws IOException
        {
            if (din == null)
                return;
            din.close();
        }
    } Reader final private int BUFFER_SIZE = 1 << 16; BUFFER_SIZE 1 << 16 1 16 private DataInputStream din; din private byte[] buffer; buffer private int bufferPointer bufferPointer bytesRead; bytesRead public Reader()
        {
            din = new DataInputStream(System.in);
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        } Reader {
            din = new DataInputStream(System.in);
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        } din = new DataInputStream(System.in) din new DataInputStream(System.in) buffer = new byte[BUFFER_SIZE] buffer new byte[BUFFER_SIZE] BUFFER_SIZE bufferPointer = bytesRead = 0 bufferPointer bytesRead = 0 bytesRead 0 public Reader(String file_name) throws IOException
        {
            din = new DataInputStream(new FileInputStream(file_name));
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        } Reader {
            din = new DataInputStream(new FileInputStream(file_name));
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        } din = new DataInputStream(new FileInputStream(file_name)) din new DataInputStream(new FileInputStream(file_name)) buffer = new byte[BUFFER_SIZE] buffer new byte[BUFFER_SIZE] BUFFER_SIZE bufferPointer = bytesRead = 0 bufferPointer bytesRead = 0 bytesRead 0 String file_name file_name public String readLine() throws IOException
        {
            byte[] buf = new byte[64]; // line length
            int cnt = 0, c;
            while ((c = read()) != -1)
            {
                if (c == '\n')
                    break;
                buf[cnt++] = (byte) c;
            }
            return new String(buf, 0, cnt);
        } readLine {
            byte[] buf = new byte[64]; // line length
            int cnt = 0, c;
            while ((c = read()) != -1)
            {
                if (c == '\n')
                    break;
                buf[cnt++] = (byte) c;
            }
            return new String(buf, 0, cnt);
        } byte[] buf = new byte[64]; buf new byte[64] 64 int cnt = 0 cnt 0 c; c while ((c = read()) != -1)
            {
                if (c == '\n')
                    break;
                buf[cnt++] = (byte) c;
            } (c = read()) != -1 (c = read()) c read() read -1 1 {
                if (c == '\n')
                    break;
                buf[cnt++] = (byte) c;
            } if (c == '\n')
                    break; c == '\n' c '\n' break; buf[cnt++] = (byte) c buf[cnt++] buf cnt++ cnt (byte) c return new String(buf, 0, cnt); new String(buf, 0, cnt) public int nextInt() throws IOException
        {
            int ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do
            {
                ret = ret * 10 + c - '0';
            }  while ((c = read()) >= '0' && c <= '9');

            if (neg)
                return -ret;
            return ret;
        } nextInt {
            int ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do
            {
                ret = ret * 10 + c - '0';
            }  while ((c = read()) >= '0' && c <= '9');

            if (neg)
                return -ret;
            return ret;
        } int ret = 0; ret 0 byte c = read(); c read() read while (c <= ' ')
                c = read(); c <= ' ' c ' ' c = read() c read() read boolean neg = (c == '-'); neg (c == '-') c '-' if (neg)
                c = read(); neg c = read() c read() read do
            {
                ret = ret * 10 + c - '0';
            }  while ((c = read()) >= '0' && c <= '9'); (c = read()) >= '0' && c <= '9' (c = read()) >= '0' (c = read()) c read() read '0' c <= '9' c '9' {
                ret = ret * 10 + c - '0';
            } ret = ret * 10 + c - '0' ret ret * 10 + c - '0' ret * 10 + c ret * 10 ret 10 c '0' if (neg)
                return -ret; neg return -ret; -ret ret return ret; ret public long nextLong() throws IOException
        {
            long ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');
            if (neg)
                return -ret;
            return ret;
        } nextLong {
            long ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');
            if (neg)
                return -ret;
            return ret;
        } long ret = 0; ret 0 byte c = read(); c read() read while (c <= ' ')
                c = read(); c <= ' ' c ' ' c = read() c read() read boolean neg = (c == '-'); neg (c == '-') c '-' if (neg)
                c = read(); neg c = read() c read() read do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9'); (c = read()) >= '0' && c <= '9' (c = read()) >= '0' (c = read()) c read() read '0' c <= '9' c '9' {
                ret = ret * 10 + c - '0';
            } ret = ret * 10 + c - '0' ret ret * 10 + c - '0' ret * 10 + c ret * 10 ret 10 c '0' if (neg)
                return -ret; neg return -ret; -ret ret return ret; ret public double nextDouble() throws IOException
        {
            double ret = 0, div = 1;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();

            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');

            if (c == '.')
            {
                while ((c = read()) >= '0' && c <= '9')
                {
                    ret += (c - '0') / (div *= 10);
                }
            }

            if (neg)
                return -ret;
            return ret;
        } nextDouble {
            double ret = 0, div = 1;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();

            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');

            if (c == '.')
            {
                while ((c = read()) >= '0' && c <= '9')
                {
                    ret += (c - '0') / (div *= 10);
                }
            }

            if (neg)
                return -ret;
            return ret;
        } double ret = 0 ret 0 div = 1; div 1 byte c = read(); c read() read while (c <= ' ')
                c = read(); c <= ' ' c ' ' c = read() c read() read boolean neg = (c == '-'); neg (c == '-') c '-' if (neg)
                c = read(); neg c = read() c read() read do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9'); (c = read()) >= '0' && c <= '9' (c = read()) >= '0' (c = read()) c read() read '0' c <= '9' c '9' {
                ret = ret * 10 + c - '0';
            } ret = ret * 10 + c - '0' ret ret * 10 + c - '0' ret * 10 + c ret * 10 ret 10 c '0' if (c == '.')
            {
                while ((c = read()) >= '0' && c <= '9')
                {
                    ret += (c - '0') / (div *= 10);
                }
            } c == '.' c '.' {
                while ((c = read()) >= '0' && c <= '9')
                {
                    ret += (c - '0') / (div *= 10);
                }
            } while ((c = read()) >= '0' && c <= '9')
                {
                    ret += (c - '0') / (div *= 10);
                } (c = read()) >= '0' && c <= '9' (c = read()) >= '0' (c = read()) c read() read '0' c <= '9' c '9' {
                    ret += (c - '0') / (div *= 10);
                } ret += (c - '0') / (div *= 10) ret (c - '0') / (div *= 10) (c - '0') c '0' (div *= 10) div 10 if (neg)
                return -ret; neg return -ret; -ret ret return ret; ret private void fillBuffer() throws IOException
        {
            bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
            if (bytesRead == -1)
                buffer[0] = -1;
        } fillBuffer {
            bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
            if (bytesRead == -1)
                buffer[0] = -1;
        } bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE) bytesRead din.read(buffer, bufferPointer = 0, BUFFER_SIZE) din.read din buffer bufferPointer = 0 bufferPointer 0 BUFFER_SIZE if (bytesRead == -1)
                buffer[0] = -1; bytesRead == -1 bytesRead -1 1 buffer[0] = -1 buffer[0] buffer 0 -1 1 private byte read() throws IOException
        {
            if (bufferPointer == bytesRead)
                fillBuffer();
            return buffer[bufferPointer++];
        } read {
            if (bufferPointer == bytesRead)
                fillBuffer();
            return buffer[bufferPointer++];
        } if (bufferPointer == bytesRead)
                fillBuffer(); bufferPointer == bytesRead bufferPointer bytesRead fillBuffer() fillBuffer return buffer[bufferPointer++]; buffer[bufferPointer++] buffer bufferPointer++ bufferPointer public void close() throws IOException
        {
            if (din == null)
                return;
            din.close();
        } close {
            if (din == null)
                return;
            din.close();
        } if (din == null)
                return; din == null din null return; din.close() din.close din  */ public class Main{

    static Reader scan = new Reader(); static Scanner scanner = new Scanner(System.in);
    static int MAX = 111111, bit_max = 32, ALPHA_LIMIT = 30, SQRT_BUCKET = 555, lim = 1000000007;
    static HashMap<Long, Long> quickHash = new HashMap<>();
    static long watcher = 0;
    static StringBuffer stringBuffer;

    static long permutes(ArrayList<ArrayList<Long>> ptr){
        long sum = 0; if(ptr.size() < 3){return 0L;}
        for(ArrayList<Long> bucket : ptr) {
            sum+= bucket.size();
        }
        if(sum < 3){return 0L;} long jojo = 0;
        for(ArrayList<Long> bucket : ptr){
            if(bucket.size() > 1){
                jojo += (bucket.size()*(bucket.size()-1))/2;
            }
        }
        long mojo = (sum*(sum-1)*(sum-2))/6;
        //System.out.println(sum+" "+mojo+" "+jojo);
        return mojo-(jojo*(sum-2));
    }

    public static long solve(HashMap<Integer, HashSet<Integer>> map, int n){
        long answer =0 ;
        for(int center=0; center<n; center++){
            if(map.get(center).size() < 3){continue;}
            HashSet<Integer> vis = new HashSet<>();
            ArrayList<ArrayList<Integer>> buk = new ArrayList<>();
            for(int i : map.get(center)){buk.add(new ArrayList<>()); buk.get(buk.size()-1).add(i);}

        }
        return answer;
    }


    public static void main(String[] args) throws IOException {
        int n = scanner.nextInt();
        HashMap<String, Long> map = new HashMap<>();
        long max = 0;
        for (int i = 0; i < n; i++) {
            String curr = scanner.next();
            if (!map.containsKey(curr)) {
                map.put(curr, 0L);
            }
            map.put(curr, map.get(curr) + 1);
            max = Long.max(max, map.get(curr));
        }
        ArrayList<String> arr = new ArrayList<>();
        for(String s : map.keySet()){
            if(map.get(s) == max){arr.add(s);}
        }
        //System.out.println(map);
        Collections.sort(arr);
        for(String s : arr){
            System.out.print(s+" ");
        }System.out.println();
    }





    static class Reader {
        final private int BUFFER_SIZE = 1 << 16;
        private DataInputStream din;
        private byte[] buffer;
        private int bufferPointer, bytesRead;

        public Reader()
        {
            din = new DataInputStream(System.in);
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public Reader(String file_name) throws IOException
        {
            din = new DataInputStream(new FileInputStream(file_name));
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public String readLine() throws IOException
        {
            byte[] buf = new byte[64]; // line length
            int cnt = 0, c;
            while ((c = read()) != -1)
            {
                if (c == '\n')
                    break;
                buf[cnt++] = (byte) c;
            }
            return new String(buf, 0, cnt);
        }

        public int nextInt() throws IOException
        {
            int ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do
            {
                ret = ret * 10 + c - '0';
            }  while ((c = read()) >= '0' && c <= '9');

            if (neg)
                return -ret;
            return ret;
        }

        public long nextLong() throws IOException
        {
            long ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');
            if (neg)
                return -ret;
            return ret;
        }

        public double nextDouble() throws IOException
        {
            double ret = 0, div = 1;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();

            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');

            if (c == '.')
            {
                while ((c = read()) >= '0' && c <= '9')
                {
                    ret += (c - '0') / (div *= 10);
                }
            }

            if (neg)
                return -ret;
            return ret;
        }

        private void fillBuffer() throws IOException
        {
            bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
            if (bytesRead == -1)
                buffer[0] = -1;
        }

        private byte read() throws IOException
        {
            if (bufferPointer == bytesRead)
                fillBuffer();
            return buffer[bufferPointer++];
        }

        public void close() throws IOException
        {
            if (din == null)
                return;
            din.close();
        }
    }


}  */ public class Main{

    static Reader scan = new Reader(); static Scanner scanner = new Scanner(System.in);
    static int MAX = 111111, bit_max = 32, ALPHA_LIMIT = 30, SQRT_BUCKET = 555, lim = 1000000007;
    static HashMap<Long, Long> quickHash = new HashMap<>();
    static long watcher = 0;
    static StringBuffer stringBuffer;

    static long permutes(ArrayList<ArrayList<Long>> ptr){
        long sum = 0; if(ptr.size() < 3){return 0L;}
        for(ArrayList<Long> bucket : ptr) {
            sum+= bucket.size();
        }
        if(sum < 3){return 0L;} long jojo = 0;
        for(ArrayList<Long> bucket : ptr){
            if(bucket.size() > 1){
                jojo += (bucket.size()*(bucket.size()-1))/2;
            }
        }
        long mojo = (sum*(sum-1)*(sum-2))/6;
        //System.out.println(sum+" "+mojo+" "+jojo);
        return mojo-(jojo*(sum-2));
    }

    public static long solve(HashMap<Integer, HashSet<Integer>> map, int n){
        long answer =0 ;
        for(int center=0; center<n; center++){
            if(map.get(center).size() < 3){continue;}
            HashSet<Integer> vis = new HashSet<>();
            ArrayList<ArrayList<Integer>> buk = new ArrayList<>();
            for(int i : map.get(center)){buk.add(new ArrayList<>()); buk.get(buk.size()-1).add(i);}

        }
        return answer;
    }


    public static void main(String[] args) throws IOException {
        int n = scanner.nextInt();
        HashMap<String, Long> map = new HashMap<>();
        long max = 0;
        for (int i = 0; i < n; i++) {
            String curr = scanner.next();
            if (!map.containsKey(curr)) {
                map.put(curr, 0L);
            }
            map.put(curr, map.get(curr) + 1);
            max = Long.max(max, map.get(curr));
        }
        ArrayList<String> arr = new ArrayList<>();
        for(String s : map.keySet()){
            if(map.get(s) == max){arr.add(s);}
        }
        //System.out.println(map);
        Collections.sort(arr);
        for(String s : arr){
            System.out.print(s+" ");
        }System.out.println();
    }





    static class Reader {
        final private int BUFFER_SIZE = 1 << 16;
        private DataInputStream din;
        private byte[] buffer;
        private int bufferPointer, bytesRead;

        public Reader()
        {
            din = new DataInputStream(System.in);
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public Reader(String file_name) throws IOException
        {
            din = new DataInputStream(new FileInputStream(file_name));
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public String readLine() throws IOException
        {
            byte[] buf = new byte[64]; // line length
            int cnt = 0, c;
            while ((c = read()) != -1)
            {
                if (c == '\n')
                    break;
                buf[cnt++] = (byte) c;
            }
            return new String(buf, 0, cnt);
        }

        public int nextInt() throws IOException
        {
            int ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do
            {
                ret = ret * 10 + c - '0';
            }  while ((c = read()) >= '0' && c <= '9');

            if (neg)
                return -ret;
            return ret;
        }

        public long nextLong() throws IOException
        {
            long ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');
            if (neg)
                return -ret;
            return ret;
        }

        public double nextDouble() throws IOException
        {
            double ret = 0, div = 1;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();

            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');

            if (c == '.')
            {
                while ((c = read()) >= '0' && c <= '9')
                {
                    ret += (c - '0') / (div *= 10);
                }
            }

            if (neg)
                return -ret;
            return ret;
        }

        private void fillBuffer() throws IOException
        {
            bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
            if (bytesRead == -1)
                buffer[0] = -1;
        }

        private byte read() throws IOException
        {
            if (bufferPointer == bytesRead)
                fillBuffer();
            return buffer[bufferPointer++];
        }

        public void close() throws IOException
        {
            if (din == null)
                return;
            din.close();
        }
    }


} Main

import java.lang.reflect.Array;
import java.util.*; import java.io.*;
/*
 * untitled.java
 * Copyright 2019 Karan Kanojia <karankanojia@Karans-MacBook-Air.local>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 * MA 02110-1301, USA.
 */ public class Main{

    static Reader scan = new Reader(); static Scanner scanner = new Scanner(System.in);
    static int MAX = 111111, bit_max = 32, ALPHA_LIMIT = 30, SQRT_BUCKET = 555, lim = 1000000007;
    static HashMap<Long, Long> quickHash = new HashMap<>();
    static long watcher = 0;
    static StringBuffer stringBuffer;

    static long permutes(ArrayList<ArrayList<Long>> ptr){
        long sum = 0; if(ptr.size() < 3){return 0L;}
        for(ArrayList<Long> bucket : ptr) {
            sum+= bucket.size();
        }
        if(sum < 3){return 0L;} long jojo = 0;
        for(ArrayList<Long> bucket : ptr){
            if(bucket.size() > 1){
                jojo += (bucket.size()*(bucket.size()-1))/2;
            }
        }
        long mojo = (sum*(sum-1)*(sum-2))/6;
        //System.out.println(sum+" "+mojo+" "+jojo);
        return mojo-(jojo*(sum-2));
    }

    public static long solve(HashMap<Integer, HashSet<Integer>> map, int n){
        long answer =0 ;
        for(int center=0; center<n; center++){
            if(map.get(center).size() < 3){continue;}
            HashSet<Integer> vis = new HashSet<>();
            ArrayList<ArrayList<Integer>> buk = new ArrayList<>();
            for(int i : map.get(center)){buk.add(new ArrayList<>()); buk.get(buk.size()-1).add(i);}

        }
        return answer;
    }


    public static void main(String[] args) throws IOException {
        int n = scanner.nextInt();
        HashMap<String, Long> map = new HashMap<>();
        long max = 0;
        for (int i = 0; i < n; i++) {
            String curr = scanner.next();
            if (!map.containsKey(curr)) {
                map.put(curr, 0L);
            }
            map.put(curr, map.get(curr) + 1);
            max = Long.max(max, map.get(curr));
        }
        ArrayList<String> arr = new ArrayList<>();
        for(String s : map.keySet()){
            if(map.get(s) == max){arr.add(s);}
        }
        //System.out.println(map);
        Collections.sort(arr);
        for(String s : arr){
            System.out.print(s+" ");
        }System.out.println();
    }





    static class Reader {
        final private int BUFFER_SIZE = 1 << 16;
        private DataInputStream din;
        private byte[] buffer;
        private int bufferPointer, bytesRead;

        public Reader()
        {
            din = new DataInputStream(System.in);
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public Reader(String file_name) throws IOException
        {
            din = new DataInputStream(new FileInputStream(file_name));
            buffer = new byte[BUFFER_SIZE];
            bufferPointer = bytesRead = 0;
        }

        public String readLine() throws IOException
        {
            byte[] buf = new byte[64]; // line length
            int cnt = 0, c;
            while ((c = read()) != -1)
            {
                if (c == '\n')
                    break;
                buf[cnt++] = (byte) c;
            }
            return new String(buf, 0, cnt);
        }

        public int nextInt() throws IOException
        {
            int ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do
            {
                ret = ret * 10 + c - '0';
            }  while ((c = read()) >= '0' && c <= '9');

            if (neg)
                return -ret;
            return ret;
        }

        public long nextLong() throws IOException
        {
            long ret = 0;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();
            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');
            if (neg)
                return -ret;
            return ret;
        }

        public double nextDouble() throws IOException
        {
            double ret = 0, div = 1;
            byte c = read();
            while (c <= ' ')
                c = read();
            boolean neg = (c == '-');
            if (neg)
                c = read();

            do {
                ret = ret * 10 + c - '0';
            }
            while ((c = read()) >= '0' && c <= '9');

            if (c == '.')
            {
                while ((c = read()) >= '0' && c <= '9')
                {
                    ret += (c - '0') / (div *= 10);
                }
            }

            if (neg)
                return -ret;
            return ret;
        }

        private void fillBuffer() throws IOException
        {
            bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
            if (bytesRead == -1)
                buffer[0] = -1;
        }

        private byte read() throws IOException
        {
            if (bufferPointer == bytesRead)
                fillBuffer();
            return buffer[bufferPointer++];
        }

        public void close() throws IOException
        {
            if (din == null)
                return;
            din.close();
        }
    }


}