import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = Integer.parseInt(sc.nextLine());
    Map<String, Integer> map = new HashMap<>();
    int max = 0;
    for(int i = 0; i < N; i++){
      String s = sc.nextLine();
      if(map.containsKey(s)){
        int n = map.get(s)+1;
        max = Math.max(n, max);
        map.put(s, n);
      }else{
        map.put(s, 1);
        max = Math.max(max, 1);
      }
    }
    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 st : list){
      System.out.println(st);
    }
  }
} import java.util.*; util.* java public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = Integer.parseInt(sc.nextLine());
    Map<String, Integer> map = new HashMap<>();
    int max = 0;
    for(int i = 0; i < N; i++){
      String s = sc.nextLine();
      if(map.containsKey(s)){
        int n = map.get(s)+1;
        max = Math.max(n, max);
        map.put(s, n);
      }else{
        map.put(s, 1);
        max = Math.max(max, 1);
      }
    }
    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 st : list){
      System.out.println(st);
    }
  }
} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = Integer.parseInt(sc.nextLine());
    Map<String, Integer> map = new HashMap<>();
    int max = 0;
    for(int i = 0; i < N; i++){
      String s = sc.nextLine();
      if(map.containsKey(s)){
        int n = map.get(s)+1;
        max = Math.max(n, max);
        map.put(s, n);
      }else{
        map.put(s, 1);
        max = Math.max(max, 1);
      }
    }
    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 st : list){
      System.out.println(st);
    }
  } main {
    Scanner sc = new Scanner(System.in);
    int N = Integer.parseInt(sc.nextLine());
    Map<String, Integer> map = new HashMap<>();
    int max = 0;
    for(int i = 0; i < N; i++){
      String s = sc.nextLine();
      if(map.containsKey(s)){
        int n = map.get(s)+1;
        max = Math.max(n, max);
        map.put(s, n);
      }else{
        map.put(s, 1);
        max = Math.max(max, 1);
      }
    }
    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 st : list){
      System.out.println(st);
    }
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = Integer.parseInt(sc.nextLine()); N Integer.parseInt(sc.nextLine()) Integer.parseInt Integer sc.nextLine() sc.nextLine sc Map<String, Integer> map = new HashMap<>(); map new HashMap<>() int max = 0; max 0 for(int i = 0; i < N; i++){
      String s = sc.nextLine();
      if(map.containsKey(s)){
        int n = map.get(s)+1;
        max = Math.max(n, max);
        map.put(s, n);
      }else{
        map.put(s, 1);
        max = Math.max(max, 1);
      }
    } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
      String s = sc.nextLine();
      if(map.containsKey(s)){
        int n = map.get(s)+1;
        max = Math.max(n, max);
        map.put(s, n);
      }else{
        map.put(s, 1);
        max = Math.max(max, 1);
      }
    } {
      String s = sc.nextLine();
      if(map.containsKey(s)){
        int n = map.get(s)+1;
        max = Math.max(n, max);
        map.put(s, n);
      }else{
        map.put(s, 1);
        max = Math.max(max, 1);
      }
    } String s = sc.nextLine(); s sc.nextLine() sc.nextLine sc if(map.containsKey(s)){
        int n = map.get(s)+1;
        max = Math.max(n, max);
        map.put(s, n);
      }else{
        map.put(s, 1);
        max = Math.max(max, 1);
      } map.containsKey(s) map.containsKey map s {
        int n = map.get(s)+1;
        max = Math.max(n, max);
        map.put(s, n);
      } int n = map.get(s)+1; n map.get(s)+1 map.get(s) map.get map s 1 max = Math.max(n, max) max Math.max(n, max) Math.max Math n max map.put(s, n) map.put map s n {
        map.put(s, 1);
        max = Math.max(max, 1);
      } map.put(s, 1) map.put map s 1 max = Math.max(max, 1) max Math.max(max, 1) Math.max Math max 1 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 st : list){
      System.out.println(st);
    } String st list {
      System.out.println(st);
    } {
      System.out.println(st);
    } System.out.println(st) System.out.println System.out System System.out st String[] args args public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = Integer.parseInt(sc.nextLine());
    Map<String, Integer> map = new HashMap<>();
    int max = 0;
    for(int i = 0; i < N; i++){
      String s = sc.nextLine();
      if(map.containsKey(s)){
        int n = map.get(s)+1;
        max = Math.max(n, max);
        map.put(s, n);
      }else{
        map.put(s, 1);
        max = Math.max(max, 1);
      }
    }
    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 st : list){
      System.out.println(st);
    }
  }
} public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = Integer.parseInt(sc.nextLine());
    Map<String, Integer> map = new HashMap<>();
    int max = 0;
    for(int i = 0; i < N; i++){
      String s = sc.nextLine();
      if(map.containsKey(s)){
        int n = map.get(s)+1;
        max = Math.max(n, max);
        map.put(s, n);
      }else{
        map.put(s, 1);
        max = Math.max(max, 1);
      }
    }
    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 st : list){
      System.out.println(st);
    }
  }
} Main
import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = Integer.parseInt(sc.nextLine());
    Map<String, Integer> map = new HashMap<>();
    int max = 0;
    for(int i = 0; i < N; i++){
      String s = sc.nextLine();
      if(map.containsKey(s)){
        int n = map.get(s)+1;
        max = Math.max(n, max);
        map.put(s, n);
      }else{
        map.put(s, 1);
        max = Math.max(max, 1);
      }
    }
    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 st : list){
      System.out.println(st);
    }
  }
}
