import java.util.*;
import java.util.Map.*;   // Entryを使うときは、paizaではこれを宣言する

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        
        Map<String, Integer> map = new HashMap<String, Integer>();
        int max = 0;
        while (n-- > 0) {
            String w = sc.next();
            if (!map.containsKey(w)) {
                map.put(w, 1);
                max = Math.max(max, 1);
            } else {
                int v = map.get(w);
                map.put(w, v + 1);
                max = Math.max(max, v + 1);
            }
        }
        
        List<String> list = new ArrayList<String>();
        for (Entry<String, Integer> entry : map.entrySet()) {
            String key = entry.getKey();
            int val = entry.getValue();
            if (val == max) {
                list.add(key);
            }
        }
        list.sort(Comparator.naturalOrder());
        
        for (String s : list) {
            System.out.println(s);
            
        }
    }
} import java.util.*; util.* java import java.util.Map.*;   // Entryを使うときは、paizaではこれを宣言する Map.* java.util public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        
        Map<String, Integer> map = new HashMap<String, Integer>();
        int max = 0;
        while (n-- > 0) {
            String w = sc.next();
            if (!map.containsKey(w)) {
                map.put(w, 1);
                max = Math.max(max, 1);
            } else {
                int v = map.get(w);
                map.put(w, v + 1);
                max = Math.max(max, v + 1);
            }
        }
        
        List<String> list = new ArrayList<String>();
        for (Entry<String, Integer> entry : map.entrySet()) {
            String key = entry.getKey();
            int val = entry.getValue();
            if (val == max) {
                list.add(key);
            }
        }
        list.sort(Comparator.naturalOrder());
        
        for (String s : list) {
            System.out.println(s);
            
        }
    }
} Main public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        
        Map<String, Integer> map = new HashMap<String, Integer>();
        int max = 0;
        while (n-- > 0) {
            String w = sc.next();
            if (!map.containsKey(w)) {
                map.put(w, 1);
                max = Math.max(max, 1);
            } else {
                int v = map.get(w);
                map.put(w, v + 1);
                max = Math.max(max, v + 1);
            }
        }
        
        List<String> list = new ArrayList<String>();
        for (Entry<String, Integer> entry : map.entrySet()) {
            String key = entry.getKey();
            int val = entry.getValue();
            if (val == max) {
                list.add(key);
            }
        }
        list.sort(Comparator.naturalOrder());
        
        for (String s : list) {
            System.out.println(s);
            
        }
    } main {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        
        Map<String, Integer> map = new HashMap<String, Integer>();
        int max = 0;
        while (n-- > 0) {
            String w = sc.next();
            if (!map.containsKey(w)) {
                map.put(w, 1);
                max = Math.max(max, 1);
            } else {
                int v = map.get(w);
                map.put(w, v + 1);
                max = Math.max(max, v + 1);
            }
        }
        
        List<String> list = new ArrayList<String>();
        for (Entry<String, Integer> entry : map.entrySet()) {
            String key = entry.getKey();
            int val = entry.getValue();
            if (val == max) {
                list.add(key);
            }
        }
        list.sort(Comparator.naturalOrder());
        
        for (String s : list) {
            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> map = new HashMap<String, Integer>(); map new HashMap<String, Integer>() int max = 0; max 0 while (n-- > 0) {
            String w = sc.next();
            if (!map.containsKey(w)) {
                map.put(w, 1);
                max = Math.max(max, 1);
            } else {
                int v = map.get(w);
                map.put(w, v + 1);
                max = Math.max(max, v + 1);
            }
        } n-- > 0 n-- n 0 {
            String w = sc.next();
            if (!map.containsKey(w)) {
                map.put(w, 1);
                max = Math.max(max, 1);
            } else {
                int v = map.get(w);
                map.put(w, v + 1);
                max = Math.max(max, v + 1);
            }
        } String w = sc.next(); w sc.next() sc.next sc if (!map.containsKey(w)) {
                map.put(w, 1);
                max = Math.max(max, 1);
            } else {
                int v = map.get(w);
                map.put(w, v + 1);
                max = Math.max(max, v + 1);
            } !map.containsKey(w) map.containsKey(w) map.containsKey map w {
                map.put(w, 1);
                max = Math.max(max, 1);
            } map.put(w, 1) map.put map w 1 max = Math.max(max, 1) max Math.max(max, 1) Math.max Math max 1 {
                int v = map.get(w);
                map.put(w, v + 1);
                max = Math.max(max, v + 1);
            } int v = map.get(w); v map.get(w) map.get map w map.put(w, v + 1) map.put map w v + 1 v 1 max = Math.max(max, v + 1) max Math.max(max, v + 1) Math.max Math max v + 1 v 1 List<String> list = new ArrayList<String>(); list new ArrayList<String>() for (Entry<String, Integer> entry : map.entrySet()) {
            String key = entry.getKey();
            int val = entry.getValue();
            if (val == max) {
                list.add(key);
            }
        } Entry<String, Integer> entry map.entrySet() map.entrySet map {
            String key = entry.getKey();
            int val = entry.getValue();
            if (val == max) {
                list.add(key);
            }
        } {
            String key = entry.getKey();
            int val = entry.getValue();
            if (val == max) {
                list.add(key);
            }
        } String key = entry.getKey(); key entry.getKey() entry.getKey entry int val = entry.getValue(); val entry.getValue() entry.getValue entry if (val == max) {
                list.add(key);
            } val == max val max {
                list.add(key);
            } list.add(key) list.add list key list.sort(Comparator.naturalOrder()) list.sort list Comparator.naturalOrder() Comparator.naturalOrder Comparator for (String s : list) {
            System.out.println(s);
            
        } String s list {
            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) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        
        Map<String, Integer> map = new HashMap<String, Integer>();
        int max = 0;
        while (n-- > 0) {
            String w = sc.next();
            if (!map.containsKey(w)) {
                map.put(w, 1);
                max = Math.max(max, 1);
            } else {
                int v = map.get(w);
                map.put(w, v + 1);
                max = Math.max(max, v + 1);
            }
        }
        
        List<String> list = new ArrayList<String>();
        for (Entry<String, Integer> entry : map.entrySet()) {
            String key = entry.getKey();
            int val = entry.getValue();
            if (val == max) {
                list.add(key);
            }
        }
        list.sort(Comparator.naturalOrder());
        
        for (String s : list) {
            System.out.println(s);
            
        }
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        
        Map<String, Integer> map = new HashMap<String, Integer>();
        int max = 0;
        while (n-- > 0) {
            String w = sc.next();
            if (!map.containsKey(w)) {
                map.put(w, 1);
                max = Math.max(max, 1);
            } else {
                int v = map.get(w);
                map.put(w, v + 1);
                max = Math.max(max, v + 1);
            }
        }
        
        List<String> list = new ArrayList<String>();
        for (Entry<String, Integer> entry : map.entrySet()) {
            String key = entry.getKey();
            int val = entry.getValue();
            if (val == max) {
                list.add(key);
            }
        }
        list.sort(Comparator.naturalOrder());
        
        for (String s : list) {
            System.out.println(s);
            
        }
    }
} Main
import java.util.*;
import java.util.Map.*;   // Entryを使うときは、paizaではこれを宣言する

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        
        Map<String, Integer> map = new HashMap<String, Integer>();
        int max = 0;
        while (n-- > 0) {
            String w = sc.next();
            if (!map.containsKey(w)) {
                map.put(w, 1);
                max = Math.max(max, 1);
            } else {
                int v = map.get(w);
                map.put(w, v + 1);
                max = Math.max(max, v + 1);
            }
        }
        
        List<String> list = new ArrayList<String>();
        for (Entry<String, Integer> entry : map.entrySet()) {
            String key = entry.getKey();
            int val = entry.getValue();
            if (val == max) {
                list.add(key);
            }
        }
        list.sort(Comparator.naturalOrder());
        
        for (String s : list) {
            System.out.println(s);
            
        }
    }
}
