import java.util.*;

public class Main {

    public static void main(String[] args) {
        // write your code here
        Scanner sc=new Scanner(System.in);
        int N=sc.nextInt();
        Map<String,Integer> map = new HashMap<String,Integer>();
        int max = 1;
        for(int i=0;i<N;i++){
            String temp = sc.next();
            if(map.containsKey(temp)){
                int value = map.get(temp) + 1;
                map.put(temp , value);
                if(value > max){
                    max = value;
                }

            }else{
                map.put(temp,1);
            }

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

        Collections.sort(maxstr);

        for(int i=0;i<maxstr.size();i++){
            System.out.println(maxstr.get(i));
        }

    }
} import java.util.*; util.* java public class Main {

    public static void main(String[] args) {
        // write your code here
        Scanner sc=new Scanner(System.in);
        int N=sc.nextInt();
        Map<String,Integer> map = new HashMap<String,Integer>();
        int max = 1;
        for(int i=0;i<N;i++){
            String temp = sc.next();
            if(map.containsKey(temp)){
                int value = map.get(temp) + 1;
                map.put(temp , value);
                if(value > max){
                    max = value;
                }

            }else{
                map.put(temp,1);
            }

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

        Collections.sort(maxstr);

        for(int i=0;i<maxstr.size();i++){
            System.out.println(maxstr.get(i));
        }

    }
} Main public static void main(String[] args) {
        // write your code here
        Scanner sc=new Scanner(System.in);
        int N=sc.nextInt();
        Map<String,Integer> map = new HashMap<String,Integer>();
        int max = 1;
        for(int i=0;i<N;i++){
            String temp = sc.next();
            if(map.containsKey(temp)){
                int value = map.get(temp) + 1;
                map.put(temp , value);
                if(value > max){
                    max = value;
                }

            }else{
                map.put(temp,1);
            }

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

        Collections.sort(maxstr);

        for(int i=0;i<maxstr.size();i++){
            System.out.println(maxstr.get(i));
        }

    } main {
        // write your code here
        Scanner sc=new Scanner(System.in);
        int N=sc.nextInt();
        Map<String,Integer> map = new HashMap<String,Integer>();
        int max = 1;
        for(int i=0;i<N;i++){
            String temp = sc.next();
            if(map.containsKey(temp)){
                int value = map.get(temp) + 1;
                map.put(temp , value);
                if(value > max){
                    max = value;
                }

            }else{
                map.put(temp,1);
            }

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

        Collections.sort(maxstr);

        for(int i=0;i<maxstr.size();i++){
            System.out.println(maxstr.get(i));
        }

    } Scanner sc=new Scanner(System.in); sc new Scanner(System.in) int N=sc.nextInt(); N sc.nextInt() sc.nextInt sc Map<String,Integer> map = new HashMap<String,Integer>(); map new HashMap<String,Integer>() int max = 1; max 1 for(int i=0;i<N;i++){
            String temp = sc.next();
            if(map.containsKey(temp)){
                int value = map.get(temp) + 1;
                map.put(temp , value);
                if(value > max){
                    max = value;
                }

            }else{
                map.put(temp,1);
            }

        } int i=0; int i=0; i 0 i<N i N i++ i++ i {
            String temp = sc.next();
            if(map.containsKey(temp)){
                int value = map.get(temp) + 1;
                map.put(temp , value);
                if(value > max){
                    max = value;
                }

            }else{
                map.put(temp,1);
            }

        } {
            String temp = sc.next();
            if(map.containsKey(temp)){
                int value = map.get(temp) + 1;
                map.put(temp , value);
                if(value > max){
                    max = value;
                }

            }else{
                map.put(temp,1);
            }

        } String temp = sc.next(); temp sc.next() sc.next sc if(map.containsKey(temp)){
                int value = map.get(temp) + 1;
                map.put(temp , value);
                if(value > max){
                    max = value;
                }

            }else{
                map.put(temp,1);
            } map.containsKey(temp) map.containsKey map temp {
                int value = map.get(temp) + 1;
                map.put(temp , value);
                if(value > max){
                    max = value;
                }

            } int value = map.get(temp) + 1; value map.get(temp) + 1 map.get(temp) map.get map temp 1 map.put(temp , value) map.put map temp value if(value > max){
                    max = value;
                } value > max value max {
                    max = value;
                } max = value max value {
                map.put(temp,1);
            } map.put(temp,1) map.put map temp 1 List maxstr = new ArrayList<String>(); maxstr new ArrayList<String>() for (String key: map.keySet()) {
            if(map.get(key) == max){
                maxstr.add(key);
            }
        } String key map.keySet() map.keySet map {
            if(map.get(key) == max){
                maxstr.add(key);
            }
        } {
            if(map.get(key) == max){
                maxstr.add(key);
            }
        } if(map.get(key) == max){
                maxstr.add(key);
            } map.get(key) == max map.get(key) map.get map key max {
                maxstr.add(key);
            } maxstr.add(key) maxstr.add maxstr key Collections.sort(maxstr) Collections.sort Collections maxstr for(int i=0;i<maxstr.size();i++){
            System.out.println(maxstr.get(i));
        } int i=0; int i=0; i 0 i<maxstr.size() i maxstr.size() maxstr.size maxstr i++ i++ i {
            System.out.println(maxstr.get(i));
        } {
            System.out.println(maxstr.get(i));
        } System.out.println(maxstr.get(i)) System.out.println System.out System System.out maxstr.get(i) maxstr.get maxstr i String[] args args public class Main {

    public static void main(String[] args) {
        // write your code here
        Scanner sc=new Scanner(System.in);
        int N=sc.nextInt();
        Map<String,Integer> map = new HashMap<String,Integer>();
        int max = 1;
        for(int i=0;i<N;i++){
            String temp = sc.next();
            if(map.containsKey(temp)){
                int value = map.get(temp) + 1;
                map.put(temp , value);
                if(value > max){
                    max = value;
                }

            }else{
                map.put(temp,1);
            }

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

        Collections.sort(maxstr);

        for(int i=0;i<maxstr.size();i++){
            System.out.println(maxstr.get(i));
        }

    }
} public class Main {

    public static void main(String[] args) {
        // write your code here
        Scanner sc=new Scanner(System.in);
        int N=sc.nextInt();
        Map<String,Integer> map = new HashMap<String,Integer>();
        int max = 1;
        for(int i=0;i<N;i++){
            String temp = sc.next();
            if(map.containsKey(temp)){
                int value = map.get(temp) + 1;
                map.put(temp , value);
                if(value > max){
                    max = value;
                }

            }else{
                map.put(temp,1);
            }

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

        Collections.sort(maxstr);

        for(int i=0;i<maxstr.size();i++){
            System.out.println(maxstr.get(i));
        }

    }
} Main
import java.util.*;

public class Main {

    public static void main(String[] args) {
        // write your code here
        Scanner sc=new Scanner(System.in);
        int N=sc.nextInt();
        Map<String,Integer> map = new HashMap<String,Integer>();
        int max = 1;
        for(int i=0;i<N;i++){
            String temp = sc.next();
            if(map.containsKey(temp)){
                int value = map.get(temp) + 1;
                map.put(temp , value);
                if(value > max){
                    max = value;
                }

            }else{
                map.put(temp,1);
            }

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

        Collections.sort(maxstr);

        for(int i=0;i<maxstr.size();i++){
            System.out.println(maxstr.get(i));
        }

    }
}
