import java.util.*;
public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    //文字用
    String s[] = new String[n];
    //数える用
    int num[] = new int[n];

    for(int i = 0 ; i < n ; ++i){
      s[i] = sc.next();
      num[i] = 0;
    }
    //ソートする
    Arrays.sort(s);
    //数える用
    int count = 0;
    //多いの判断用
    int max = 0;
    
    for(int i = 0 ; i < n ; ++i){
      for(int j = i+1 ; j < n ; ++j){
        if(s[i].equals(s[j])){
          count++;
          num[j] = count;
        }else{
          break;
        }
      }
      if(i+count > i){
        i += count;
      }
      count = 0;
    }
    
    for(int i = 0 ; i < n ; ++i){
      max = Math.max(num[i],max);
    }
    
    for(int i = 0 ; i < n ; ++i){
      if(num[i] == max){
       System.out.println(s[i]);
      }

    }

    
  }
} import java.util.*; util.* java public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    //文字用
    String s[] = new String[n];
    //数える用
    int num[] = new int[n];

    for(int i = 0 ; i < n ; ++i){
      s[i] = sc.next();
      num[i] = 0;
    }
    //ソートする
    Arrays.sort(s);
    //数える用
    int count = 0;
    //多いの判断用
    int max = 0;
    
    for(int i = 0 ; i < n ; ++i){
      for(int j = i+1 ; j < n ; ++j){
        if(s[i].equals(s[j])){
          count++;
          num[j] = count;
        }else{
          break;
        }
      }
      if(i+count > i){
        i += count;
      }
      count = 0;
    }
    
    for(int i = 0 ; i < n ; ++i){
      max = Math.max(num[i],max);
    }
    
    for(int i = 0 ; i < n ; ++i){
      if(num[i] == max){
       System.out.println(s[i]);
      }

    }

    
  }
} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    //文字用
    String s[] = new String[n];
    //数える用
    int num[] = new int[n];

    for(int i = 0 ; i < n ; ++i){
      s[i] = sc.next();
      num[i] = 0;
    }
    //ソートする
    Arrays.sort(s);
    //数える用
    int count = 0;
    //多いの判断用
    int max = 0;
    
    for(int i = 0 ; i < n ; ++i){
      for(int j = i+1 ; j < n ; ++j){
        if(s[i].equals(s[j])){
          count++;
          num[j] = count;
        }else{
          break;
        }
      }
      if(i+count > i){
        i += count;
      }
      count = 0;
    }
    
    for(int i = 0 ; i < n ; ++i){
      max = Math.max(num[i],max);
    }
    
    for(int i = 0 ; i < n ; ++i){
      if(num[i] == max){
       System.out.println(s[i]);
      }

    }

    
  } main {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    //文字用
    String s[] = new String[n];
    //数える用
    int num[] = new int[n];

    for(int i = 0 ; i < n ; ++i){
      s[i] = sc.next();
      num[i] = 0;
    }
    //ソートする
    Arrays.sort(s);
    //数える用
    int count = 0;
    //多いの判断用
    int max = 0;
    
    for(int i = 0 ; i < n ; ++i){
      for(int j = i+1 ; j < n ; ++j){
        if(s[i].equals(s[j])){
          count++;
          num[j] = count;
        }else{
          break;
        }
      }
      if(i+count > i){
        i += count;
      }
      count = 0;
    }
    
    for(int i = 0 ; i < n ; ++i){
      max = Math.max(num[i],max);
    }
    
    for(int i = 0 ; i < n ; ++i){
      if(num[i] == max){
       System.out.println(s[i]);
      }

    }

    
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc String s[] = new String[n]; s new String[n] n int num[] = new int[n]; num new int[n] n for(int i = 0 ; i < n ; ++i){
      s[i] = sc.next();
      num[i] = 0;
    } int i = 0 ; int i = 0 ; i 0 i < n i n ++i ++i i {
      s[i] = sc.next();
      num[i] = 0;
    } {
      s[i] = sc.next();
      num[i] = 0;
    } s[i] = sc.next() s[i] s i sc.next() sc.next sc num[i] = 0 num[i] num i 0 Arrays.sort(s) Arrays.sort Arrays s int count = 0; count 0 int max = 0; max 0 for(int i = 0 ; i < n ; ++i){
      for(int j = i+1 ; j < n ; ++j){
        if(s[i].equals(s[j])){
          count++;
          num[j] = count;
        }else{
          break;
        }
      }
      if(i+count > i){
        i += count;
      }
      count = 0;
    } int i = 0 ; int i = 0 ; i 0 i < n i n ++i ++i i {
      for(int j = i+1 ; j < n ; ++j){
        if(s[i].equals(s[j])){
          count++;
          num[j] = count;
        }else{
          break;
        }
      }
      if(i+count > i){
        i += count;
      }
      count = 0;
    } {
      for(int j = i+1 ; j < n ; ++j){
        if(s[i].equals(s[j])){
          count++;
          num[j] = count;
        }else{
          break;
        }
      }
      if(i+count > i){
        i += count;
      }
      count = 0;
    } for(int j = i+1 ; j < n ; ++j){
        if(s[i].equals(s[j])){
          count++;
          num[j] = count;
        }else{
          break;
        }
      } int j = i+1 ; int j = i+1 ; j i+1 i 1 j < n j n ++j ++j j {
        if(s[i].equals(s[j])){
          count++;
          num[j] = count;
        }else{
          break;
        }
      } {
        if(s[i].equals(s[j])){
          count++;
          num[j] = count;
        }else{
          break;
        }
      } if(s[i].equals(s[j])){
          count++;
          num[j] = count;
        }else{
          break;
        } s[i].equals(s[j]) s[i].equals s[i] s i s[j] s j {
          count++;
          num[j] = count;
        } count++ count num[j] = count num[j] num j count {
          break;
        } break; if(i+count > i){
        i += count;
      } i+count > i i+count i count i {
        i += count;
      } i += count i count count = 0 count 0 for(int i = 0 ; i < n ; ++i){
      max = Math.max(num[i],max);
    } int i = 0 ; int i = 0 ; i 0 i < n i n ++i ++i i {
      max = Math.max(num[i],max);
    } {
      max = Math.max(num[i],max);
    } max = Math.max(num[i],max) max Math.max(num[i],max) Math.max Math num[i] num i max for(int i = 0 ; i < n ; ++i){
      if(num[i] == max){
       System.out.println(s[i]);
      }

    } int i = 0 ; int i = 0 ; i 0 i < n i n ++i ++i i {
      if(num[i] == max){
       System.out.println(s[i]);
      }

    } {
      if(num[i] == max){
       System.out.println(s[i]);
      }

    } if(num[i] == max){
       System.out.println(s[i]);
      } num[i] == max num[i] num i max {
       System.out.println(s[i]);
      } System.out.println(s[i]) System.out.println System.out System System.out s[i] s i String[] args args public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    //文字用
    String s[] = new String[n];
    //数える用
    int num[] = new int[n];

    for(int i = 0 ; i < n ; ++i){
      s[i] = sc.next();
      num[i] = 0;
    }
    //ソートする
    Arrays.sort(s);
    //数える用
    int count = 0;
    //多いの判断用
    int max = 0;
    
    for(int i = 0 ; i < n ; ++i){
      for(int j = i+1 ; j < n ; ++j){
        if(s[i].equals(s[j])){
          count++;
          num[j] = count;
        }else{
          break;
        }
      }
      if(i+count > i){
        i += count;
      }
      count = 0;
    }
    
    for(int i = 0 ; i < n ; ++i){
      max = Math.max(num[i],max);
    }
    
    for(int i = 0 ; i < n ; ++i){
      if(num[i] == max){
       System.out.println(s[i]);
      }

    }

    
  }
} public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    //文字用
    String s[] = new String[n];
    //数える用
    int num[] = new int[n];

    for(int i = 0 ; i < n ; ++i){
      s[i] = sc.next();
      num[i] = 0;
    }
    //ソートする
    Arrays.sort(s);
    //数える用
    int count = 0;
    //多いの判断用
    int max = 0;
    
    for(int i = 0 ; i < n ; ++i){
      for(int j = i+1 ; j < n ; ++j){
        if(s[i].equals(s[j])){
          count++;
          num[j] = count;
        }else{
          break;
        }
      }
      if(i+count > i){
        i += count;
      }
      count = 0;
    }
    
    for(int i = 0 ; i < n ; ++i){
      max = Math.max(num[i],max);
    }
    
    for(int i = 0 ; i < n ; ++i){
      if(num[i] == max){
       System.out.println(s[i]);
      }

    }

    
  }
} Main
import java.util.*;
public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    //文字用
    String s[] = new String[n];
    //数える用
    int num[] = new int[n];

    for(int i = 0 ; i < n ; ++i){
      s[i] = sc.next();
      num[i] = 0;
    }
    //ソートする
    Arrays.sort(s);
    //数える用
    int count = 0;
    //多いの判断用
    int max = 0;
    
    for(int i = 0 ; i < n ; ++i){
      for(int j = i+1 ; j < n ; ++j){
        if(s[i].equals(s[j])){
          count++;
          num[j] = count;
        }else{
          break;
        }
      }
      if(i+count > i){
        i += count;
      }
      count = 0;
    }
    
    for(int i = 0 ; i < n ; ++i){
      max = Math.max(num[i],max);
    }
    
    for(int i = 0 ; i < n ; ++i){
      if(num[i] == max){
       System.out.println(s[i]);
      }

    }

    
  }
}