import java.util.*;

class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
	int n = Integer.parseInt(sc.next());
    String[] s = new String[n];
    for(int i=0;i<n;i++){
      s[i] = sc.next();
    }
    Map<String,Integer> map = new HashMap<>();
    Integer count;
    for(int i=0;i<n;i++){
      count=map.get(s[i]);
      if(count==null){
        map.put(s[i],1);
      }else{
        map.replace(s[i],count+1);
      }
    }
    int max = 0;
    for(Integer ii : map.values()){
      if( ii> max){
        max = ii;
      }
    }
    List<String> list = new ArrayList<>();
    for(Map.Entry<String,Integer> e : map.entrySet()){
      if(e.getValue() == max){
        list.add(e.getKey());
      }
    }
    Collections.sort(list);
    for(String str : list){
      System.out.println(str);
    }
    System.out.flush();
    
  }
} import java.util.*; util.* java class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
	int n = Integer.parseInt(sc.next());
    String[] s = new String[n];
    for(int i=0;i<n;i++){
      s[i] = sc.next();
    }
    Map<String,Integer> map = new HashMap<>();
    Integer count;
    for(int i=0;i<n;i++){
      count=map.get(s[i]);
      if(count==null){
        map.put(s[i],1);
      }else{
        map.replace(s[i],count+1);
      }
    }
    int max = 0;
    for(Integer ii : map.values()){
      if( ii> max){
        max = ii;
      }
    }
    List<String> list = new ArrayList<>();
    for(Map.Entry<String,Integer> e : map.entrySet()){
      if(e.getValue() == max){
        list.add(e.getKey());
      }
    }
    Collections.sort(list);
    for(String str : list){
      System.out.println(str);
    }
    System.out.flush();
    
  }
} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
	int n = Integer.parseInt(sc.next());
    String[] s = new String[n];
    for(int i=0;i<n;i++){
      s[i] = sc.next();
    }
    Map<String,Integer> map = new HashMap<>();
    Integer count;
    for(int i=0;i<n;i++){
      count=map.get(s[i]);
      if(count==null){
        map.put(s[i],1);
      }else{
        map.replace(s[i],count+1);
      }
    }
    int max = 0;
    for(Integer ii : map.values()){
      if( ii> max){
        max = ii;
      }
    }
    List<String> list = new ArrayList<>();
    for(Map.Entry<String,Integer> e : map.entrySet()){
      if(e.getValue() == max){
        list.add(e.getKey());
      }
    }
    Collections.sort(list);
    for(String str : list){
      System.out.println(str);
    }
    System.out.flush();
    
  } main {
    Scanner sc = new Scanner(System.in);
	int n = Integer.parseInt(sc.next());
    String[] s = new String[n];
    for(int i=0;i<n;i++){
      s[i] = sc.next();
    }
    Map<String,Integer> map = new HashMap<>();
    Integer count;
    for(int i=0;i<n;i++){
      count=map.get(s[i]);
      if(count==null){
        map.put(s[i],1);
      }else{
        map.replace(s[i],count+1);
      }
    }
    int max = 0;
    for(Integer ii : map.values()){
      if( ii> max){
        max = ii;
      }
    }
    List<String> list = new ArrayList<>();
    for(Map.Entry<String,Integer> e : map.entrySet()){
      if(e.getValue() == max){
        list.add(e.getKey());
      }
    }
    Collections.sort(list);
    for(String str : list){
      System.out.println(str);
    }
    System.out.flush();
    
  } 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[] s = new String[n]; s new String[n] n for(int i=0;i<n;i++){
      s[i] = sc.next();
    } int i=0; int i=0; i 0 i<n i n i++ i++ i {
      s[i] = sc.next();
    } {
      s[i] = sc.next();
    } s[i] = sc.next() s[i] s i sc.next() sc.next sc Map<String,Integer> map = new HashMap<>(); map new HashMap<>() Integer count; count for(int i=0;i<n;i++){
      count=map.get(s[i]);
      if(count==null){
        map.put(s[i],1);
      }else{
        map.replace(s[i],count+1);
      }
    } int i=0; int i=0; i 0 i<n i n i++ i++ i {
      count=map.get(s[i]);
      if(count==null){
        map.put(s[i],1);
      }else{
        map.replace(s[i],count+1);
      }
    } {
      count=map.get(s[i]);
      if(count==null){
        map.put(s[i],1);
      }else{
        map.replace(s[i],count+1);
      }
    } count=map.get(s[i]) count map.get(s[i]) map.get map s[i] s i if(count==null){
        map.put(s[i],1);
      }else{
        map.replace(s[i],count+1);
      } count==null count null {
        map.put(s[i],1);
      } map.put(s[i],1) map.put map s[i] s i 1 {
        map.replace(s[i],count+1);
      } map.replace(s[i],count+1) map.replace map s[i] s i count+1 count 1 int max = 0; max 0 for(Integer ii : map.values()){
      if( ii> max){
        max = ii;
      }
    } Integer ii map.values() map.values map {
      if( ii> max){
        max = ii;
      }
    } {
      if( ii> max){
        max = ii;
      }
    } if( ii> max){
        max = ii;
      } ii> max ii max {
        max = ii;
      } max = ii max ii List<String> list = new ArrayList<>(); list new ArrayList<>() for(Map.Entry<String,Integer> e : map.entrySet()){
      if(e.getValue() == max){
        list.add(e.getKey());
      }
    } Map.Entry<String,Integer> e map.entrySet() map.entrySet map {
      if(e.getValue() == max){
        list.add(e.getKey());
      }
    } {
      if(e.getValue() == max){
        list.add(e.getKey());
      }
    } if(e.getValue() == max){
        list.add(e.getKey());
      } e.getValue() == max e.getValue() e.getValue e max {
        list.add(e.getKey());
      } list.add(e.getKey()) list.add list e.getKey() e.getKey e Collections.sort(list) Collections.sort Collections list for(String str : list){
      System.out.println(str);
    } String str list {
      System.out.println(str);
    } {
      System.out.println(str);
    } System.out.println(str) System.out.println System.out System System.out str System.out.flush() System.out.flush System.out System System.out String[] args args
import java.util.*;

class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
	int n = Integer.parseInt(sc.next());
    String[] s = new String[n];
    for(int i=0;i<n;i++){
      s[i] = sc.next();
    }
    Map<String,Integer> map = new HashMap<>();
    Integer count;
    for(int i=0;i<n;i++){
      count=map.get(s[i]);
      if(count==null){
        map.put(s[i],1);
      }else{
        map.replace(s[i],count+1);
      }
    }
    int max = 0;
    for(Integer ii : map.values()){
      if( ii> max){
        max = ii;
      }
    }
    List<String> list = new ArrayList<>();
    for(Map.Entry<String,Integer> e : map.entrySet()){
      if(e.getValue() == max){
        list.add(e.getKey());
      }
    }
    Collections.sort(list);
    for(String str : list){
      System.out.println(str);
    }
    System.out.flush();
    
  }
}