import java.util.*;

public class Main {
    public static void main(String[] args) {
        int N;
        String[] Si = null;
        try (Scanner sc = new Scanner(System.in)) {
            N = sc.nextInt();
            Si = new String[N];
            for (int i = 0; i < N; i++) {
                Si[i] = sc.next();
            }
        }
        Map<String,Integer> map = new HashMap<>(N);
        int max =0;
        for(String s : Si){
            int i = map.getOrDefault(s,0);
            map.put(s,++i);
            if(max < i){
                max = i;
            }
        }
        List<String> list = new LinkedList<>();
        for(Map.Entry<String,Integer> entry : map.entrySet()){
            if (entry.getValue() == max){
                list.add(entry.getKey());
            }
        }
        String[] resultArr = new String[list.size()];
        list.toArray(resultArr);
        Arrays.sort(resultArr);
        for (int i = 0; i < resultArr.length; i++) {
            System.out.println(resultArr[i]);
        }
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        int N;
        String[] Si = null;
        try (Scanner sc = new Scanner(System.in)) {
            N = sc.nextInt();
            Si = new String[N];
            for (int i = 0; i < N; i++) {
                Si[i] = sc.next();
            }
        }
        Map<String,Integer> map = new HashMap<>(N);
        int max =0;
        for(String s : Si){
            int i = map.getOrDefault(s,0);
            map.put(s,++i);
            if(max < i){
                max = i;
            }
        }
        List<String> list = new LinkedList<>();
        for(Map.Entry<String,Integer> entry : map.entrySet()){
            if (entry.getValue() == max){
                list.add(entry.getKey());
            }
        }
        String[] resultArr = new String[list.size()];
        list.toArray(resultArr);
        Arrays.sort(resultArr);
        for (int i = 0; i < resultArr.length; i++) {
            System.out.println(resultArr[i]);
        }
    }
} Main public static void main(String[] args) {
        int N;
        String[] Si = null;
        try (Scanner sc = new Scanner(System.in)) {
            N = sc.nextInt();
            Si = new String[N];
            for (int i = 0; i < N; i++) {
                Si[i] = sc.next();
            }
        }
        Map<String,Integer> map = new HashMap<>(N);
        int max =0;
        for(String s : Si){
            int i = map.getOrDefault(s,0);
            map.put(s,++i);
            if(max < i){
                max = i;
            }
        }
        List<String> list = new LinkedList<>();
        for(Map.Entry<String,Integer> entry : map.entrySet()){
            if (entry.getValue() == max){
                list.add(entry.getKey());
            }
        }
        String[] resultArr = new String[list.size()];
        list.toArray(resultArr);
        Arrays.sort(resultArr);
        for (int i = 0; i < resultArr.length; i++) {
            System.out.println(resultArr[i]);
        }
    } main {
        int N;
        String[] Si = null;
        try (Scanner sc = new Scanner(System.in)) {
            N = sc.nextInt();
            Si = new String[N];
            for (int i = 0; i < N; i++) {
                Si[i] = sc.next();
            }
        }
        Map<String,Integer> map = new HashMap<>(N);
        int max =0;
        for(String s : Si){
            int i = map.getOrDefault(s,0);
            map.put(s,++i);
            if(max < i){
                max = i;
            }
        }
        List<String> list = new LinkedList<>();
        for(Map.Entry<String,Integer> entry : map.entrySet()){
            if (entry.getValue() == max){
                list.add(entry.getKey());
            }
        }
        String[] resultArr = new String[list.size()];
        list.toArray(resultArr);
        Arrays.sort(resultArr);
        for (int i = 0; i < resultArr.length; i++) {
            System.out.println(resultArr[i]);
        }
    } int N; N String[] Si = null; Si null try (Scanner sc = new Scanner(System.in)) {
            N = sc.nextInt();
            Si = new String[N];
            for (int i = 0; i < N; i++) {
                Si[i] = sc.next();
            }
        } {
            N = sc.nextInt();
            Si = new String[N];
            for (int i = 0; i < N; i++) {
                Si[i] = sc.next();
            }
        } Scanner sc = new Scanner(System.in) Scanner sc = new Scanner(System.in) new Scanner(System.in) N = sc.nextInt() N sc.nextInt() sc.nextInt sc Si = new String[N] Si new String[N] N for (int i = 0; i < N; i++) {
                Si[i] = sc.next();
            } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
                Si[i] = sc.next();
            } {
                Si[i] = sc.next();
            } Si[i] = sc.next() Si[i] Si i sc.next() sc.next sc Map<String,Integer> map = new HashMap<>(N); map new HashMap<>(N) int max =0; max 0 for(String s : Si){
            int i = map.getOrDefault(s,0);
            map.put(s,++i);
            if(max < i){
                max = i;
            }
        } String s Si {
            int i = map.getOrDefault(s,0);
            map.put(s,++i);
            if(max < i){
                max = i;
            }
        } {
            int i = map.getOrDefault(s,0);
            map.put(s,++i);
            if(max < i){
                max = i;
            }
        } int i = map.getOrDefault(s,0); i map.getOrDefault(s,0) map.getOrDefault map s 0 map.put(s,++i) map.put map s ++i i if(max < i){
                max = i;
            } max < i max i {
                max = i;
            } max = i max i List<String> list = new LinkedList<>(); list new LinkedList<>() for(Map.Entry<String,Integer> entry : map.entrySet()){
            if (entry.getValue() == max){
                list.add(entry.getKey());
            }
        } Map.Entry<String,Integer> entry map.entrySet() map.entrySet map {
            if (entry.getValue() == max){
                list.add(entry.getKey());
            }
        } {
            if (entry.getValue() == max){
                list.add(entry.getKey());
            }
        } if (entry.getValue() == max){
                list.add(entry.getKey());
            } entry.getValue() == max entry.getValue() entry.getValue entry max {
                list.add(entry.getKey());
            } list.add(entry.getKey()) list.add list entry.getKey() entry.getKey entry String[] resultArr = new String[list.size()]; resultArr new String[list.size()] list.size() list.size list list.toArray(resultArr) list.toArray list resultArr Arrays.sort(resultArr) Arrays.sort Arrays resultArr for (int i = 0; i < resultArr.length; i++) {
            System.out.println(resultArr[i]);
        } int i = 0; int i = 0; i 0 i < resultArr.length i resultArr.length resultArr resultArr.length i++ i++ i {
            System.out.println(resultArr[i]);
        } {
            System.out.println(resultArr[i]);
        } System.out.println(resultArr[i]) System.out.println System.out System System.out resultArr[i] resultArr i String[] args args public class Main {
    public static void main(String[] args) {
        int N;
        String[] Si = null;
        try (Scanner sc = new Scanner(System.in)) {
            N = sc.nextInt();
            Si = new String[N];
            for (int i = 0; i < N; i++) {
                Si[i] = sc.next();
            }
        }
        Map<String,Integer> map = new HashMap<>(N);
        int max =0;
        for(String s : Si){
            int i = map.getOrDefault(s,0);
            map.put(s,++i);
            if(max < i){
                max = i;
            }
        }
        List<String> list = new LinkedList<>();
        for(Map.Entry<String,Integer> entry : map.entrySet()){
            if (entry.getValue() == max){
                list.add(entry.getKey());
            }
        }
        String[] resultArr = new String[list.size()];
        list.toArray(resultArr);
        Arrays.sort(resultArr);
        for (int i = 0; i < resultArr.length; i++) {
            System.out.println(resultArr[i]);
        }
    }
} public class Main {
    public static void main(String[] args) {
        int N;
        String[] Si = null;
        try (Scanner sc = new Scanner(System.in)) {
            N = sc.nextInt();
            Si = new String[N];
            for (int i = 0; i < N; i++) {
                Si[i] = sc.next();
            }
        }
        Map<String,Integer> map = new HashMap<>(N);
        int max =0;
        for(String s : Si){
            int i = map.getOrDefault(s,0);
            map.put(s,++i);
            if(max < i){
                max = i;
            }
        }
        List<String> list = new LinkedList<>();
        for(Map.Entry<String,Integer> entry : map.entrySet()){
            if (entry.getValue() == max){
                list.add(entry.getKey());
            }
        }
        String[] resultArr = new String[list.size()];
        list.toArray(resultArr);
        Arrays.sort(resultArr);
        for (int i = 0; i < resultArr.length; i++) {
            System.out.println(resultArr[i]);
        }
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) {
        int N;
        String[] Si = null;
        try (Scanner sc = new Scanner(System.in)) {
            N = sc.nextInt();
            Si = new String[N];
            for (int i = 0; i < N; i++) {
                Si[i] = sc.next();
            }
        }
        Map<String,Integer> map = new HashMap<>(N);
        int max =0;
        for(String s : Si){
            int i = map.getOrDefault(s,0);
            map.put(s,++i);
            if(max < i){
                max = i;
            }
        }
        List<String> list = new LinkedList<>();
        for(Map.Entry<String,Integer> entry : map.entrySet()){
            if (entry.getValue() == max){
                list.add(entry.getKey());
            }
        }
        String[] resultArr = new String[list.size()];
        list.toArray(resultArr);
        Arrays.sort(resultArr);
        for (int i = 0; i < resultArr.length; i++) {
            System.out.println(resultArr[i]);
        }
    }
}
