import java.util.*;

class Main{
  public static void main (String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    HashMap<String, Integer> counts = new HashMap<String, Integer>();
    int count = 0;
    for(int i=0;i<N;i++){
      String K = sc.next();
      int t = counts.getOrDefault(K, 0);
      counts.put(K, t + 1);
      count = Math.max(count, t + 1);
   }
    List<String> st = new ArrayList<>();
        for(Map.Entry<String, Integer> entry : counts.entrySet()) {
            if(entry.getValue() == count) {
                st.add(entry.getKey());
            }
        }
        
        Collections.sort(st);
        for(String s : st) {
            System.out.println(s);
        }

    

  }
} import java.util.*; util.* java class Main{
  public static void main (String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    HashMap<String, Integer> counts = new HashMap<String, Integer>();
    int count = 0;
    for(int i=0;i<N;i++){
      String K = sc.next();
      int t = counts.getOrDefault(K, 0);
      counts.put(K, t + 1);
      count = Math.max(count, t + 1);
   }
    List<String> st = new ArrayList<>();
        for(Map.Entry<String, Integer> entry : counts.entrySet()) {
            if(entry.getValue() == count) {
                st.add(entry.getKey());
            }
        }
        
        Collections.sort(st);
        for(String s : st) {
            System.out.println(s);
        }

    

  }
} Main public static void main (String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    HashMap<String, Integer> counts = new HashMap<String, Integer>();
    int count = 0;
    for(int i=0;i<N;i++){
      String K = sc.next();
      int t = counts.getOrDefault(K, 0);
      counts.put(K, t + 1);
      count = Math.max(count, t + 1);
   }
    List<String> st = new ArrayList<>();
        for(Map.Entry<String, Integer> entry : counts.entrySet()) {
            if(entry.getValue() == count) {
                st.add(entry.getKey());
            }
        }
        
        Collections.sort(st);
        for(String s : st) {
            System.out.println(s);
        }

    

  } main {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    HashMap<String, Integer> counts = new HashMap<String, Integer>();
    int count = 0;
    for(int i=0;i<N;i++){
      String K = sc.next();
      int t = counts.getOrDefault(K, 0);
      counts.put(K, t + 1);
      count = Math.max(count, t + 1);
   }
    List<String> st = new ArrayList<>();
        for(Map.Entry<String, Integer> entry : counts.entrySet()) {
            if(entry.getValue() == count) {
                st.add(entry.getKey());
            }
        }
        
        Collections.sort(st);
        for(String s : st) {
            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 HashMap<String, Integer> counts = new HashMap<String, Integer>(); counts new HashMap<String, Integer>() int count = 0; count 0 for(int i=0;i<N;i++){
      String K = sc.next();
      int t = counts.getOrDefault(K, 0);
      counts.put(K, t + 1);
      count = Math.max(count, t + 1);
   } int i=0; int i=0; i 0 i<N i N i++ i++ i {
      String K = sc.next();
      int t = counts.getOrDefault(K, 0);
      counts.put(K, t + 1);
      count = Math.max(count, t + 1);
   } {
      String K = sc.next();
      int t = counts.getOrDefault(K, 0);
      counts.put(K, t + 1);
      count = Math.max(count, t + 1);
   } String K = sc.next(); K sc.next() sc.next sc int t = counts.getOrDefault(K, 0); t counts.getOrDefault(K, 0) counts.getOrDefault counts K 0 counts.put(K, t + 1) counts.put counts K t + 1 t 1 count = Math.max(count, t + 1) count Math.max(count, t + 1) Math.max Math count t + 1 t 1 List<String> st = new ArrayList<>(); st new ArrayList<>() for(Map.Entry<String, Integer> entry : counts.entrySet()) {
            if(entry.getValue() == count) {
                st.add(entry.getKey());
            }
        } Map.Entry<String, Integer> entry counts.entrySet() counts.entrySet counts {
            if(entry.getValue() == count) {
                st.add(entry.getKey());
            }
        } {
            if(entry.getValue() == count) {
                st.add(entry.getKey());
            }
        } if(entry.getValue() == count) {
                st.add(entry.getKey());
            } entry.getValue() == count entry.getValue() entry.getValue entry count {
                st.add(entry.getKey());
            } st.add(entry.getKey()) st.add st entry.getKey() entry.getKey entry Collections.sort(st) Collections.sort Collections st for(String s : st) {
            System.out.println(s);
        } String s st {
            System.out.println(s);
        } {
            System.out.println(s);
        } System.out.println(s) System.out.println System.out System System.out s String[] args args
import java.util.*;

class Main{
  public static void main (String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    HashMap<String, Integer> counts = new HashMap<String, Integer>();
    int count = 0;
    for(int i=0;i<N;i++){
      String K = sc.next();
      int t = counts.getOrDefault(K, 0);
      counts.put(K, t + 1);
      count = Math.max(count, t + 1);
   }
    List<String> st = new ArrayList<>();
        for(Map.Entry<String, Integer> entry : counts.entrySet()) {
            if(entry.getValue() == count) {
                st.add(entry.getKey());
            }
        }
        
        Collections.sort(st);
        for(String s : st) {
            System.out.println(s);
        }

    

  }
}