
import java.util.*;


class Main {
    public static void main(String args[]) {
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        HashMap<String ,Integer> m=new HashMap<>();
        int max=-1;
        for (int i = 0; i <n ; i++) {
            String key=s.next();
            int now=m.getOrDefault(key,0)+1;
            if(max<now){
                max=now;
            }
            m.put(key,now);
        }
        Set<String > set=new TreeSet();
        for(Map.Entry<String,Integer> p: m.entrySet()){
            if(p.getValue()==max){
                set.add(p.getKey());
            }
        }
        for (String jj:set){
            System.out.println(jj);
        }

    }
    public static void main2(String args[]) {
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        int[] a=new int[n];
        for (int i = 0; i <n ; i++) {
            a[i]=s.nextInt();
        }
        String ret="APPROVED";
        for (int i = 0; i < n; i++) {
            if(a[i]%2==0&&(a[i]%3!=0&&a[i]%5!=0)){
                ret="DENIED";
                break;
            }

        }

        System.out.println(ret);

    }
} import java.util.*; util.* java class Main {
    public static void main(String args[]) {
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        HashMap<String ,Integer> m=new HashMap<>();
        int max=-1;
        for (int i = 0; i <n ; i++) {
            String key=s.next();
            int now=m.getOrDefault(key,0)+1;
            if(max<now){
                max=now;
            }
            m.put(key,now);
        }
        Set<String > set=new TreeSet();
        for(Map.Entry<String,Integer> p: m.entrySet()){
            if(p.getValue()==max){
                set.add(p.getKey());
            }
        }
        for (String jj:set){
            System.out.println(jj);
        }

    }
    public static void main2(String args[]) {
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        int[] a=new int[n];
        for (int i = 0; i <n ; i++) {
            a[i]=s.nextInt();
        }
        String ret="APPROVED";
        for (int i = 0; i < n; i++) {
            if(a[i]%2==0&&(a[i]%3!=0&&a[i]%5!=0)){
                ret="DENIED";
                break;
            }

        }

        System.out.println(ret);

    }
} Main public static void main(String args[]) {
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        HashMap<String ,Integer> m=new HashMap<>();
        int max=-1;
        for (int i = 0; i <n ; i++) {
            String key=s.next();
            int now=m.getOrDefault(key,0)+1;
            if(max<now){
                max=now;
            }
            m.put(key,now);
        }
        Set<String > set=new TreeSet();
        for(Map.Entry<String,Integer> p: m.entrySet()){
            if(p.getValue()==max){
                set.add(p.getKey());
            }
        }
        for (String jj:set){
            System.out.println(jj);
        }

    } main {
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        HashMap<String ,Integer> m=new HashMap<>();
        int max=-1;
        for (int i = 0; i <n ; i++) {
            String key=s.next();
            int now=m.getOrDefault(key,0)+1;
            if(max<now){
                max=now;
            }
            m.put(key,now);
        }
        Set<String > set=new TreeSet();
        for(Map.Entry<String,Integer> p: m.entrySet()){
            if(p.getValue()==max){
                set.add(p.getKey());
            }
        }
        for (String jj:set){
            System.out.println(jj);
        }

    } Scanner s = new Scanner(System.in); s new Scanner(System.in) int n = s.nextInt(); n s.nextInt() s.nextInt s HashMap<String ,Integer> m=new HashMap<>(); m new HashMap<>() int max=-1; max -1 1 for (int i = 0; i <n ; i++) {
            String key=s.next();
            int now=m.getOrDefault(key,0)+1;
            if(max<now){
                max=now;
            }
            m.put(key,now);
        } int i = 0; int i = 0; i 0 i <n i n i++ i++ i {
            String key=s.next();
            int now=m.getOrDefault(key,0)+1;
            if(max<now){
                max=now;
            }
            m.put(key,now);
        } {
            String key=s.next();
            int now=m.getOrDefault(key,0)+1;
            if(max<now){
                max=now;
            }
            m.put(key,now);
        } String key=s.next(); key s.next() s.next s int now=m.getOrDefault(key,0)+1; now m.getOrDefault(key,0)+1 m.getOrDefault(key,0) m.getOrDefault m key 0 1 if(max<now){
                max=now;
            } max<now max now {
                max=now;
            } max=now max now m.put(key,now) m.put m key now Set<String > set=new TreeSet(); set new TreeSet() for(Map.Entry<String,Integer> p: m.entrySet()){
            if(p.getValue()==max){
                set.add(p.getKey());
            }
        } Map.Entry<String,Integer> p m.entrySet() m.entrySet m {
            if(p.getValue()==max){
                set.add(p.getKey());
            }
        } {
            if(p.getValue()==max){
                set.add(p.getKey());
            }
        } if(p.getValue()==max){
                set.add(p.getKey());
            } p.getValue()==max p.getValue() p.getValue p max {
                set.add(p.getKey());
            } set.add(p.getKey()) set.add set p.getKey() p.getKey p for (String jj:set){
            System.out.println(jj);
        } String jj set {
            System.out.println(jj);
        } {
            System.out.println(jj);
        } System.out.println(jj) System.out.println System.out System System.out jj String args[] args public static void main2(String args[]) {
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        int[] a=new int[n];
        for (int i = 0; i <n ; i++) {
            a[i]=s.nextInt();
        }
        String ret="APPROVED";
        for (int i = 0; i < n; i++) {
            if(a[i]%2==0&&(a[i]%3!=0&&a[i]%5!=0)){
                ret="DENIED";
                break;
            }

        }

        System.out.println(ret);

    } main2 {
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        int[] a=new int[n];
        for (int i = 0; i <n ; i++) {
            a[i]=s.nextInt();
        }
        String ret="APPROVED";
        for (int i = 0; i < n; i++) {
            if(a[i]%2==0&&(a[i]%3!=0&&a[i]%5!=0)){
                ret="DENIED";
                break;
            }

        }

        System.out.println(ret);

    } Scanner s = new Scanner(System.in); s new Scanner(System.in) int n = s.nextInt(); n s.nextInt() s.nextInt s int[] a=new int[n]; a new int[n] n for (int i = 0; i <n ; i++) {
            a[i]=s.nextInt();
        } int i = 0; int i = 0; i 0 i <n i n i++ i++ i {
            a[i]=s.nextInt();
        } {
            a[i]=s.nextInt();
        } a[i]=s.nextInt() a[i] a i s.nextInt() s.nextInt s String ret="APPROVED"; ret "APPROVED" for (int i = 0; i < n; i++) {
            if(a[i]%2==0&&(a[i]%3!=0&&a[i]%5!=0)){
                ret="DENIED";
                break;
            }

        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            if(a[i]%2==0&&(a[i]%3!=0&&a[i]%5!=0)){
                ret="DENIED";
                break;
            }

        } {
            if(a[i]%2==0&&(a[i]%3!=0&&a[i]%5!=0)){
                ret="DENIED";
                break;
            }

        } if(a[i]%2==0&&(a[i]%3!=0&&a[i]%5!=0)){
                ret="DENIED";
                break;
            } a[i]%2==0&&(a[i]%3!=0&&a[i]%5!=0) a[i]%2==0 a[i]%2 a[i] a i 2 0 (a[i]%3!=0&&a[i]%5!=0) a[i]%3!=0 a[i]%3 a[i] a i 3 0 a[i]%5!=0 a[i]%5 a[i] a i 5 0 {
                ret="DENIED";
                break;
            } ret="DENIED" ret "DENIED" break; System.out.println(ret) System.out.println System.out System System.out ret String args[] args

import java.util.*;


class Main {
    public static void main(String args[]) {
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        HashMap<String ,Integer> m=new HashMap<>();
        int max=-1;
        for (int i = 0; i <n ; i++) {
            String key=s.next();
            int now=m.getOrDefault(key,0)+1;
            if(max<now){
                max=now;
            }
            m.put(key,now);
        }
        Set<String > set=new TreeSet();
        for(Map.Entry<String,Integer> p: m.entrySet()){
            if(p.getValue()==max){
                set.add(p.getKey());
            }
        }
        for (String jj:set){
            System.out.println(jj);
        }

    }
    public static void main2(String args[]) {
        Scanner s = new Scanner(System.in);
        int n = s.nextInt();
        int[] a=new int[n];
        for (int i = 0; i <n ; i++) {
            a[i]=s.nextInt();
        }
        String ret="APPROVED";
        for (int i = 0; i < n; i++) {
            if(a[i]%2==0&&(a[i]%3!=0&&a[i]%5!=0)){
                ret="DENIED";
                break;
            }

        }

        System.out.println(ret);

    }
}