import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int num;
    Map<String, Integer> map = new HashMap<>();

    for(int i=0; i<n; i++){
      String s = sc.next();
      if(map.containsKey(s)){
        num = map.get(s) + 1;
        map.replace(s,num);
      }else{
        map.put(s,1);
      }
    }

    int count_max = 0;

    for(String key:map.keySet()){
      if(count_max<map.get(key)){
        count_max = map.get(key);
      }
    }

    ArrayList<String> list = new ArrayList<>();
    for(String key:map.keySet()){
      if(count_max==map.get(key)){
        list.add(key);
      }
    }

    Collections.sort(list);
    for(String s: list){
      System.out.println(s);
    }



  }
} import java.util.*; util.* java public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int num;
    Map<String, Integer> map = new HashMap<>();

    for(int i=0; i<n; i++){
      String s = sc.next();
      if(map.containsKey(s)){
        num = map.get(s) + 1;
        map.replace(s,num);
      }else{
        map.put(s,1);
      }
    }

    int count_max = 0;

    for(String key:map.keySet()){
      if(count_max<map.get(key)){
        count_max = map.get(key);
      }
    }

    ArrayList<String> list = new ArrayList<>();
    for(String key:map.keySet()){
      if(count_max==map.get(key)){
        list.add(key);
      }
    }

    Collections.sort(list);
    for(String s: list){
      System.out.println(s);
    }



  }
} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int num;
    Map<String, Integer> map = new HashMap<>();

    for(int i=0; i<n; i++){
      String s = sc.next();
      if(map.containsKey(s)){
        num = map.get(s) + 1;
        map.replace(s,num);
      }else{
        map.put(s,1);
      }
    }

    int count_max = 0;

    for(String key:map.keySet()){
      if(count_max<map.get(key)){
        count_max = map.get(key);
      }
    }

    ArrayList<String> list = new ArrayList<>();
    for(String key:map.keySet()){
      if(count_max==map.get(key)){
        list.add(key);
      }
    }

    Collections.sort(list);
    for(String s: list){
      System.out.println(s);
    }



  } main {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int num;
    Map<String, Integer> map = new HashMap<>();

    for(int i=0; i<n; i++){
      String s = sc.next();
      if(map.containsKey(s)){
        num = map.get(s) + 1;
        map.replace(s,num);
      }else{
        map.put(s,1);
      }
    }

    int count_max = 0;

    for(String key:map.keySet()){
      if(count_max<map.get(key)){
        count_max = map.get(key);
      }
    }

    ArrayList<String> list = new ArrayList<>();
    for(String key:map.keySet()){
      if(count_max==map.get(key)){
        list.add(key);
      }
    }

    Collections.sort(list);
    for(String s: list){
      System.out.println(s);
    }



  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int num; num Map<String, Integer> map = new HashMap<>(); map new HashMap<>() for(int i=0; i<n; i++){
      String s = sc.next();
      if(map.containsKey(s)){
        num = map.get(s) + 1;
        map.replace(s,num);
      }else{
        map.put(s,1);
      }
    } int i=0; int i=0; i 0 i<n i n i++ i++ i {
      String s = sc.next();
      if(map.containsKey(s)){
        num = map.get(s) + 1;
        map.replace(s,num);
      }else{
        map.put(s,1);
      }
    } {
      String s = sc.next();
      if(map.containsKey(s)){
        num = map.get(s) + 1;
        map.replace(s,num);
      }else{
        map.put(s,1);
      }
    } String s = sc.next(); s sc.next() sc.next sc if(map.containsKey(s)){
        num = map.get(s) + 1;
        map.replace(s,num);
      }else{
        map.put(s,1);
      } map.containsKey(s) map.containsKey map s {
        num = map.get(s) + 1;
        map.replace(s,num);
      } num = map.get(s) + 1 num map.get(s) + 1 map.get(s) map.get map s 1 map.replace(s,num) map.replace map s num {
        map.put(s,1);
      } map.put(s,1) map.put map s 1 int count_max = 0; count_max 0 for(String key:map.keySet()){
      if(count_max<map.get(key)){
        count_max = map.get(key);
      }
    } String key map.keySet() map.keySet map {
      if(count_max<map.get(key)){
        count_max = map.get(key);
      }
    } {
      if(count_max<map.get(key)){
        count_max = map.get(key);
      }
    } if(count_max<map.get(key)){
        count_max = map.get(key);
      } count_max<map.get(key) count_max map.get(key) map.get map key {
        count_max = map.get(key);
      } count_max = map.get(key) count_max map.get(key) map.get map key ArrayList<String> list = new ArrayList<>(); list new ArrayList<>() for(String key:map.keySet()){
      if(count_max==map.get(key)){
        list.add(key);
      }
    } String key map.keySet() map.keySet map {
      if(count_max==map.get(key)){
        list.add(key);
      }
    } {
      if(count_max==map.get(key)){
        list.add(key);
      }
    } if(count_max==map.get(key)){
        list.add(key);
      } count_max==map.get(key) count_max map.get(key) map.get map key {
        list.add(key);
      } list.add(key) list.add list key Collections.sort(list) Collections.sort Collections list for(String s: list){
      System.out.println(s);
    } String s list {
      System.out.println(s);
    } {
      System.out.println(s);
    } System.out.println(s) System.out.println System.out System System.out s String[] args args public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int num;
    Map<String, Integer> map = new HashMap<>();

    for(int i=0; i<n; i++){
      String s = sc.next();
      if(map.containsKey(s)){
        num = map.get(s) + 1;
        map.replace(s,num);
      }else{
        map.put(s,1);
      }
    }

    int count_max = 0;

    for(String key:map.keySet()){
      if(count_max<map.get(key)){
        count_max = map.get(key);
      }
    }

    ArrayList<String> list = new ArrayList<>();
    for(String key:map.keySet()){
      if(count_max==map.get(key)){
        list.add(key);
      }
    }

    Collections.sort(list);
    for(String s: list){
      System.out.println(s);
    }



  }
} public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int num;
    Map<String, Integer> map = new HashMap<>();

    for(int i=0; i<n; i++){
      String s = sc.next();
      if(map.containsKey(s)){
        num = map.get(s) + 1;
        map.replace(s,num);
      }else{
        map.put(s,1);
      }
    }

    int count_max = 0;

    for(String key:map.keySet()){
      if(count_max<map.get(key)){
        count_max = map.get(key);
      }
    }

    ArrayList<String> list = new ArrayList<>();
    for(String key:map.keySet()){
      if(count_max==map.get(key)){
        list.add(key);
      }
    }

    Collections.sort(list);
    for(String s: list){
      System.out.println(s);
    }



  }
} Main
import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int num;
    Map<String, Integer> map = new HashMap<>();

    for(int i=0; i<n; i++){
      String s = sc.next();
      if(map.containsKey(s)){
        num = map.get(s) + 1;
        map.replace(s,num);
      }else{
        map.put(s,1);
      }
    }

    int count_max = 0;

    for(String key:map.keySet()){
      if(count_max<map.get(key)){
        count_max = map.get(key);
      }
    }

    ArrayList<String> list = new ArrayList<>();
    for(String key:map.keySet()){
      if(count_max==map.get(key)){
        list.add(key);
      }
    }

    Collections.sort(list);
    for(String s: list){
      System.out.println(s);
    }



  }
}