import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Map<String, Integer> m = new HashMap();
        for (int i = 0; i < n; i++) {
            String s = sc.next();
            if (m.get(s) != null) m.replace(s, m.get(s) + 1);
            else m.put(s, 1);
        }
        int max = 0;
        for (Integer val : m.values()) max = Math.max(max, val);
        ArrayList<String> al = new ArrayList();
        for (Map.Entry<String, Integer> e : m.entrySet()) {
            if (e.getValue() == max) al.add(e.getKey()); 
        }
        Collections.sort(al);
        for (String s : al) System.out.println(s);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Map<String, Integer> m = new HashMap();
        for (int i = 0; i < n; i++) {
            String s = sc.next();
            if (m.get(s) != null) m.replace(s, m.get(s) + 1);
            else m.put(s, 1);
        }
        int max = 0;
        for (Integer val : m.values()) max = Math.max(max, val);
        ArrayList<String> al = new ArrayList();
        for (Map.Entry<String, Integer> e : m.entrySet()) {
            if (e.getValue() == max) al.add(e.getKey()); 
        }
        Collections.sort(al);
        for (String s : al) System.out.println(s);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Map<String, Integer> m = new HashMap();
        for (int i = 0; i < n; i++) {
            String s = sc.next();
            if (m.get(s) != null) m.replace(s, m.get(s) + 1);
            else m.put(s, 1);
        }
        int max = 0;
        for (Integer val : m.values()) max = Math.max(max, val);
        ArrayList<String> al = new ArrayList();
        for (Map.Entry<String, Integer> e : m.entrySet()) {
            if (e.getValue() == max) al.add(e.getKey()); 
        }
        Collections.sort(al);
        for (String s : al) System.out.println(s);
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Map<String, Integer> m = new HashMap();
        for (int i = 0; i < n; i++) {
            String s = sc.next();
            if (m.get(s) != null) m.replace(s, m.get(s) + 1);
            else m.put(s, 1);
        }
        int max = 0;
        for (Integer val : m.values()) max = Math.max(max, val);
        ArrayList<String> al = new ArrayList();
        for (Map.Entry<String, Integer> e : m.entrySet()) {
            if (e.getValue() == max) al.add(e.getKey()); 
        }
        Collections.sort(al);
        for (String s : al) 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 Map<String, Integer> m = new HashMap(); m new HashMap() for (int i = 0; i < n; i++) {
            String s = sc.next();
            if (m.get(s) != null) m.replace(s, m.get(s) + 1);
            else m.put(s, 1);
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            String s = sc.next();
            if (m.get(s) != null) m.replace(s, m.get(s) + 1);
            else m.put(s, 1);
        } {
            String s = sc.next();
            if (m.get(s) != null) m.replace(s, m.get(s) + 1);
            else m.put(s, 1);
        } String s = sc.next(); s sc.next() sc.next sc if (m.get(s) != null) m.replace(s, m.get(s) + 1);
            else m.put(s, 1); m.get(s) != null m.get(s) m.get m s null m.replace(s, m.get(s) + 1) m.replace m s m.get(s) + 1 m.get(s) m.get m s 1 m.put(s, 1) m.put m s 1 int max = 0; max 0 for (Integer val : m.values()) max = Math.max(max, val); Integer val m.values() m.values m max = Math.max(max, val); max = Math.max(max, val) max Math.max(max, val) Math.max Math max val ArrayList<String> al = new ArrayList(); al new ArrayList() for (Map.Entry<String, Integer> e : m.entrySet()) {
            if (e.getValue() == max) al.add(e.getKey()); 
        } Map.Entry<String, Integer> e m.entrySet() m.entrySet m {
            if (e.getValue() == max) al.add(e.getKey()); 
        } {
            if (e.getValue() == max) al.add(e.getKey()); 
        } if (e.getValue() == max) al.add(e.getKey()); e.getValue() == max e.getValue() e.getValue e max al.add(e.getKey()) al.add al e.getKey() e.getKey e Collections.sort(al) Collections.sort Collections al for (String s : al) System.out.println(s); String s al 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();
        Map<String, Integer> m = new HashMap();
        for (int i = 0; i < n; i++) {
            String s = sc.next();
            if (m.get(s) != null) m.replace(s, m.get(s) + 1);
            else m.put(s, 1);
        }
        int max = 0;
        for (Integer val : m.values()) max = Math.max(max, val);
        ArrayList<String> al = new ArrayList();
        for (Map.Entry<String, Integer> e : m.entrySet()) {
            if (e.getValue() == max) al.add(e.getKey()); 
        }
        Collections.sort(al);
        for (String s : al) System.out.println(s);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Map<String, Integer> m = new HashMap();
        for (int i = 0; i < n; i++) {
            String s = sc.next();
            if (m.get(s) != null) m.replace(s, m.get(s) + 1);
            else m.put(s, 1);
        }
        int max = 0;
        for (Integer val : m.values()) max = Math.max(max, val);
        ArrayList<String> al = new ArrayList();
        for (Map.Entry<String, Integer> e : m.entrySet()) {
            if (e.getValue() == max) al.add(e.getKey()); 
        }
        Collections.sort(al);
        for (String s : al) System.out.println(s);
    }
} Main
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Map<String, Integer> m = new HashMap();
        for (int i = 0; i < n; i++) {
            String s = sc.next();
            if (m.get(s) != null) m.replace(s, m.get(s) + 1);
            else m.put(s, 1);
        }
        int max = 0;
        for (Integer val : m.values()) max = Math.max(max, val);
        ArrayList<String> al = new ArrayList();
        for (Map.Entry<String, Integer> e : m.entrySet()) {
            if (e.getValue() == max) al.add(e.getKey()); 
        }
        Collections.sort(al);
        for (String s : al) System.out.println(s);
    }
}