import java.util.Scanner;
import java.util.HashMap;
import java.util.List;
import java.util.ArrayList;
import java.util.Map.Entry;
import java.util.Comparator;

public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        String[] S = new String[N];
        for(int i = 0; i < N; i++){
            S[i] = sc.next();
        }
        sc.close();
        HashMap<String, Integer> mp = new HashMap<>();
        for(int i = 0; i < N; i++){
            mp.put(S[i], mp.getOrDefault(S[i], 0) + 1);
        }
        List<String> res = new ArrayList<>();
        int max_val = 0;
        for(Entry<String, Integer> e: mp.entrySet()){
            max_val = Math.max(max_val, e.getValue());
        }

        for(Entry<String, Integer> e: mp.entrySet()){
            if(max_val == e.getValue()){
                res.add(e.getKey());
            }
        }
        res.sort(Comparator.naturalOrder());
        for(String s: res){
            System.out.println(s);
        }




    }
} import java.util.Scanner; Scanner java.util import java.util.HashMap; HashMap java.util import java.util.List; List java.util import java.util.ArrayList; ArrayList java.util import java.util.Map.Entry; Entry java.util.Map import java.util.Comparator; Comparator java.util public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        String[] S = new String[N];
        for(int i = 0; i < N; i++){
            S[i] = sc.next();
        }
        sc.close();
        HashMap<String, Integer> mp = new HashMap<>();
        for(int i = 0; i < N; i++){
            mp.put(S[i], mp.getOrDefault(S[i], 0) + 1);
        }
        List<String> res = new ArrayList<>();
        int max_val = 0;
        for(Entry<String, Integer> e: mp.entrySet()){
            max_val = Math.max(max_val, e.getValue());
        }

        for(Entry<String, Integer> e: mp.entrySet()){
            if(max_val == e.getValue()){
                res.add(e.getKey());
            }
        }
        res.sort(Comparator.naturalOrder());
        for(String s: res){
            System.out.println(s);
        }




    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        String[] S = new String[N];
        for(int i = 0; i < N; i++){
            S[i] = sc.next();
        }
        sc.close();
        HashMap<String, Integer> mp = new HashMap<>();
        for(int i = 0; i < N; i++){
            mp.put(S[i], mp.getOrDefault(S[i], 0) + 1);
        }
        List<String> res = new ArrayList<>();
        int max_val = 0;
        for(Entry<String, Integer> e: mp.entrySet()){
            max_val = Math.max(max_val, e.getValue());
        }

        for(Entry<String, Integer> e: mp.entrySet()){
            if(max_val == e.getValue()){
                res.add(e.getKey());
            }
        }
        res.sort(Comparator.naturalOrder());
        for(String s: res){
            System.out.println(s);
        }




    } main {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        String[] S = new String[N];
        for(int i = 0; i < N; i++){
            S[i] = sc.next();
        }
        sc.close();
        HashMap<String, Integer> mp = new HashMap<>();
        for(int i = 0; i < N; i++){
            mp.put(S[i], mp.getOrDefault(S[i], 0) + 1);
        }
        List<String> res = new ArrayList<>();
        int max_val = 0;
        for(Entry<String, Integer> e: mp.entrySet()){
            max_val = Math.max(max_val, e.getValue());
        }

        for(Entry<String, Integer> e: mp.entrySet()){
            if(max_val == e.getValue()){
                res.add(e.getKey());
            }
        }
        res.sort(Comparator.naturalOrder());
        for(String s: res){
            System.out.println(s);
        }




    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc String[] S = new String[N]; S new String[N] N for(int i = 0; i < N; i++){
            S[i] = sc.next();
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            S[i] = sc.next();
        } {
            S[i] = sc.next();
        } S[i] = sc.next() S[i] S i sc.next() sc.next sc sc.close() sc.close sc HashMap<String, Integer> mp = new HashMap<>(); mp new HashMap<>() for(int i = 0; i < N; i++){
            mp.put(S[i], mp.getOrDefault(S[i], 0) + 1);
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
            mp.put(S[i], mp.getOrDefault(S[i], 0) + 1);
        } {
            mp.put(S[i], mp.getOrDefault(S[i], 0) + 1);
        } mp.put(S[i], mp.getOrDefault(S[i], 0) + 1) mp.put mp S[i] S i mp.getOrDefault(S[i], 0) + 1 mp.getOrDefault(S[i], 0) mp.getOrDefault mp S[i] S i 0 1 List<String> res = new ArrayList<>(); res new ArrayList<>() int max_val = 0; max_val 0 for(Entry<String, Integer> e: mp.entrySet()){
            max_val = Math.max(max_val, e.getValue());
        } Entry<String, Integer> e mp.entrySet() mp.entrySet mp {
            max_val = Math.max(max_val, e.getValue());
        } {
            max_val = Math.max(max_val, e.getValue());
        } max_val = Math.max(max_val, e.getValue()) max_val Math.max(max_val, e.getValue()) Math.max Math max_val e.getValue() e.getValue e for(Entry<String, Integer> e: mp.entrySet()){
            if(max_val == e.getValue()){
                res.add(e.getKey());
            }
        } Entry<String, Integer> e mp.entrySet() mp.entrySet mp {
            if(max_val == e.getValue()){
                res.add(e.getKey());
            }
        } {
            if(max_val == e.getValue()){
                res.add(e.getKey());
            }
        } if(max_val == e.getValue()){
                res.add(e.getKey());
            } max_val == e.getValue() max_val e.getValue() e.getValue e {
                res.add(e.getKey());
            } res.add(e.getKey()) res.add res e.getKey() e.getKey e res.sort(Comparator.naturalOrder()) res.sort res Comparator.naturalOrder() Comparator.naturalOrder Comparator for(String s: res){
            System.out.println(s);
        } String s res {
            System.out.println(s);
        } {
            System.out.println(s);
        } System.out.println(s) System.out.println System.out System System.out s String[] args args public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        String[] S = new String[N];
        for(int i = 0; i < N; i++){
            S[i] = sc.next();
        }
        sc.close();
        HashMap<String, Integer> mp = new HashMap<>();
        for(int i = 0; i < N; i++){
            mp.put(S[i], mp.getOrDefault(S[i], 0) + 1);
        }
        List<String> res = new ArrayList<>();
        int max_val = 0;
        for(Entry<String, Integer> e: mp.entrySet()){
            max_val = Math.max(max_val, e.getValue());
        }

        for(Entry<String, Integer> e: mp.entrySet()){
            if(max_val == e.getValue()){
                res.add(e.getKey());
            }
        }
        res.sort(Comparator.naturalOrder());
        for(String s: res){
            System.out.println(s);
        }




    }
} public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        String[] S = new String[N];
        for(int i = 0; i < N; i++){
            S[i] = sc.next();
        }
        sc.close();
        HashMap<String, Integer> mp = new HashMap<>();
        for(int i = 0; i < N; i++){
            mp.put(S[i], mp.getOrDefault(S[i], 0) + 1);
        }
        List<String> res = new ArrayList<>();
        int max_val = 0;
        for(Entry<String, Integer> e: mp.entrySet()){
            max_val = Math.max(max_val, e.getValue());
        }

        for(Entry<String, Integer> e: mp.entrySet()){
            if(max_val == e.getValue()){
                res.add(e.getKey());
            }
        }
        res.sort(Comparator.naturalOrder());
        for(String s: res){
            System.out.println(s);
        }




    }
} Main
import java.util.Scanner;
import java.util.HashMap;
import java.util.List;
import java.util.ArrayList;
import java.util.Map.Entry;
import java.util.Comparator;

public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        String[] S = new String[N];
        for(int i = 0; i < N; i++){
            S[i] = sc.next();
        }
        sc.close();
        HashMap<String, Integer> mp = new HashMap<>();
        for(int i = 0; i < N; i++){
            mp.put(S[i], mp.getOrDefault(S[i], 0) + 1);
        }
        List<String> res = new ArrayList<>();
        int max_val = 0;
        for(Entry<String, Integer> e: mp.entrySet()){
            max_val = Math.max(max_val, e.getValue());
        }

        for(Entry<String, Integer> e: mp.entrySet()){
            if(max_val == e.getValue()){
                res.add(e.getKey());
            }
        }
        res.sort(Comparator.naturalOrder());
        for(String s: res){
            System.out.println(s);
        }




    }
}