import java.util.*;
import java.util.Map.Entry;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Map<String, Integer> map = new HashMap<>();
        int max = 0;
        for (int i = 0; i < n; i++) {
            String s = sc.next();
            if(!map.containsKey(s)) map.put(s, 0);
            map.put(s, map.get(s) + 1);
            if(max < map.get(s)) max = map.get(s);
        }
        List<String> list = new ArrayList<String>();
        for(Entry<String, Integer> e : map.entrySet()){
            if(e.getValue().equals(max)) list.add(e.getKey());
        }
        Collections.sort(list);
        for(String a : list) System.out.println(a);
        sc.close();

    }

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

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Map<String, Integer> map = new HashMap<>();
        int max = 0;
        for (int i = 0; i < n; i++) {
            String s = sc.next();
            if(!map.containsKey(s)) map.put(s, 0);
            map.put(s, map.get(s) + 1);
            if(max < map.get(s)) max = map.get(s);
        }
        List<String> list = new ArrayList<String>();
        for(Entry<String, Integer> e : map.entrySet()){
            if(e.getValue().equals(max)) list.add(e.getKey());
        }
        Collections.sort(list);
        for(String a : list) System.out.println(a);
        sc.close();

    }

} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Map<String, Integer> map = new HashMap<>();
        int max = 0;
        for (int i = 0; i < n; i++) {
            String s = sc.next();
            if(!map.containsKey(s)) map.put(s, 0);
            map.put(s, map.get(s) + 1);
            if(max < map.get(s)) max = map.get(s);
        }
        List<String> list = new ArrayList<String>();
        for(Entry<String, Integer> e : map.entrySet()){
            if(e.getValue().equals(max)) list.add(e.getKey());
        }
        Collections.sort(list);
        for(String a : list) System.out.println(a);
        sc.close();

    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Map<String, Integer> map = new HashMap<>();
        int max = 0;
        for (int i = 0; i < n; i++) {
            String s = sc.next();
            if(!map.containsKey(s)) map.put(s, 0);
            map.put(s, map.get(s) + 1);
            if(max < map.get(s)) max = map.get(s);
        }
        List<String> list = new ArrayList<String>();
        for(Entry<String, Integer> e : map.entrySet()){
            if(e.getValue().equals(max)) list.add(e.getKey());
        }
        Collections.sort(list);
        for(String a : list) System.out.println(a);
        sc.close();

    } 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<>(); map new HashMap<>() int max = 0; max 0 for (int i = 0; i < n; i++) {
            String s = sc.next();
            if(!map.containsKey(s)) map.put(s, 0);
            map.put(s, map.get(s) + 1);
            if(max < map.get(s)) max = map.get(s);
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            String s = sc.next();
            if(!map.containsKey(s)) map.put(s, 0);
            map.put(s, map.get(s) + 1);
            if(max < map.get(s)) max = map.get(s);
        } {
            String s = sc.next();
            if(!map.containsKey(s)) map.put(s, 0);
            map.put(s, map.get(s) + 1);
            if(max < map.get(s)) max = map.get(s);
        } String s = sc.next(); s sc.next() sc.next sc if(!map.containsKey(s)) map.put(s, 0); !map.containsKey(s) map.containsKey(s) map.containsKey map s map.put(s, 0) map.put map s 0 map.put(s, map.get(s) + 1) map.put map s map.get(s) + 1 map.get(s) map.get map s 1 if(max < map.get(s)) max = map.get(s); max < map.get(s) max map.get(s) map.get map s max = map.get(s) max map.get(s) map.get map s List<String> list = new ArrayList<String>(); list new ArrayList<String>() for(Entry<String, Integer> e : map.entrySet()){
            if(e.getValue().equals(max)) list.add(e.getKey());
        } Entry<String, Integer> e map.entrySet() map.entrySet map {
            if(e.getValue().equals(max)) list.add(e.getKey());
        } {
            if(e.getValue().equals(max)) list.add(e.getKey());
        } if(e.getValue().equals(max)) list.add(e.getKey()); e.getValue().equals(max) e.getValue().equals e.getValue() e.getValue e max list.add(e.getKey()) list.add list e.getKey() e.getKey e Collections.sort(list) Collections.sort Collections list for(String a : list) System.out.println(a); String a list System.out.println(a); System.out.println(a) System.out.println System.out System System.out a sc.close() sc.close sc String[] args args public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Map<String, Integer> map = new HashMap<>();
        int max = 0;
        for (int i = 0; i < n; i++) {
            String s = sc.next();
            if(!map.containsKey(s)) map.put(s, 0);
            map.put(s, map.get(s) + 1);
            if(max < map.get(s)) max = map.get(s);
        }
        List<String> list = new ArrayList<String>();
        for(Entry<String, Integer> e : map.entrySet()){
            if(e.getValue().equals(max)) list.add(e.getKey());
        }
        Collections.sort(list);
        for(String a : list) System.out.println(a);
        sc.close();

    }

} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Map<String, Integer> map = new HashMap<>();
        int max = 0;
        for (int i = 0; i < n; i++) {
            String s = sc.next();
            if(!map.containsKey(s)) map.put(s, 0);
            map.put(s, map.get(s) + 1);
            if(max < map.get(s)) max = map.get(s);
        }
        List<String> list = new ArrayList<String>();
        for(Entry<String, Integer> e : map.entrySet()){
            if(e.getValue().equals(max)) list.add(e.getKey());
        }
        Collections.sort(list);
        for(String a : list) System.out.println(a);
        sc.close();

    }

} Main
import java.util.*;
import java.util.Map.Entry;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Map<String, Integer> map = new HashMap<>();
        int max = 0;
        for (int i = 0; i < n; i++) {
            String s = sc.next();
            if(!map.containsKey(s)) map.put(s, 0);
            map.put(s, map.get(s) + 1);
            if(max < map.get(s)) max = map.get(s);
        }
        List<String> list = new ArrayList<String>();
        for(Entry<String, Integer> e : map.entrySet()){
            if(e.getValue().equals(max)) list.add(e.getKey());
        }
        Collections.sort(list);
        for(String a : list) System.out.println(a);
        sc.close();

    }

}
