
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.*;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;


class Main {
    public static void main(String[] args) {
        InputReader in = new InputReader(System.in);
        PrintWriter out = new PrintWriter(System.out);

        int n = in.nextInt();
        int max = Integer.MIN_VALUE;

        List<String> s1 = new ArrayList<String>();
        HashMap<String,Integer> map = new HashMap<String,Integer>();

        while (n >0){
            String str =  in.next();
            s1.add(str);
            if(map.containsKey(str)){
                map.put(str,(map.get(str)+1));
            } else {
                map.put(str,1);
            }

            if (map.get(str) > max) {
                max = map.get(str);
            }
            n--;
        }

        List<String> result = new ArrayList<>();
        for (String str: map.keySet()){
            if(map.get(str) == max){
                result.add(str);
            }
        }

//        map = sortByValue(map);
//        List<String> list1 = new ArrayList<>();
////        out.println(map);
//        int max = 0;
//        for (String key : map.keySet()){
////            int count1 = map.get(key);
//            if ( map.get(key) >= max){
//                max = map.get(key);
//                list1.add(key);
////                out.println(key);
//            }
//
//        }
        Collections.sort(result);
        for (String s : result)
            out.println(s);



        out.close();
    }
    public static HashMap<String, Integer> sortByValue(HashMap<String, Integer> hm)
    {
        // Create a list from elements of HashMap
        List<Map.Entry<String, Integer> > list =
                new LinkedList<Map.Entry<String, Integer> >(hm.entrySet());

        // Sort the list
        Collections.sort(list, new Comparator<Map.Entry<String, Integer> >() {
            public int compare(Map.Entry<String, Integer> o1,
                               Map.Entry<String, Integer> o2)
            {
                return (o2.getValue()).compareTo(o1.getValue());
            }
        });

        // put data from sorted list to hashmap
        HashMap<String, Integer> temp = new LinkedHashMap<String, Integer>();
        for (Map.Entry<String, Integer> aa : list) {
            temp.put(aa.getKey(), aa.getValue());
        }
        return temp;
    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
} Comparator<Map.Entry<String, Integer> >() {
            public int compare(Map.Entry<String, Integer> o1,
                               Map.Entry<String, Integer> o2)
            {
                return (o2.getValue()).compareTo(o1.getValue());
            }
        } public int compare(Map.Entry<String, Integer> o1,
                               Map.Entry<String, Integer> o2)
            {
                return (o2.getValue()).compareTo(o1.getValue());
            } compare {
                return (o2.getValue()).compareTo(o1.getValue());
            } return (o2.getValue()).compareTo(o1.getValue()); (o2.getValue()).compareTo(o1.getValue()) (o2.getValue()).compareTo (o2.getValue()) o2.getValue o2 o1.getValue() o1.getValue o1 Map.Entry<String, Integer> o1 o1 Map.Entry<String, Integer> o2 o2 import java.io.OutputStream; OutputStream java.io import java.io.IOException; IOException java.io import java.io.InputStream; InputStream java.io import java.io.PrintWriter; PrintWriter java.io import java.util.*; util.* java import java.io.IOException; IOException java.io import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.InputStream; InputStream java.io class Main {
    public static void main(String[] args) {
        InputReader in = new InputReader(System.in);
        PrintWriter out = new PrintWriter(System.out);

        int n = in.nextInt();
        int max = Integer.MIN_VALUE;

        List<String> s1 = new ArrayList<String>();
        HashMap<String,Integer> map = new HashMap<String,Integer>();

        while (n >0){
            String str =  in.next();
            s1.add(str);
            if(map.containsKey(str)){
                map.put(str,(map.get(str)+1));
            } else {
                map.put(str,1);
            }

            if (map.get(str) > max) {
                max = map.get(str);
            }
            n--;
        }

        List<String> result = new ArrayList<>();
        for (String str: map.keySet()){
            if(map.get(str) == max){
                result.add(str);
            }
        }

//        map = sortByValue(map);
//        List<String> list1 = new ArrayList<>();
////        out.println(map);
//        int max = 0;
//        for (String key : map.keySet()){
////            int count1 = map.get(key);
//            if ( map.get(key) >= max){
//                max = map.get(key);
//                list1.add(key);
////                out.println(key);
//            }
//
//        }
        Collections.sort(result);
        for (String s : result)
            out.println(s);



        out.close();
    }
    public static HashMap<String, Integer> sortByValue(HashMap<String, Integer> hm)
    {
        // Create a list from elements of HashMap
        List<Map.Entry<String, Integer> > list =
                new LinkedList<Map.Entry<String, Integer> >(hm.entrySet());

        // Sort the list
        Collections.sort(list, new Comparator<Map.Entry<String, Integer> >() {
            public int compare(Map.Entry<String, Integer> o1,
                               Map.Entry<String, Integer> o2)
            {
                return (o2.getValue()).compareTo(o1.getValue());
            }
        });

        // put data from sorted list to hashmap
        HashMap<String, Integer> temp = new LinkedHashMap<String, Integer>();
        for (Map.Entry<String, Integer> aa : list) {
            temp.put(aa.getKey(), aa.getValue());
        }
        return temp;
    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
} Main public static void main(String[] args) {
        InputReader in = new InputReader(System.in);
        PrintWriter out = new PrintWriter(System.out);

        int n = in.nextInt();
        int max = Integer.MIN_VALUE;

        List<String> s1 = new ArrayList<String>();
        HashMap<String,Integer> map = new HashMap<String,Integer>();

        while (n >0){
            String str =  in.next();
            s1.add(str);
            if(map.containsKey(str)){
                map.put(str,(map.get(str)+1));
            } else {
                map.put(str,1);
            }

            if (map.get(str) > max) {
                max = map.get(str);
            }
            n--;
        }

        List<String> result = new ArrayList<>();
        for (String str: map.keySet()){
            if(map.get(str) == max){
                result.add(str);
            }
        }

//        map = sortByValue(map);
//        List<String> list1 = new ArrayList<>();
////        out.println(map);
//        int max = 0;
//        for (String key : map.keySet()){
////            int count1 = map.get(key);
//            if ( map.get(key) >= max){
//                max = map.get(key);
//                list1.add(key);
////                out.println(key);
//            }
//
//        }
        Collections.sort(result);
        for (String s : result)
            out.println(s);



        out.close();
    } main {
        InputReader in = new InputReader(System.in);
        PrintWriter out = new PrintWriter(System.out);

        int n = in.nextInt();
        int max = Integer.MIN_VALUE;

        List<String> s1 = new ArrayList<String>();
        HashMap<String,Integer> map = new HashMap<String,Integer>();

        while (n >0){
            String str =  in.next();
            s1.add(str);
            if(map.containsKey(str)){
                map.put(str,(map.get(str)+1));
            } else {
                map.put(str,1);
            }

            if (map.get(str) > max) {
                max = map.get(str);
            }
            n--;
        }

        List<String> result = new ArrayList<>();
        for (String str: map.keySet()){
            if(map.get(str) == max){
                result.add(str);
            }
        }

//        map = sortByValue(map);
//        List<String> list1 = new ArrayList<>();
////        out.println(map);
//        int max = 0;
//        for (String key : map.keySet()){
////            int count1 = map.get(key);
//            if ( map.get(key) >= max){
//                max = map.get(key);
//                list1.add(key);
////                out.println(key);
//            }
//
//        }
        Collections.sort(result);
        for (String s : result)
            out.println(s);



        out.close();
    } InputReader in = new InputReader(System.in); in new InputReader(System.in) PrintWriter out = new PrintWriter(System.out); out new PrintWriter(System.out) int n = in.nextInt(); n in.nextInt() in.nextInt in int max = Integer.MIN_VALUE; max Integer.MIN_VALUE Integer Integer.MIN_VALUE List<String> s1 = new ArrayList<String>(); s1 new ArrayList<String>() HashMap<String,Integer> map = new HashMap<String,Integer>(); map new HashMap<String,Integer>() while (n >0){
            String str =  in.next();
            s1.add(str);
            if(map.containsKey(str)){
                map.put(str,(map.get(str)+1));
            } else {
                map.put(str,1);
            }

            if (map.get(str) > max) {
                max = map.get(str);
            }
            n--;
        } n >0 n 0 {
            String str =  in.next();
            s1.add(str);
            if(map.containsKey(str)){
                map.put(str,(map.get(str)+1));
            } else {
                map.put(str,1);
            }

            if (map.get(str) > max) {
                max = map.get(str);
            }
            n--;
        } String str =  in.next(); str in.next() in.next in s1.add(str) s1.add s1 str if(map.containsKey(str)){
                map.put(str,(map.get(str)+1));
            } else {
                map.put(str,1);
            } map.containsKey(str) map.containsKey map str {
                map.put(str,(map.get(str)+1));
            } map.put(str,(map.get(str)+1)) map.put map str (map.get(str)+1) map.get(str) map.get map str 1 {
                map.put(str,1);
            } map.put(str,1) map.put map str 1 if (map.get(str) > max) {
                max = map.get(str);
            } map.get(str) > max map.get(str) map.get map str max {
                max = map.get(str);
            } max = map.get(str) max map.get(str) map.get map str n-- n List<String> result = new ArrayList<>(); result new ArrayList<>() for (String str: map.keySet()){
            if(map.get(str) == max){
                result.add(str);
            }
        } String str map.keySet() map.keySet map {
            if(map.get(str) == max){
                result.add(str);
            }
        } {
            if(map.get(str) == max){
                result.add(str);
            }
        } if(map.get(str) == max){
                result.add(str);
            } map.get(str) == max map.get(str) map.get map str max {
                result.add(str);
            } result.add(str) result.add result str Collections.sort(result) Collections.sort Collections result for (String s : result)
            out.println(s); String s result out.println(s); out.println(s) out.println out s out.close() out.close out String[] args args public static HashMap<String, Integer> sortByValue(HashMap<String, Integer> hm)
    {
        // Create a list from elements of HashMap
        List<Map.Entry<String, Integer> > list =
                new LinkedList<Map.Entry<String, Integer> >(hm.entrySet());

        // Sort the list
        Collections.sort(list, new Comparator<Map.Entry<String, Integer> >() {
            public int compare(Map.Entry<String, Integer> o1,
                               Map.Entry<String, Integer> o2)
            {
                return (o2.getValue()).compareTo(o1.getValue());
            }
        });

        // put data from sorted list to hashmap
        HashMap<String, Integer> temp = new LinkedHashMap<String, Integer>();
        for (Map.Entry<String, Integer> aa : list) {
            temp.put(aa.getKey(), aa.getValue());
        }
        return temp;
    } sortByValue {
        // Create a list from elements of HashMap
        List<Map.Entry<String, Integer> > list =
                new LinkedList<Map.Entry<String, Integer> >(hm.entrySet());

        // Sort the list
        Collections.sort(list, new Comparator<Map.Entry<String, Integer> >() {
            public int compare(Map.Entry<String, Integer> o1,
                               Map.Entry<String, Integer> o2)
            {
                return (o2.getValue()).compareTo(o1.getValue());
            }
        });

        // put data from sorted list to hashmap
        HashMap<String, Integer> temp = new LinkedHashMap<String, Integer>();
        for (Map.Entry<String, Integer> aa : list) {
            temp.put(aa.getKey(), aa.getValue());
        }
        return temp;
    } List<Map.Entry<String, Integer> > list =
                new LinkedList<Map.Entry<String, Integer> >(hm.entrySet()); list new LinkedList<Map.Entry<String, Integer> >(hm.entrySet()) Collections.sort(list, new Comparator<Map.Entry<String, Integer> >() {
            public int compare(Map.Entry<String, Integer> o1,
                               Map.Entry<String, Integer> o2)
            {
                return (o2.getValue()).compareTo(o1.getValue());
            }
        }) Collections.sort Collections list new Comparator<Map.Entry<String, Integer> >() {
            public int compare(Map.Entry<String, Integer> o1,
                               Map.Entry<String, Integer> o2)
            {
                return (o2.getValue()).compareTo(o1.getValue());
            }
        } HashMap<String, Integer> temp = new LinkedHashMap<String, Integer>(); temp new LinkedHashMap<String, Integer>() for (Map.Entry<String, Integer> aa : list) {
            temp.put(aa.getKey(), aa.getValue());
        } Map.Entry<String, Integer> aa list {
            temp.put(aa.getKey(), aa.getValue());
        } {
            temp.put(aa.getKey(), aa.getValue());
        } temp.put(aa.getKey(), aa.getValue()) temp.put temp aa.getKey() aa.getKey aa aa.getValue() aa.getValue aa return temp; temp HashMap<String, Integer> hm hm static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    } InputReader public BufferedReader reader; reader public StringTokenizer tokenizer; tokenizer public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        } InputReader {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        } reader = new BufferedReader(new InputStreamReader(stream), 32768) reader new BufferedReader(new InputStreamReader(stream), 32768) tokenizer = null tokenizer null InputStream stream stream public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        } next {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        } while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            } tokenizer == null || !tokenizer.hasMoreTokens() tokenizer == null tokenizer null !tokenizer.hasMoreTokens() tokenizer.hasMoreTokens() tokenizer.hasMoreTokens tokenizer {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            } try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                } catch (IOException e) {
                    throw new RuntimeException(e);
                } IOException e {
                    throw new RuntimeException(e);
                } throw new RuntimeException(e); new RuntimeException(e) {
                    tokenizer = new StringTokenizer(reader.readLine());
                } tokenizer = new StringTokenizer(reader.readLine()) tokenizer new StringTokenizer(reader.readLine()) return tokenizer.nextToken(); tokenizer.nextToken() tokenizer.nextToken tokenizer public int nextInt() {
            return Integer.parseInt(next());
        } nextInt {
            return Integer.parseInt(next());
        } return Integer.parseInt(next()); Integer.parseInt(next()) Integer.parseInt Integer next() next

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.*;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;


