import java.util.*;
public class Main { 
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        Map<String, Integer> freq = new HashMap<>();
        int n = sc.nextInt();
        int maxFreq = 0;
        List<String> list = new ArrayList<>();
        String str = "";
        for(int i = 0; i < n; i++) {
          str = sc.next();
          freq.put(str, freq.getOrDefault(str, 0) + 1);
          if(maxFreq == freq.get(str)) {
            list.add(str);
          } else if (maxFreq < freq.get(str)) {
            maxFreq = freq.get(str);
            list = new ArrayList<>();
            list.add(str);
          }
        }
        Collections.sort(list);
        for(String s : list)
          System.out.println(s);
    }
} import java.util.*; util.* java public class Main { 
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        Map<String, Integer> freq = new HashMap<>();
        int n = sc.nextInt();
        int maxFreq = 0;
        List<String> list = new ArrayList<>();
        String str = "";
        for(int i = 0; i < n; i++) {
          str = sc.next();
          freq.put(str, freq.getOrDefault(str, 0) + 1);
          if(maxFreq == freq.get(str)) {
            list.add(str);
          } else if (maxFreq < freq.get(str)) {
            maxFreq = freq.get(str);
            list = new ArrayList<>();
            list.add(str);
          }
        }
        Collections.sort(list);
        for(String s : list)
          System.out.println(s);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        Map<String, Integer> freq = new HashMap<>();
        int n = sc.nextInt();
        int maxFreq = 0;
        List<String> list = new ArrayList<>();
        String str = "";
        for(int i = 0; i < n; i++) {
          str = sc.next();
          freq.put(str, freq.getOrDefault(str, 0) + 1);
          if(maxFreq == freq.get(str)) {
            list.add(str);
          } else if (maxFreq < freq.get(str)) {
            maxFreq = freq.get(str);
            list = new ArrayList<>();
            list.add(str);
          }
        }
        Collections.sort(list);
        for(String s : list)
          System.out.println(s);
    } main {
        Scanner sc = new Scanner(System.in);
        Map<String, Integer> freq = new HashMap<>();
        int n = sc.nextInt();
        int maxFreq = 0;
        List<String> list = new ArrayList<>();
        String str = "";
        for(int i = 0; i < n; i++) {
          str = sc.next();
          freq.put(str, freq.getOrDefault(str, 0) + 1);
          if(maxFreq == freq.get(str)) {
            list.add(str);
          } else if (maxFreq < freq.get(str)) {
            maxFreq = freq.get(str);
            list = new ArrayList<>();
            list.add(str);
          }
        }
        Collections.sort(list);
        for(String s : list)
          System.out.println(s);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) Map<String, Integer> freq = new HashMap<>(); freq new HashMap<>() int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int maxFreq = 0; maxFreq 0 List<String> list = new ArrayList<>(); list new ArrayList<>() String str = ""; str "" for(int i = 0; i < n; i++) {
          str = sc.next();
          freq.put(str, freq.getOrDefault(str, 0) + 1);
          if(maxFreq == freq.get(str)) {
            list.add(str);
          } else if (maxFreq < freq.get(str)) {
            maxFreq = freq.get(str);
            list = new ArrayList<>();
            list.add(str);
          }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
          str = sc.next();
          freq.put(str, freq.getOrDefault(str, 0) + 1);
          if(maxFreq == freq.get(str)) {
            list.add(str);
          } else if (maxFreq < freq.get(str)) {
            maxFreq = freq.get(str);
            list = new ArrayList<>();
            list.add(str);
          }
        } {
          str = sc.next();
          freq.put(str, freq.getOrDefault(str, 0) + 1);
          if(maxFreq == freq.get(str)) {
            list.add(str);
          } else if (maxFreq < freq.get(str)) {
            maxFreq = freq.get(str);
            list = new ArrayList<>();
            list.add(str);
          }
        } str = sc.next() str sc.next() sc.next sc freq.put(str, freq.getOrDefault(str, 0) + 1) freq.put freq str freq.getOrDefault(str, 0) + 1 freq.getOrDefault(str, 0) freq.getOrDefault freq str 0 1 if(maxFreq == freq.get(str)) {
            list.add(str);
          } else if (maxFreq < freq.get(str)) {
            maxFreq = freq.get(str);
            list = new ArrayList<>();
            list.add(str);
          } maxFreq == freq.get(str) maxFreq freq.get(str) freq.get freq str {
            list.add(str);
          } list.add(str) list.add list str if (maxFreq < freq.get(str)) {
            maxFreq = freq.get(str);
            list = new ArrayList<>();
            list.add(str);
          } maxFreq < freq.get(str) maxFreq freq.get(str) freq.get freq str {
            maxFreq = freq.get(str);
            list = new ArrayList<>();
            list.add(str);
          } maxFreq = freq.get(str) maxFreq freq.get(str) freq.get freq str list = new ArrayList<>() list new ArrayList<>() list.add(str) list.add list str Collections.sort(list) Collections.sort Collections list for(String s : list)
          System.out.println(s); String s list 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);
        Map<String, Integer> freq = new HashMap<>();
        int n = sc.nextInt();
        int maxFreq = 0;
        List<String> list = new ArrayList<>();
        String str = "";
        for(int i = 0; i < n; i++) {
          str = sc.next();
          freq.put(str, freq.getOrDefault(str, 0) + 1);
          if(maxFreq == freq.get(str)) {
            list.add(str);
          } else if (maxFreq < freq.get(str)) {
            maxFreq = freq.get(str);
            list = new ArrayList<>();
            list.add(str);
          }
        }
        Collections.sort(list);
        for(String s : list)
          System.out.println(s);
    }
} public class Main { 
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        Map<String, Integer> freq = new HashMap<>();
        int n = sc.nextInt();
        int maxFreq = 0;
        List<String> list = new ArrayList<>();
        String str = "";
        for(int i = 0; i < n; i++) {
          str = sc.next();
          freq.put(str, freq.getOrDefault(str, 0) + 1);
          if(maxFreq == freq.get(str)) {
            list.add(str);
          } else if (maxFreq < freq.get(str)) {
            maxFreq = freq.get(str);
            list = new ArrayList<>();
            list.add(str);
          }
        }
        Collections.sort(list);
        for(String s : list)
          System.out.println(s);
    }
} Main
import java.util.*;
public class Main { 
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        Map<String, Integer> freq = new HashMap<>();
        int n = sc.nextInt();
        int maxFreq = 0;
        List<String> list = new ArrayList<>();
        String str = "";
        for(int i = 0; i < n; i++) {
          str = sc.next();
          freq.put(str, freq.getOrDefault(str, 0) + 1);
          if(maxFreq == freq.get(str)) {
            list.add(str);
          } else if (maxFreq < freq.get(str)) {
            maxFreq = freq.get(str);
            list = new ArrayList<>();
            list.add(str);
          }
        }
        Collections.sort(list);
        for(String s : list)
          System.out.println(s);
    }
}