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

public class Main{
  public static void main(String[] args)throws Exception{
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    try{
      int N = Integer.parseInt(br.readLine());
      Map<String, Integer> map = new HashMap<>();
      int max = 1;
      for(int i = 0; i < N; i++){
        String S = br.readLine();
        if(map.containsKey(S)){
          int m = map.get(S)+1;
          map.put(S, m);
          max = Math.max(max, m);
        }else{
          map.put(S, 1);
        }
      }
      
      List<String> list = new ArrayList<>();
      for(Map.Entry<String, Integer> en : map.entrySet()){
        if(en.getValue() == max){
          list.add(en.getKey());
        }
      }
      
      Collections.sort(list);
      for(String s : list){
        System.out.println(s);
      }
    }catch(Exception e){
    }
  }
} import java.util.*; util.* java import java.io.*; io.* java public class Main{
  public static void main(String[] args)throws Exception{
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    try{
      int N = Integer.parseInt(br.readLine());
      Map<String, Integer> map = new HashMap<>();
      int max = 1;
      for(int i = 0; i < N; i++){
        String S = br.readLine();
        if(map.containsKey(S)){
          int m = map.get(S)+1;
          map.put(S, m);
          max = Math.max(max, m);
        }else{
          map.put(S, 1);
        }
      }
      
      List<String> list = new ArrayList<>();
      for(Map.Entry<String, Integer> en : map.entrySet()){
        if(en.getValue() == max){
          list.add(en.getKey());
        }
      }
      
      Collections.sort(list);
      for(String s : list){
        System.out.println(s);
      }
    }catch(Exception e){
    }
  }
} Main public static void main(String[] args)throws Exception{
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    try{
      int N = Integer.parseInt(br.readLine());
      Map<String, Integer> map = new HashMap<>();
      int max = 1;
      for(int i = 0; i < N; i++){
        String S = br.readLine();
        if(map.containsKey(S)){
          int m = map.get(S)+1;
          map.put(S, m);
          max = Math.max(max, m);
        }else{
          map.put(S, 1);
        }
      }
      
      List<String> list = new ArrayList<>();
      for(Map.Entry<String, Integer> en : map.entrySet()){
        if(en.getValue() == max){
          list.add(en.getKey());
        }
      }
      
      Collections.sort(list);
      for(String s : list){
        System.out.println(s);
      }
    }catch(Exception e){
    }
  } main {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    try{
      int N = Integer.parseInt(br.readLine());
      Map<String, Integer> map = new HashMap<>();
      int max = 1;
      for(int i = 0; i < N; i++){
        String S = br.readLine();
        if(map.containsKey(S)){
          int m = map.get(S)+1;
          map.put(S, m);
          max = Math.max(max, m);
        }else{
          map.put(S, 1);
        }
      }
      
      List<String> list = new ArrayList<>();
      for(Map.Entry<String, Integer> en : map.entrySet()){
        if(en.getValue() == max){
          list.add(en.getKey());
        }
      }
      
      Collections.sort(list);
      for(String s : list){
        System.out.println(s);
      }
    }catch(Exception e){
    }
  } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) try{
      int N = Integer.parseInt(br.readLine());
      Map<String, Integer> map = new HashMap<>();
      int max = 1;
      for(int i = 0; i < N; i++){
        String S = br.readLine();
        if(map.containsKey(S)){
          int m = map.get(S)+1;
          map.put(S, m);
          max = Math.max(max, m);
        }else{
          map.put(S, 1);
        }
      }
      
      List<String> list = new ArrayList<>();
      for(Map.Entry<String, Integer> en : map.entrySet()){
        if(en.getValue() == max){
          list.add(en.getKey());
        }
      }
      
      Collections.sort(list);
      for(String s : list){
        System.out.println(s);
      }
    }catch(Exception e){
    } catch(Exception e){
    } Exception e {
    } {
      int N = Integer.parseInt(br.readLine());
      Map<String, Integer> map = new HashMap<>();
      int max = 1;
      for(int i = 0; i < N; i++){
        String S = br.readLine();
        if(map.containsKey(S)){
          int m = map.get(S)+1;
          map.put(S, m);
          max = Math.max(max, m);
        }else{
          map.put(S, 1);
        }
      }
      
      List<String> list = new ArrayList<>();
      for(Map.Entry<String, Integer> en : map.entrySet()){
        if(en.getValue() == max){
          list.add(en.getKey());
        }
      }
      
      Collections.sort(list);
      for(String s : list){
        System.out.println(s);
      }
    } int N = Integer.parseInt(br.readLine()); N Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br Map<String, Integer> map = new HashMap<>(); map new HashMap<>() int max = 1; max 1 for(int i = 0; i < N; i++){
        String S = br.readLine();
        if(map.containsKey(S)){
          int m = map.get(S)+1;
          map.put(S, m);
          max = Math.max(max, m);
        }else{
          map.put(S, 1);
        }
      } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
        String S = br.readLine();
        if(map.containsKey(S)){
          int m = map.get(S)+1;
          map.put(S, m);
          max = Math.max(max, m);
        }else{
          map.put(S, 1);
        }
      } {
        String S = br.readLine();
        if(map.containsKey(S)){
          int m = map.get(S)+1;
          map.put(S, m);
          max = Math.max(max, m);
        }else{
          map.put(S, 1);
        }
      } String S = br.readLine(); S br.readLine() br.readLine br if(map.containsKey(S)){
          int m = map.get(S)+1;
          map.put(S, m);
          max = Math.max(max, m);
        }else{
          map.put(S, 1);
        } map.containsKey(S) map.containsKey map S {
          int m = map.get(S)+1;
          map.put(S, m);
          max = Math.max(max, m);
        } int m = map.get(S)+1; m map.get(S)+1 map.get(S) map.get map S 1 map.put(S, m) map.put map S m max = Math.max(max, m) max Math.max(max, m) Math.max Math max m {
          map.put(S, 1);
        } map.put(S, 1) map.put map S 1 List<String> list = new ArrayList<>(); list new ArrayList<>() for(Map.Entry<String, Integer> en : map.entrySet()){
        if(en.getValue() == max){
          list.add(en.getKey());
        }
      } Map.Entry<String, Integer> en map.entrySet() map.entrySet map {
        if(en.getValue() == max){
          list.add(en.getKey());
        }
      } {
        if(en.getValue() == max){
          list.add(en.getKey());
        }
      } if(en.getValue() == max){
          list.add(en.getKey());
        } en.getValue() == max en.getValue() en.getValue en max {
          list.add(en.getKey());
        } list.add(en.getKey()) list.add list en.getKey() en.getKey en 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)throws Exception{
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    try{
      int N = Integer.parseInt(br.readLine());
      Map<String, Integer> map = new HashMap<>();
      int max = 1;
      for(int i = 0; i < N; i++){
        String S = br.readLine();
        if(map.containsKey(S)){
          int m = map.get(S)+1;
          map.put(S, m);
          max = Math.max(max, m);
        }else{
          map.put(S, 1);
        }
      }
      
      List<String> list = new ArrayList<>();
      for(Map.Entry<String, Integer> en : map.entrySet()){
        if(en.getValue() == max){
          list.add(en.getKey());
        }
      }
      
      Collections.sort(list);
      for(String s : list){
        System.out.println(s);
      }
    }catch(Exception e){
    }
  }
} public class Main{
  public static void main(String[] args)throws Exception{
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    try{
      int N = Integer.parseInt(br.readLine());
      Map<String, Integer> map = new HashMap<>();
      int max = 1;
      for(int i = 0; i < N; i++){
        String S = br.readLine();
        if(map.containsKey(S)){
          int m = map.get(S)+1;
          map.put(S, m);
          max = Math.max(max, m);
        }else{
          map.put(S, 1);
        }
      }
      
      List<String> list = new ArrayList<>();
      for(Map.Entry<String, Integer> en : map.entrySet()){
        if(en.getValue() == max){
          list.add(en.getKey());
        }
      }
      
      Collections.sort(list);
      for(String s : list){
        System.out.println(s);
      }
    }catch(Exception e){
    }
  }
} Main
import java.util.*;
import java.io.*;

public class Main{
  public static void main(String[] args)throws Exception{
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    try{
      int N = Integer.parseInt(br.readLine());
      Map<String, Integer> map = new HashMap<>();
      int max = 1;
      for(int i = 0; i < N; i++){
        String S = br.readLine();
        if(map.containsKey(S)){
          int m = map.get(S)+1;
          map.put(S, m);
          max = Math.max(max, m);
        }else{
          map.put(S, 1);
        }
      }
      
      List<String> list = new ArrayList<>();
      for(Map.Entry<String, Integer> en : map.entrySet()){
        if(en.getValue() == max){
          list.add(en.getKey());
        }
      }
      
      Collections.sort(list);
      for(String s : list){
        System.out.println(s);
      }
    }catch(Exception e){
    }
  }
}