import java.io.BufferedWriter;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.*;

public class Main {



    public static void main(String[] args) {
       Scanner sc = new Scanner(System.in);
      int test = sc.nextInt();
        HashMap<String,Integer> hm = new HashMap<>();
        int max =0; int count=0;
      for(int ii=0; ii<test; ii++) {
          String s = sc.next();
          if (hm.containsKey(s)) {
              Integer x = hm.get(s);
              x++;
              hm.put(s, x);
              if (x == max)
                  count++;
              if (x > max)
                  max = x;
          } else {
              hm.put(s, 1);
              if (1 == max)
                  count++;
              if (1 > max)
                  max = 1;
          }
      }
    List<String> al = new ArrayList<>();
      for(Map.Entry<String,Integer> map : hm.entrySet()){
          int y = map.getValue();
          if(y == max)
            al.add(map.getKey());
      }
      Collections.sort(al);
      for(String xx : al)
          System.out.println(xx);

    }
} import java.io.BufferedWriter; BufferedWriter java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.OutputStreamWriter; OutputStreamWriter java.io import java.util.*; util.* java public class Main {



    public static void main(String[] args) {
       Scanner sc = new Scanner(System.in);
      int test = sc.nextInt();
        HashMap<String,Integer> hm = new HashMap<>();
        int max =0; int count=0;
      for(int ii=0; ii<test; ii++) {
          String s = sc.next();
          if (hm.containsKey(s)) {
              Integer x = hm.get(s);
              x++;
              hm.put(s, x);
              if (x == max)
                  count++;
              if (x > max)
                  max = x;
          } else {
              hm.put(s, 1);
              if (1 == max)
                  count++;
              if (1 > max)
                  max = 1;
          }
      }
    List<String> al = new ArrayList<>();
      for(Map.Entry<String,Integer> map : hm.entrySet()){
          int y = map.getValue();
          if(y == max)
            al.add(map.getKey());
      }
      Collections.sort(al);
      for(String xx : al)
          System.out.println(xx);

    }
} Main public static void main(String[] args) {
       Scanner sc = new Scanner(System.in);
      int test = sc.nextInt();
        HashMap<String,Integer> hm = new HashMap<>();
        int max =0; int count=0;
      for(int ii=0; ii<test; ii++) {
          String s = sc.next();
          if (hm.containsKey(s)) {
              Integer x = hm.get(s);
              x++;
              hm.put(s, x);
              if (x == max)
                  count++;
              if (x > max)
                  max = x;
          } else {
              hm.put(s, 1);
              if (1 == max)
                  count++;
              if (1 > max)
                  max = 1;
          }
      }
    List<String> al = new ArrayList<>();
      for(Map.Entry<String,Integer> map : hm.entrySet()){
          int y = map.getValue();
          if(y == max)
            al.add(map.getKey());
      }
      Collections.sort(al);
      for(String xx : al)
          System.out.println(xx);

    } main {
       Scanner sc = new Scanner(System.in);
      int test = sc.nextInt();
        HashMap<String,Integer> hm = new HashMap<>();
        int max =0; int count=0;
      for(int ii=0; ii<test; ii++) {
          String s = sc.next();
          if (hm.containsKey(s)) {
              Integer x = hm.get(s);
              x++;
              hm.put(s, x);
              if (x == max)
                  count++;
              if (x > max)
                  max = x;
          } else {
              hm.put(s, 1);
              if (1 == max)
                  count++;
              if (1 > max)
                  max = 1;
          }
      }
    List<String> al = new ArrayList<>();
      for(Map.Entry<String,Integer> map : hm.entrySet()){
          int y = map.getValue();
          if(y == max)
            al.add(map.getKey());
      }
      Collections.sort(al);
      for(String xx : al)
          System.out.println(xx);

    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int test = sc.nextInt(); test sc.nextInt() sc.nextInt sc HashMap<String,Integer> hm = new HashMap<>(); hm new HashMap<>() int max =0; max 0 int count=0; count 0 for(int ii=0; ii<test; ii++) {
          String s = sc.next();
          if (hm.containsKey(s)) {
              Integer x = hm.get(s);
              x++;
              hm.put(s, x);
              if (x == max)
                  count++;
              if (x > max)
                  max = x;
          } else {
              hm.put(s, 1);
              if (1 == max)
                  count++;
              if (1 > max)
                  max = 1;
          }
      } int ii=0; int ii=0; ii 0 ii<test ii test ii++ ii++ ii {
          String s = sc.next();
          if (hm.containsKey(s)) {
              Integer x = hm.get(s);
              x++;
              hm.put(s, x);
              if (x == max)
                  count++;
              if (x > max)
                  max = x;
          } else {
              hm.put(s, 1);
              if (1 == max)
                  count++;
              if (1 > max)
                  max = 1;
          }
      } {
          String s = sc.next();
          if (hm.containsKey(s)) {
              Integer x = hm.get(s);
              x++;
              hm.put(s, x);
              if (x == max)
                  count++;
              if (x > max)
                  max = x;
          } else {
              hm.put(s, 1);
              if (1 == max)
                  count++;
              if (1 > max)
                  max = 1;
          }
      } String s = sc.next(); s sc.next() sc.next sc if (hm.containsKey(s)) {
              Integer x = hm.get(s);
              x++;
              hm.put(s, x);
              if (x == max)
                  count++;
              if (x > max)
                  max = x;
          } else {
              hm.put(s, 1);
              if (1 == max)
                  count++;
              if (1 > max)
                  max = 1;
          } hm.containsKey(s) hm.containsKey hm s {
              Integer x = hm.get(s);
              x++;
              hm.put(s, x);
              if (x == max)
                  count++;
              if (x > max)
                  max = x;
          } Integer x = hm.get(s); x hm.get(s) hm.get hm s x++ x hm.put(s, x) hm.put hm s x if (x == max)
                  count++; x == max x max count++ count if (x > max)
                  max = x; x > max x max max = x max x {
              hm.put(s, 1);
              if (1 == max)
                  count++;
              if (1 > max)
                  max = 1;
          } hm.put(s, 1) hm.put hm s 1 if (1 == max)
                  count++; 1 == max 1 max count++ count if (1 > max)
                  max = 1; 1 > max 1 max max = 1 max 1 List<String> al = new ArrayList<>(); al new ArrayList<>() for(Map.Entry<String,Integer> map : hm.entrySet()){
          int y = map.getValue();
          if(y == max)
            al.add(map.getKey());
      } Map.Entry<String,Integer> map hm.entrySet() hm.entrySet hm {
          int y = map.getValue();
          if(y == max)
            al.add(map.getKey());
      } {
          int y = map.getValue();
          if(y == max)
            al.add(map.getKey());
      } int y = map.getValue(); y map.getValue() map.getValue map if(y == max)
            al.add(map.getKey()); y == max y max al.add(map.getKey()) al.add al map.getKey() map.getKey map Collections.sort(al) Collections.sort Collections al for(String xx : al)
          System.out.println(xx); String xx al System.out.println(xx); System.out.println(xx) System.out.println System.out System System.out xx String[] args args public class Main {



    public static void main(String[] args) {
       Scanner sc = new Scanner(System.in);
      int test = sc.nextInt();
        HashMap<String,Integer> hm = new HashMap<>();
        int max =0; int count=0;
      for(int ii=0; ii<test; ii++) {
          String s = sc.next();
          if (hm.containsKey(s)) {
              Integer x = hm.get(s);
              x++;
              hm.put(s, x);
              if (x == max)
                  count++;
              if (x > max)
                  max = x;
          } else {
              hm.put(s, 1);
              if (1 == max)
                  count++;
              if (1 > max)
                  max = 1;
          }
      }
    List<String> al = new ArrayList<>();
      for(Map.Entry<String,Integer> map : hm.entrySet()){
          int y = map.getValue();
          if(y == max)
            al.add(map.getKey());
      }
      Collections.sort(al);
      for(String xx : al)
          System.out.println(xx);

    }
} public class Main {



    public static void main(String[] args) {
       Scanner sc = new Scanner(System.in);
      int test = sc.nextInt();
        HashMap<String,Integer> hm = new HashMap<>();
        int max =0; int count=0;
      for(int ii=0; ii<test; ii++) {
          String s = sc.next();
          if (hm.containsKey(s)) {
              Integer x = hm.get(s);
              x++;
              hm.put(s, x);
              if (x == max)
                  count++;
              if (x > max)
                  max = x;
          } else {
              hm.put(s, 1);
              if (1 == max)
                  count++;
              if (1 > max)
                  max = 1;
          }
      }
    List<String> al = new ArrayList<>();
      for(Map.Entry<String,Integer> map : hm.entrySet()){
          int y = map.getValue();
          if(y == max)
            al.add(map.getKey());
      }
      Collections.sort(al);
      for(String xx : al)
          System.out.println(xx);

    }
} Main
import java.io.BufferedWriter;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.*;

public class Main {



    public static void main(String[] args) {
       Scanner sc = new Scanner(System.in);
      int test = sc.nextInt();
        HashMap<String,Integer> hm = new HashMap<>();
        int max =0; int count=0;
      for(int ii=0; ii<test; ii++) {
          String s = sc.next();
          if (hm.containsKey(s)) {
              Integer x = hm.get(s);
              x++;
              hm.put(s, x);
              if (x == max)
                  count++;
              if (x > max)
                  max = x;
          } else {
              hm.put(s, 1);
              if (1 == max)
                  count++;
              if (1 > max)
                  max = 1;
          }
      }
    List<String> al = new ArrayList<>();
      for(Map.Entry<String,Integer> map : hm.entrySet()){
          int y = map.getValue();
          if(y == max)
            al.add(map.getKey());
      }
      Collections.sort(al);
      for(String xx : al)
          System.out.println(xx);

    }
}