import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = Integer.parseInt(sc.next());
    String A[] = new String[N];
    Map<String, Integer> map = new HashMap<String, Integer>();
    int max_cnt = 1;
    for(int i = 0; i < N;i++){
      A[i] = sc.next();
      if(map.containsKey(A[i])){
          map.put(A[i],map.get(A[i])+1);
          max_cnt = Math.max(max_cnt,map.get(A[i]));
      }else{
          map.put(A[i],1);
      }
    }
    ArrayList<String> ar = new ArrayList<String>();
    for(String key : map.keySet()){
        if(map.get(key) == max_cnt){
            ar.add(key);
        }
    }
    Collections.sort(ar);
    for(int i=0; i < ar.size(); i++){
        System.out.println(ar.get(i));
    }  
  }
}

 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.next());
    String A[] = new String[N];
    Map<String, Integer> map = new HashMap<String, Integer>();
    int max_cnt = 1;
    for(int i = 0; i < N;i++){
      A[i] = sc.next();
      if(map.containsKey(A[i])){
          map.put(A[i],map.get(A[i])+1);
          max_cnt = Math.max(max_cnt,map.get(A[i]));
      }else{
          map.put(A[i],1);
      }
    }
    ArrayList<String> ar = new ArrayList<String>();
    for(String key : map.keySet()){
        if(map.get(key) == max_cnt){
            ar.add(key);
        }
    }
    Collections.sort(ar);
    for(int i=0; i < ar.size(); i++){
        System.out.println(ar.get(i));
    }  
  }
} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = Integer.parseInt(sc.next());
    String A[] = new String[N];
    Map<String, Integer> map = new HashMap<String, Integer>();
    int max_cnt = 1;
    for(int i = 0; i < N;i++){
      A[i] = sc.next();
      if(map.containsKey(A[i])){
          map.put(A[i],map.get(A[i])+1);
          max_cnt = Math.max(max_cnt,map.get(A[i]));
      }else{
          map.put(A[i],1);
      }
    }
    ArrayList<String> ar = new ArrayList<String>();
    for(String key : map.keySet()){
        if(map.get(key) == max_cnt){
            ar.add(key);
        }
    }
    Collections.sort(ar);
    for(int i=0; i < ar.size(); i++){
        System.out.println(ar.get(i));
    }  
  } main {
    Scanner sc = new Scanner(System.in);
    int N = Integer.parseInt(sc.next());
    String A[] = new String[N];
    Map<String, Integer> map = new HashMap<String, Integer>();
    int max_cnt = 1;
    for(int i = 0; i < N;i++){
      A[i] = sc.next();
      if(map.containsKey(A[i])){
          map.put(A[i],map.get(A[i])+1);
          max_cnt = Math.max(max_cnt,map.get(A[i]));
      }else{
          map.put(A[i],1);
      }
    }
    ArrayList<String> ar = new ArrayList<String>();
    for(String key : map.keySet()){
        if(map.get(key) == max_cnt){
            ar.add(key);
        }
    }
    Collections.sort(ar);
    for(int i=0; i < ar.size(); i++){
        System.out.println(ar.get(i));
    }  
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = Integer.parseInt(sc.next()); N Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc String A[] = new String[N]; A new String[N] N Map<String, Integer> map = new HashMap<String, Integer>(); map new HashMap<String, Integer>() int max_cnt = 1; max_cnt 1 for(int i = 0; i < N;i++){
      A[i] = sc.next();
      if(map.containsKey(A[i])){
          map.put(A[i],map.get(A[i])+1);
          max_cnt = Math.max(max_cnt,map.get(A[i]));
      }else{
          map.put(A[i],1);
      }
    } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
      A[i] = sc.next();
      if(map.containsKey(A[i])){
          map.put(A[i],map.get(A[i])+1);
          max_cnt = Math.max(max_cnt,map.get(A[i]));
      }else{
          map.put(A[i],1);
      }
    } {
      A[i] = sc.next();
      if(map.containsKey(A[i])){
          map.put(A[i],map.get(A[i])+1);
          max_cnt = Math.max(max_cnt,map.get(A[i]));
      }else{
          map.put(A[i],1);
      }
    } A[i] = sc.next() A[i] A i sc.next() sc.next sc if(map.containsKey(A[i])){
          map.put(A[i],map.get(A[i])+1);
          max_cnt = Math.max(max_cnt,map.get(A[i]));
      }else{
          map.put(A[i],1);
      } map.containsKey(A[i]) map.containsKey map A[i] A i {
          map.put(A[i],map.get(A[i])+1);
          max_cnt = Math.max(max_cnt,map.get(A[i]));
      } map.put(A[i],map.get(A[i])+1) map.put map A[i] A i map.get(A[i])+1 map.get(A[i]) map.get map A[i] A i 1 max_cnt = Math.max(max_cnt,map.get(A[i])) max_cnt Math.max(max_cnt,map.get(A[i])) Math.max Math max_cnt map.get(A[i]) map.get map A[i] A i {
          map.put(A[i],1);
      } map.put(A[i],1) map.put map A[i] A i 1 ArrayList<String> ar = new ArrayList<String>(); ar new ArrayList<String>() for(String key : map.keySet()){
        if(map.get(key) == max_cnt){
            ar.add(key);
        }
    } String key map.keySet() map.keySet map {
        if(map.get(key) == max_cnt){
            ar.add(key);
        }
    } {
        if(map.get(key) == max_cnt){
            ar.add(key);
        }
    } if(map.get(key) == max_cnt){
            ar.add(key);
        } map.get(key) == max_cnt map.get(key) map.get map key max_cnt {
            ar.add(key);
        } ar.add(key) ar.add ar key Collections.sort(ar) Collections.sort Collections ar for(int i=0; i < ar.size(); i++){
        System.out.println(ar.get(i));
    } int i=0; int i=0; i 0 i < ar.size() i ar.size() ar.size ar i++ i++ i {
        System.out.println(ar.get(i));
    } {
        System.out.println(ar.get(i));
    } System.out.println(ar.get(i)) System.out.println System.out System System.out ar.get(i) ar.get ar i String[] args args public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = Integer.parseInt(sc.next());
    String A[] = new String[N];
    Map<String, Integer> map = new HashMap<String, Integer>();
    int max_cnt = 1;
    for(int i = 0; i < N;i++){
      A[i] = sc.next();
      if(map.containsKey(A[i])){
          map.put(A[i],map.get(A[i])+1);
          max_cnt = Math.max(max_cnt,map.get(A[i]));
      }else{
          map.put(A[i],1);
      }
    }
    ArrayList<String> ar = new ArrayList<String>();
    for(String key : map.keySet()){
        if(map.get(key) == max_cnt){
            ar.add(key);
        }
    }
    Collections.sort(ar);
    for(int i=0; i < ar.size(); i++){
        System.out.println(ar.get(i));
    }  
  }
} public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = Integer.parseInt(sc.next());
    String A[] = new String[N];
    Map<String, Integer> map = new HashMap<String, Integer>();
    int max_cnt = 1;
    for(int i = 0; i < N;i++){
      A[i] = sc.next();
      if(map.containsKey(A[i])){
          map.put(A[i],map.get(A[i])+1);
          max_cnt = Math.max(max_cnt,map.get(A[i]));
      }else{
          map.put(A[i],1);
      }
    }
    ArrayList<String> ar = new ArrayList<String>();
    for(String key : map.keySet()){
        if(map.get(key) == max_cnt){
            ar.add(key);
        }
    }
    Collections.sort(ar);
    for(int i=0; i < ar.size(); i++){
        System.out.println(ar.get(i));
    }  
  }
} Main
import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = Integer.parseInt(sc.next());
    String A[] = new String[N];
    Map<String, Integer> map = new HashMap<String, Integer>();
    int max_cnt = 1;
    for(int i = 0; i < N;i++){
      A[i] = sc.next();
      if(map.containsKey(A[i])){
          map.put(A[i],map.get(A[i])+1);
          max_cnt = Math.max(max_cnt,map.get(A[i]));
      }else{
          map.put(A[i],1);
      }
    }
    ArrayList<String> ar = new ArrayList<String>();
    for(String key : map.keySet()){
        if(map.get(key) == max_cnt){
            ar.add(key);
        }
    }
    Collections.sort(ar);
    for(int i=0; i < ar.size(); i++){
        System.out.println(ar.get(i));
    }  
  }
}


