import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Scanner;
import java.util.TreeMap;

public class Main {

    public static void main(String[] args) {
        @SuppressWarnings("resource")
        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();
        }
        Map<String, Integer> map = new TreeMap<String, Integer>();
        for (int i = 0 ; i < n ; i++) {
            if (map.containsKey(s[i])) {
                map.put(s[i], map.get(s[i]) + 1);
            } else {
                map.put(s[i], 1);
            }
        }

        int min = 0;
        for (Entry<String, Integer> entry : map.entrySet() ) {
            min = Math.max(min, entry.getValue());
        }

        List<String> list = new ArrayList<String>();
        for (Entry<String, Integer> entry : map.entrySet() ) {
            if (entry.getValue() == min) {
                list.add(entry.getKey());
            }
        }

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


    }

} import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections java.util import java.util.List; List java.util import java.util.Map; Map java.util import java.util.Map.Entry; Entry java.util.Map import java.util.Scanner; Scanner java.util import java.util.TreeMap; TreeMap java.util public class Main {

    public static void main(String[] args) {
        @SuppressWarnings("resource")
        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();
        }
        Map<String, Integer> map = new TreeMap<String, Integer>();
        for (int i = 0 ; i < n ; i++) {
            if (map.containsKey(s[i])) {
                map.put(s[i], map.get(s[i]) + 1);
            } else {
                map.put(s[i], 1);
            }
        }

        int min = 0;
        for (Entry<String, Integer> entry : map.entrySet() ) {
            min = Math.max(min, entry.getValue());
        }

        List<String> list = new ArrayList<String>();
        for (Entry<String, Integer> entry : map.entrySet() ) {
            if (entry.getValue() == min) {
                list.add(entry.getKey());
            }
        }

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


    }

} Main public static void main(String[] args) {
        @SuppressWarnings("resource")
        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();
        }
        Map<String, Integer> map = new TreeMap<String, Integer>();
        for (int i = 0 ; i < n ; i++) {
            if (map.containsKey(s[i])) {
                map.put(s[i], map.get(s[i]) + 1);
            } else {
                map.put(s[i], 1);
            }
        }

        int min = 0;
        for (Entry<String, Integer> entry : map.entrySet() ) {
            min = Math.max(min, entry.getValue());
        }

        List<String> list = new ArrayList<String>();
        for (Entry<String, Integer> entry : map.entrySet() ) {
            if (entry.getValue() == min) {
                list.add(entry.getKey());
            }
        }

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


    } main {
        @SuppressWarnings("resource")
        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();
        }
        Map<String, Integer> map = new TreeMap<String, Integer>();
        for (int i = 0 ; i < n ; i++) {
            if (map.containsKey(s[i])) {
                map.put(s[i], map.get(s[i]) + 1);
            } else {
                map.put(s[i], 1);
            }
        }

        int min = 0;
        for (Entry<String, Integer> entry : map.entrySet() ) {
            min = Math.max(min, entry.getValue());
        }

        List<String> list = new ArrayList<String>();
        for (Entry<String, Integer> entry : map.entrySet() ) {
            if (entry.getValue() == min) {
                list.add(entry.getKey());
            }
        }

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


    } @SuppressWarnings("resource")
        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 Map<String, Integer> map = new TreeMap<String, Integer>(); map new TreeMap<String, Integer>() for (int i = 0 ; i < n ; i++) {
            if (map.containsKey(s[i])) {
                map.put(s[i], map.get(s[i]) + 1);
            } else {
                map.put(s[i], 1);
            }
        } int i = 0 ; int i = 0 ; i 0 i < n i n i++ i++ i {
            if (map.containsKey(s[i])) {
                map.put(s[i], map.get(s[i]) + 1);
            } else {
                map.put(s[i], 1);
            }
        } {
            if (map.containsKey(s[i])) {
                map.put(s[i], map.get(s[i]) + 1);
            } else {
                map.put(s[i], 1);
            }
        } if (map.containsKey(s[i])) {
                map.put(s[i], map.get(s[i]) + 1);
            } else {
                map.put(s[i], 1);
            } map.containsKey(s[i]) map.containsKey map s[i] s i {
                map.put(s[i], map.get(s[i]) + 1);
            } map.put(s[i], map.get(s[i]) + 1) map.put map s[i] s i map.get(s[i]) + 1 map.get(s[i]) map.get map s[i] s i 1 {
                map.put(s[i], 1);
            } map.put(s[i], 1) map.put map s[i] s i 1 int min = 0; min 0 for (Entry<String, Integer> entry : map.entrySet() ) {
            min = Math.max(min, entry.getValue());
        } Entry<String, Integer> entry map.entrySet() map.entrySet map {
            min = Math.max(min, entry.getValue());
        } {
            min = Math.max(min, entry.getValue());
        } min = Math.max(min, entry.getValue()) min Math.max(min, entry.getValue()) Math.max Math min entry.getValue() entry.getValue entry List<String> list = new ArrayList<String>(); list new ArrayList<String>() for (Entry<String, Integer> entry : map.entrySet() ) {
            if (entry.getValue() == min) {
                list.add(entry.getKey());
            }
        } Entry<String, Integer> entry map.entrySet() map.entrySet map {
            if (entry.getValue() == min) {
                list.add(entry.getKey());
            }
        } {
            if (entry.getValue() == min) {
                list.add(entry.getKey());
            }
        } if (entry.getValue() == min) {
                list.add(entry.getKey());
            } entry.getValue() == min entry.getValue() entry.getValue entry min {
                list.add(entry.getKey());
            } list.add(entry.getKey()) list.add list entry.getKey() entry.getKey entry Collections.sort(list) Collections.sort Collections list for (int i = 0 ; i < list.size() ; i++) {
            System.out.println(list.get(i));
        } int i = 0 ; int i = 0 ; i 0 i < list.size() i list.size() list.size list i++ i++ i {
            System.out.println(list.get(i));
        } {
            System.out.println(list.get(i));
        } System.out.println(list.get(i)) System.out.println System.out System System.out list.get(i) list.get list i String[] args args public class Main {

    public static void main(String[] args) {
        @SuppressWarnings("resource")
        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();
        }
        Map<String, Integer> map = new TreeMap<String, Integer>();
        for (int i = 0 ; i < n ; i++) {
            if (map.containsKey(s[i])) {
                map.put(s[i], map.get(s[i]) + 1);
            } else {
                map.put(s[i], 1);
            }
        }

        int min = 0;
        for (Entry<String, Integer> entry : map.entrySet() ) {
            min = Math.max(min, entry.getValue());
        }

        List<String> list = new ArrayList<String>();
        for (Entry<String, Integer> entry : map.entrySet() ) {
            if (entry.getValue() == min) {
                list.add(entry.getKey());
            }
        }

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


    }

} public class Main {

    public static void main(String[] args) {
        @SuppressWarnings("resource")
        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();
        }
        Map<String, Integer> map = new TreeMap<String, Integer>();
        for (int i = 0 ; i < n ; i++) {
            if (map.containsKey(s[i])) {
                map.put(s[i], map.get(s[i]) + 1);
            } else {
                map.put(s[i], 1);
            }
        }

        int min = 0;
        for (Entry<String, Integer> entry : map.entrySet() ) {
            min = Math.max(min, entry.getValue());
        }

        List<String> list = new ArrayList<String>();
        for (Entry<String, Integer> entry : map.entrySet() ) {
            if (entry.getValue() == min) {
                list.add(entry.getKey());
            }
        }

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


    }

} Main
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Scanner;
import java.util.TreeMap;

public class Main {

    public static void main(String[] args) {
        @SuppressWarnings("resource")
        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();
        }
        Map<String, Integer> map = new TreeMap<String, Integer>();
        for (int i = 0 ; i < n ; i++) {
            if (map.containsKey(s[i])) {
                map.put(s[i], map.get(s[i]) + 1);
            } else {
                map.put(s[i], 1);
            }
        }

        int min = 0;
        for (Entry<String, Integer> entry : map.entrySet() ) {
            min = Math.max(min, entry.getValue());
        }

        List<String> list = new ArrayList<String>();
        for (Entry<String, Integer> entry : map.entrySet() ) {
            if (entry.getValue() == min) {
                list.add(entry.getKey());
            }
        }

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


    }

}