import java.util.ArrayList;
import java.util.TreeMap;
import java.util.List;
import java.util.Scanner;
class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    TreeMap<String,Integer> map = new TreeMap<>();
    for(int i = 0; i < n; i++){
      String key = sc.next();
      if(map.get(key) == null){
        map.put(key,0);
      }else{
          map.put(key, map.get(key) + 1);
      }
    }
    List<String> keylist = new ArrayList<>(map.keySet());
    List<String> output = new ArrayList<>();
    int max = 0;
    for(int i = 0; i < keylist.size(); i++){
      if(map.get(keylist.get(i)) > max){
        output.clear();
        output.add(keylist.get(i));
        max = map.get(keylist.get(i));
      }else if(map.get(keylist.get(i)) == max){
        output.add(keylist.get(i));
        max = map.get(keylist.get(i));
      }
    }
    for(int i = 0; i < output.size(); i++){
      System.out.println(output.get(i));
    }
  }
} import java.util.ArrayList; ArrayList java.util import java.util.TreeMap; TreeMap java.util import java.util.List; List java.util import java.util.Scanner; Scanner java.util class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    TreeMap<String,Integer> map = new TreeMap<>();
    for(int i = 0; i < n; i++){
      String key = sc.next();
      if(map.get(key) == null){
        map.put(key,0);
      }else{
          map.put(key, map.get(key) + 1);
      }
    }
    List<String> keylist = new ArrayList<>(map.keySet());
    List<String> output = new ArrayList<>();
    int max = 0;
    for(int i = 0; i < keylist.size(); i++){
      if(map.get(keylist.get(i)) > max){
        output.clear();
        output.add(keylist.get(i));
        max = map.get(keylist.get(i));
      }else if(map.get(keylist.get(i)) == max){
        output.add(keylist.get(i));
        max = map.get(keylist.get(i));
      }
    }
    for(int i = 0; i < output.size(); i++){
      System.out.println(output.get(i));
    }
  }
} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    TreeMap<String,Integer> map = new TreeMap<>();
    for(int i = 0; i < n; i++){
      String key = sc.next();
      if(map.get(key) == null){
        map.put(key,0);
      }else{
          map.put(key, map.get(key) + 1);
      }
    }
    List<String> keylist = new ArrayList<>(map.keySet());
    List<String> output = new ArrayList<>();
    int max = 0;
    for(int i = 0; i < keylist.size(); i++){
      if(map.get(keylist.get(i)) > max){
        output.clear();
        output.add(keylist.get(i));
        max = map.get(keylist.get(i));
      }else if(map.get(keylist.get(i)) == max){
        output.add(keylist.get(i));
        max = map.get(keylist.get(i));
      }
    }
    for(int i = 0; i < output.size(); i++){
      System.out.println(output.get(i));
    }
  } main {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    TreeMap<String,Integer> map = new TreeMap<>();
    for(int i = 0; i < n; i++){
      String key = sc.next();
      if(map.get(key) == null){
        map.put(key,0);
      }else{
          map.put(key, map.get(key) + 1);
      }
    }
    List<String> keylist = new ArrayList<>(map.keySet());
    List<String> output = new ArrayList<>();
    int max = 0;
    for(int i = 0; i < keylist.size(); i++){
      if(map.get(keylist.get(i)) > max){
        output.clear();
        output.add(keylist.get(i));
        max = map.get(keylist.get(i));
      }else if(map.get(keylist.get(i)) == max){
        output.add(keylist.get(i));
        max = map.get(keylist.get(i));
      }
    }
    for(int i = 0; i < output.size(); i++){
      System.out.println(output.get(i));
    }
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc TreeMap<String,Integer> map = new TreeMap<>(); map new TreeMap<>() for(int i = 0; i < n; i++){
      String key = sc.next();
      if(map.get(key) == null){
        map.put(key,0);
      }else{
          map.put(key, map.get(key) + 1);
      }
    } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
      String key = sc.next();
      if(map.get(key) == null){
        map.put(key,0);
      }else{
          map.put(key, map.get(key) + 1);
      }
    } {
      String key = sc.next();
      if(map.get(key) == null){
        map.put(key,0);
      }else{
          map.put(key, map.get(key) + 1);
      }
    } String key = sc.next(); key sc.next() sc.next sc if(map.get(key) == null){
        map.put(key,0);
      }else{
          map.put(key, map.get(key) + 1);
      } map.get(key) == null map.get(key) map.get map key null {
        map.put(key,0);
      } map.put(key,0) map.put map key 0 {
          map.put(key, map.get(key) + 1);
      } map.put(key, map.get(key) + 1) map.put map key map.get(key) + 1 map.get(key) map.get map key 1 List<String> keylist = new ArrayList<>(map.keySet()); keylist new ArrayList<>(map.keySet()) List<String> output = new ArrayList<>(); output new ArrayList<>() int max = 0; max 0 for(int i = 0; i < keylist.size(); i++){
      if(map.get(keylist.get(i)) > max){
        output.clear();
        output.add(keylist.get(i));
        max = map.get(keylist.get(i));
      }else if(map.get(keylist.get(i)) == max){
        output.add(keylist.get(i));
        max = map.get(keylist.get(i));
      }
    } int i = 0; int i = 0; i 0 i < keylist.size() i keylist.size() keylist.size keylist i++ i++ i {
      if(map.get(keylist.get(i)) > max){
        output.clear();
        output.add(keylist.get(i));
        max = map.get(keylist.get(i));
      }else if(map.get(keylist.get(i)) == max){
        output.add(keylist.get(i));
        max = map.get(keylist.get(i));
      }
    } {
      if(map.get(keylist.get(i)) > max){
        output.clear();
        output.add(keylist.get(i));
        max = map.get(keylist.get(i));
      }else if(map.get(keylist.get(i)) == max){
        output.add(keylist.get(i));
        max = map.get(keylist.get(i));
      }
    } if(map.get(keylist.get(i)) > max){
        output.clear();
        output.add(keylist.get(i));
        max = map.get(keylist.get(i));
      }else if(map.get(keylist.get(i)) == max){
        output.add(keylist.get(i));
        max = map.get(keylist.get(i));
      } map.get(keylist.get(i)) > max map.get(keylist.get(i)) map.get map keylist.get(i) keylist.get keylist i max {
        output.clear();
        output.add(keylist.get(i));
        max = map.get(keylist.get(i));
      } output.clear() output.clear output output.add(keylist.get(i)) output.add output keylist.get(i) keylist.get keylist i max = map.get(keylist.get(i)) max map.get(keylist.get(i)) map.get map keylist.get(i) keylist.get keylist i if(map.get(keylist.get(i)) == max){
        output.add(keylist.get(i));
        max = map.get(keylist.get(i));
      } map.get(keylist.get(i)) == max map.get(keylist.get(i)) map.get map keylist.get(i) keylist.get keylist i max {
        output.add(keylist.get(i));
        max = map.get(keylist.get(i));
      } output.add(keylist.get(i)) output.add output keylist.get(i) keylist.get keylist i max = map.get(keylist.get(i)) max map.get(keylist.get(i)) map.get map keylist.get(i) keylist.get keylist i for(int i = 0; i < output.size(); i++){
      System.out.println(output.get(i));
    } int i = 0; int i = 0; i 0 i < output.size() i output.size() output.size output i++ i++ i {
      System.out.println(output.get(i));
    } {
      System.out.println(output.get(i));
    } System.out.println(output.get(i)) System.out.println System.out System System.out output.get(i) output.get output i String[] args args
import java.util.ArrayList;
import java.util.TreeMap;
import java.util.List;
import java.util.Scanner;
class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    TreeMap<String,Integer> map = new TreeMap<>();
    for(int i = 0; i < n; i++){
      String key = sc.next();
      if(map.get(key) == null){
        map.put(key,0);
      }else{
          map.put(key, map.get(key) + 1);
      }
    }
    List<String> keylist = new ArrayList<>(map.keySet());
    List<String> output = new ArrayList<>();
    int max = 0;
    for(int i = 0; i < keylist.size(); i++){
      if(map.get(keylist.get(i)) > max){
        output.clear();
        output.add(keylist.get(i));
        max = map.get(keylist.get(i));
      }else if(map.get(keylist.get(i)) == max){
        output.add(keylist.get(i));
        max = map.get(keylist.get(i));
      }
    }
    for(int i = 0; i < output.size(); i++){
      System.out.println(output.get(i));
    }
  }
}