import java.io.*;
import java.util.*;

class Main{
    public static void main(String args[])throws IOException{
      try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in))){
        int N = Integer.parseInt(br.readLine());
        String[] str = new String[N];
        
        for(int i = 0; i < N; i++){
          str[i] = br.readLine();
        }

        Map<String, Integer> map = new HashMap<>();
        int value = 0;  
        int max = 1;     
        
        for(int i = 0; i < N; i++){
          if(map.size() == 0){
            map.put(str[i], 1);
          }else{
            if(map.containsKey(str[i])){
              value = map.get(str[i]);
              value += 1;
           
              if(max < value){
                max = value;
              }

              map.put(str[i], value);
            }else{
              map.put(str[i], 1);
            }
          }
        }

        List<String> list = new ArrayList<>();

        for(Map.Entry<String, Integer> entry : map.entrySet()){
          if(max == entry.getValue()){
            list.add(entry.getKey());
          }
        }

        Collections.sort(list);

        for (String string : list) {
          System.out.println(string);
        }

      }
    }
} import java.io.*; io.* java import java.util.*; util.* java class Main{
    public static void main(String args[])throws IOException{
      try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in))){
        int N = Integer.parseInt(br.readLine());
        String[] str = new String[N];
        
        for(int i = 0; i < N; i++){
          str[i] = br.readLine();
        }

        Map<String, Integer> map = new HashMap<>();
        int value = 0;  
        int max = 1;     
        
        for(int i = 0; i < N; i++){
          if(map.size() == 0){
            map.put(str[i], 1);
          }else{
            if(map.containsKey(str[i])){
              value = map.get(str[i]);
              value += 1;
           
              if(max < value){
                max = value;
              }

              map.put(str[i], value);
            }else{
              map.put(str[i], 1);
            }
          }
        }

        List<String> list = new ArrayList<>();

        for(Map.Entry<String, Integer> entry : map.entrySet()){
          if(max == entry.getValue()){
            list.add(entry.getKey());
          }
        }

        Collections.sort(list);

        for (String string : list) {
          System.out.println(string);
        }

      }
    }
} Main public static void main(String args[])throws IOException{
      try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in))){
        int N = Integer.parseInt(br.readLine());
        String[] str = new String[N];
        
        for(int i = 0; i < N; i++){
          str[i] = br.readLine();
        }

        Map<String, Integer> map = new HashMap<>();
        int value = 0;  
        int max = 1;     
        
        for(int i = 0; i < N; i++){
          if(map.size() == 0){
            map.put(str[i], 1);
          }else{
            if(map.containsKey(str[i])){
              value = map.get(str[i]);
              value += 1;
           
              if(max < value){
                max = value;
              }

              map.put(str[i], value);
            }else{
              map.put(str[i], 1);
            }
          }
        }

        List<String> list = new ArrayList<>();

        for(Map.Entry<String, Integer> entry : map.entrySet()){
          if(max == entry.getValue()){
            list.add(entry.getKey());
          }
        }

        Collections.sort(list);

        for (String string : list) {
          System.out.println(string);
        }

      }
    } main {
      try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in))){
        int N = Integer.parseInt(br.readLine());
        String[] str = new String[N];
        
        for(int i = 0; i < N; i++){
          str[i] = br.readLine();
        }

        Map<String, Integer> map = new HashMap<>();
        int value = 0;  
        int max = 1;     
        
        for(int i = 0; i < N; i++){
          if(map.size() == 0){
            map.put(str[i], 1);
          }else{
            if(map.containsKey(str[i])){
              value = map.get(str[i]);
              value += 1;
           
              if(max < value){
                max = value;
              }

              map.put(str[i], value);
            }else{
              map.put(str[i], 1);
            }
          }
        }

        List<String> list = new ArrayList<>();

        for(Map.Entry<String, Integer> entry : map.entrySet()){
          if(max == entry.getValue()){
            list.add(entry.getKey());
          }
        }

        Collections.sort(list);

        for (String string : list) {
          System.out.println(string);
        }

      }
    } try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in))){
        int N = Integer.parseInt(br.readLine());
        String[] str = new String[N];
        
        for(int i = 0; i < N; i++){
          str[i] = br.readLine();
        }

        Map<String, Integer> map = new HashMap<>();
        int value = 0;  
        int max = 1;     
        
        for(int i = 0; i < N; i++){
          if(map.size() == 0){
            map.put(str[i], 1);
          }else{
            if(map.containsKey(str[i])){
              value = map.get(str[i]);
              value += 1;
           
              if(max < value){
                max = value;
              }

              map.put(str[i], value);
            }else{
              map.put(str[i], 1);
            }
          }
        }

        List<String> list = new ArrayList<>();

        for(Map.Entry<String, Integer> entry : map.entrySet()){
          if(max == entry.getValue()){
            list.add(entry.getKey());
          }
        }

        Collections.sort(list);

        for (String string : list) {
          System.out.println(string);
        }

      } {
        int N = Integer.parseInt(br.readLine());
        String[] str = new String[N];
        
        for(int i = 0; i < N; i++){
          str[i] = br.readLine();
        }

        Map<String, Integer> map = new HashMap<>();
        int value = 0;  
        int max = 1;     
        
        for(int i = 0; i < N; i++){
          if(map.size() == 0){
            map.put(str[i], 1);
          }else{
            if(map.containsKey(str[i])){
              value = map.get(str[i]);
              value += 1;
           
              if(max < value){
                max = value;
              }

              map.put(str[i], value);
            }else{
              map.put(str[i], 1);
            }
          }
        }

        List<String> list = new ArrayList<>();

        for(Map.Entry<String, Integer> entry : map.entrySet()){
          if(max == entry.getValue()){
            list.add(entry.getKey());
          }
        }

        Collections.sort(list);

        for (String string : list) {
          System.out.println(string);
        }

      } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)) BufferedReader br = new BufferedReader(new InputStreamReader(System.in)) new BufferedReader(new InputStreamReader(System.in)) int N = Integer.parseInt(br.readLine()); N Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br String[] str = new String[N]; str new String[N] N for(int i = 0; i < N; i++){
          str[i] = br.readLine();
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
          str[i] = br.readLine();
        } {
          str[i] = br.readLine();
        } str[i] = br.readLine() str[i] str i br.readLine() br.readLine br Map<String, Integer> map = new HashMap<>(); map new HashMap<>() int value = 0; value 0 int max = 1; max 1 for(int i = 0; i < N; i++){
          if(map.size() == 0){
            map.put(str[i], 1);
          }else{
            if(map.containsKey(str[i])){
              value = map.get(str[i]);
              value += 1;
           
              if(max < value){
                max = value;
              }

              map.put(str[i], value);
            }else{
              map.put(str[i], 1);
            }
          }
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
          if(map.size() == 0){
            map.put(str[i], 1);
          }else{
            if(map.containsKey(str[i])){
              value = map.get(str[i]);
              value += 1;
           
              if(max < value){
                max = value;
              }

              map.put(str[i], value);
            }else{
              map.put(str[i], 1);
            }
          }
        } {
          if(map.size() == 0){
            map.put(str[i], 1);
          }else{
            if(map.containsKey(str[i])){
              value = map.get(str[i]);
              value += 1;
           
              if(max < value){
                max = value;
              }

              map.put(str[i], value);
            }else{
              map.put(str[i], 1);
            }
          }
        } if(map.size() == 0){
            map.put(str[i], 1);
          }else{
            if(map.containsKey(str[i])){
              value = map.get(str[i]);
              value += 1;
           
              if(max < value){
                max = value;
              }

              map.put(str[i], value);
            }else{
              map.put(str[i], 1);
            }
          } map.size() == 0 map.size() map.size map 0 {
            map.put(str[i], 1);
          } map.put(str[i], 1) map.put map str[i] str i 1 {
            if(map.containsKey(str[i])){
              value = map.get(str[i]);
              value += 1;
           
              if(max < value){
                max = value;
              }

              map.put(str[i], value);
            }else{
              map.put(str[i], 1);
            }
          } if(map.containsKey(str[i])){
              value = map.get(str[i]);
              value += 1;
           
              if(max < value){
                max = value;
              }

              map.put(str[i], value);
            }else{
              map.put(str[i], 1);
            } map.containsKey(str[i]) map.containsKey map str[i] str i {
              value = map.get(str[i]);
              value += 1;
           
              if(max < value){
                max = value;
              }

              map.put(str[i], value);
            } value = map.get(str[i]) value map.get(str[i]) map.get map str[i] str i value += 1 value 1 if(max < value){
                max = value;
              } max < value max value {
                max = value;
              } max = value max value map.put(str[i], value) map.put map str[i] str i value {
              map.put(str[i], 1);
            } map.put(str[i], 1) map.put map str[i] str i 1 List<String> list = new ArrayList<>(); list new ArrayList<>() for(Map.Entry<String, Integer> entry : map.entrySet()){
          if(max == entry.getValue()){
            list.add(entry.getKey());
          }
        } Map.Entry<String, Integer> entry map.entrySet() map.entrySet map {
          if(max == entry.getValue()){
            list.add(entry.getKey());
          }
        } {
          if(max == entry.getValue()){
            list.add(entry.getKey());
          }
        } if(max == entry.getValue()){
            list.add(entry.getKey());
          } max == entry.getValue() max entry.getValue() entry.getValue entry {
            list.add(entry.getKey());
          } list.add(entry.getKey()) list.add list entry.getKey() entry.getKey entry Collections.sort(list) Collections.sort Collections list for (String string : list) {
          System.out.println(string);
        } String string list {
          System.out.println(string);
        } {
          System.out.println(string);
        } System.out.println(string) System.out.println System.out System System.out string String args[] args
import java.io.*;
import java.util.*;

class Main{
    public static void main(String args[])throws IOException{
      try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in))){
        int N = Integer.parseInt(br.readLine());
        String[] str = new String[N];
        
        for(int i = 0; i < N; i++){
          str[i] = br.readLine();
        }

        Map<String, Integer> map = new HashMap<>();
        int value = 0;  
        int max = 1;     
        
        for(int i = 0; i < N; i++){
          if(map.size() == 0){
            map.put(str[i], 1);
          }else{
            if(map.containsKey(str[i])){
              value = map.get(str[i]);
              value += 1;
           
              if(max < value){
                max = value;
              }

              map.put(str[i], value);
            }else{
              map.put(str[i], 1);
            }
          }
        }

        List<String> list = new ArrayList<>();

        for(Map.Entry<String, Integer> entry : map.entrySet()){
          if(max == entry.getValue()){
            list.add(entry.getKey());
          }
        }

        Collections.sort(list);

        for (String string : list) {
          System.out.println(string);
        }

      }
    }
}