import java.util.*;

class Main {
  public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    int n = in.nextInt();
    Map<String, Integer> map = new HashMap<>();
    int max = 0;
    for (int i = 0; i < n; i++) {
      String t = in.next();
      map.put(t, map.get(t) == null ? 1 : map.get(t) + 1);
      max = Math.max(max, map.get(t));
    }
    List<String> list = new ArrayList<>();
    for (Map.Entry<String, Integer> entry : map.entrySet()) {
      if (entry.getValue() == max) {
        list.add(entry.getKey());
      }
    }
    Collections.sort(list);
    for (String e : list) {
      System.out.println(e);
    }
  }
} import java.util.*; util.* java class Main {
  public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    int n = in.nextInt();
    Map<String, Integer> map = new HashMap<>();
    int max = 0;
    for (int i = 0; i < n; i++) {
      String t = in.next();
      map.put(t, map.get(t) == null ? 1 : map.get(t) + 1);
      max = Math.max(max, map.get(t));
    }
    List<String> list = new ArrayList<>();
    for (Map.Entry<String, Integer> entry : map.entrySet()) {
      if (entry.getValue() == max) {
        list.add(entry.getKey());
      }
    }
    Collections.sort(list);
    for (String e : list) {
      System.out.println(e);
    }
  }
} Main public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    int n = in.nextInt();
    Map<String, Integer> map = new HashMap<>();
    int max = 0;
    for (int i = 0; i < n; i++) {
      String t = in.next();
      map.put(t, map.get(t) == null ? 1 : map.get(t) + 1);
      max = Math.max(max, map.get(t));
    }
    List<String> list = new ArrayList<>();
    for (Map.Entry<String, Integer> entry : map.entrySet()) {
      if (entry.getValue() == max) {
        list.add(entry.getKey());
      }
    }
    Collections.sort(list);
    for (String e : list) {
      System.out.println(e);
    }
  } main {
    Scanner in = new Scanner(System.in);
    int n = in.nextInt();
    Map<String, Integer> map = new HashMap<>();
    int max = 0;
    for (int i = 0; i < n; i++) {
      String t = in.next();
      map.put(t, map.get(t) == null ? 1 : map.get(t) + 1);
      max = Math.max(max, map.get(t));
    }
    List<String> list = new ArrayList<>();
    for (Map.Entry<String, Integer> entry : map.entrySet()) {
      if (entry.getValue() == max) {
        list.add(entry.getKey());
      }
    }
    Collections.sort(list);
    for (String e : list) {
      System.out.println(e);
    }
  } Scanner in = new Scanner(System.in); in new Scanner(System.in) int n = in.nextInt(); n in.nextInt() in.nextInt in Map<String, Integer> map = new HashMap<>(); map new HashMap<>() int max = 0; max 0 for (int i = 0; i < n; i++) {
      String t = in.next();
      map.put(t, map.get(t) == null ? 1 : map.get(t) + 1);
      max = Math.max(max, map.get(t));
    } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
      String t = in.next();
      map.put(t, map.get(t) == null ? 1 : map.get(t) + 1);
      max = Math.max(max, map.get(t));
    } {
      String t = in.next();
      map.put(t, map.get(t) == null ? 1 : map.get(t) + 1);
      max = Math.max(max, map.get(t));
    } String t = in.next(); t in.next() in.next in map.put(t, map.get(t) == null ? 1 : map.get(t) + 1) map.put map t map.get(t) == null ? 1 : map.get(t) + 1 map.get(t) == null map.get(t) map.get map t null 1 map.get(t) + 1 map.get(t) map.get map t 1 max = Math.max(max, map.get(t)) max Math.max(max, map.get(t)) Math.max Math max map.get(t) map.get map t List<String> list = new ArrayList<>(); list new ArrayList<>() for (Map.Entry<String, Integer> entry : map.entrySet()) {
      if (entry.getValue() == max) {
        list.add(entry.getKey());
      }
    } Map.Entry<String, Integer> entry map.entrySet() map.entrySet map {
      if (entry.getValue() == max) {
        list.add(entry.getKey());
      }
    } {
      if (entry.getValue() == max) {
        list.add(entry.getKey());
      }
    } if (entry.getValue() == max) {
        list.add(entry.getKey());
      } entry.getValue() == max entry.getValue() entry.getValue entry max {
        list.add(entry.getKey());
      } list.add(entry.getKey()) list.add list entry.getKey() entry.getKey entry Collections.sort(list) Collections.sort Collections list for (String e : list) {
      System.out.println(e);
    } String e list {
      System.out.println(e);
    } {
      System.out.println(e);
    } System.out.println(e) System.out.println System.out System System.out e String[] args args
import java.util.*;

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