class Main {
    public static void main(String[] args) {
        InputReader in = new InputReader(System.in);
        PrintWriter out = new PrintWriter(System.out);

        int n = in.nextInt();
        int max = Integer.MIN_VALUE;

        List<String> s1 = new ArrayList<String>();
        HashMap<String,Integer> map = new HashMap<String,Integer>();

        while (n >0){
            String str =  in.next();
            s1.add(str);
            if(map.containsKey(str)){
                map.put(str,(map.get(str)+1));
            } else {
                map.put(str,1);
            }

            if (map.get(str) > max) {
                max = map.get(str);
            }
            n--;
        }

        List<String> result = new ArrayList<>();
        for (String str: map.keySet()){
            if(map.get(str) == max){
                result.add(str);
            }
        }

//        map = sortByValue(map);
//        List<String> list1 = new ArrayList<>();
////        out.println(map);
//        int max = 0;
//        for (String key : map.keySet()){
////            int count1 = map.get(key);
//            if ( map.get(key) >= max){
//                max = map.get(key);
//                list1.add(key);
////                out.println(key);
//            }
//
//        }
        Collections.sort(result);
        for (String s : result)
            out.println(s);



        out.close();
    }
    public static HashMap<String, Integer> sortByValue(HashMap<String, Integer> hm)
    {
        // Create a list from elements of HashMap
        List<Map.Entry<String, Integer> > list =
                new LinkedList<Map.Entry<String, Integer> >(hm.entrySet());

        // Sort the list
        Collections.sort(list, new Comparator<Map.Entry<String, Integer> >() {
            public int compare(Map.Entry<String, Integer> o1,
                               Map.Entry<String, Integer> o2)
            {
                return (o2.getValue()).compareTo(o1.getValue());
            }
        });

        // put data from sorted list to hashmap
        HashMap<String, Integer> temp = new LinkedHashMap<String, Integer>();
        for (Map.Entry<String, Integer> aa : list) {
            temp.put(aa.getKey(), aa.getValue());
        }
        return temp;
    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}