import java.util.*;

public class Main{

  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);

    int n = Integer.parseInt(sc.next());

    String[] a = new String[n];
    int[] b = new int[n];

    for (int i=0; i<n; i++){
      a[i] = sc.next();
    }


    Arrays.sort(a);
    b[0] = 1;
    for (int i=1;i<n;i++){
      if(a[i].equals(a[i-1]))
        b[i] = b[i-1] + 1;
      else
        b[i] = 1;
    }
    int max = b[0];
    for(int i=0;i<n;i++){
      if (max<b[i])
        max = b[i];
    }

    for (int i=0; i<n; i++){
      if (b[i] == max)
        System.out.println(a[i]);
    }
  }
} import java.util.*; util.* java public class Main{

  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);

    int n = Integer.parseInt(sc.next());

    String[] a = new String[n];
    int[] b = new int[n];

    for (int i=0; i<n; i++){
      a[i] = sc.next();
    }


    Arrays.sort(a);
    b[0] = 1;
    for (int i=1;i<n;i++){
      if(a[i].equals(a[i-1]))
        b[i] = b[i-1] + 1;
      else
        b[i] = 1;
    }
    int max = b[0];
    for(int i=0;i<n;i++){
      if (max<b[i])
        max = b[i];
    }

    for (int i=0; i<n; i++){
      if (b[i] == max)
        System.out.println(a[i]);
    }
  }
} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);

    int n = Integer.parseInt(sc.next());

    String[] a = new String[n];
    int[] b = new int[n];

    for (int i=0; i<n; i++){
      a[i] = sc.next();
    }


    Arrays.sort(a);
    b[0] = 1;
    for (int i=1;i<n;i++){
      if(a[i].equals(a[i-1]))
        b[i] = b[i-1] + 1;
      else
        b[i] = 1;
    }
    int max = b[0];
    for(int i=0;i<n;i++){
      if (max<b[i])
        max = b[i];
    }

    for (int i=0; i<n; i++){
      if (b[i] == max)
        System.out.println(a[i]);
    }
  } main {
    Scanner sc = new Scanner(System.in);

    int n = Integer.parseInt(sc.next());

    String[] a = new String[n];
    int[] b = new int[n];

    for (int i=0; i<n; i++){
      a[i] = sc.next();
    }


    Arrays.sort(a);
    b[0] = 1;
    for (int i=1;i<n;i++){
      if(a[i].equals(a[i-1]))
        b[i] = b[i-1] + 1;
      else
        b[i] = 1;
    }
    int max = b[0];
    for(int i=0;i<n;i++){
      if (max<b[i])
        max = b[i];
    }

    for (int i=0; i<n; i++){
      if (b[i] == max)
        System.out.println(a[i]);
    }
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = Integer.parseInt(sc.next()); n Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc String[] a = new String[n]; a new String[n] n int[] b = new int[n]; b new int[n] n for (int i=0; i<n; i++){
      a[i] = sc.next();
    } int i=0; int i=0; i 0 i<n i n i++ i++ i {
      a[i] = sc.next();
    } {
      a[i] = sc.next();
    } a[i] = sc.next() a[i] a i sc.next() sc.next sc Arrays.sort(a) Arrays.sort Arrays a b[0] = 1 b[0] b 0 1 for (int i=1;i<n;i++){
      if(a[i].equals(a[i-1]))
        b[i] = b[i-1] + 1;
      else
        b[i] = 1;
    } int i=1; int i=1; i 1 i<n i n i++ i++ i {
      if(a[i].equals(a[i-1]))
        b[i] = b[i-1] + 1;
      else
        b[i] = 1;
    } {
      if(a[i].equals(a[i-1]))
        b[i] = b[i-1] + 1;
      else
        b[i] = 1;
    } if(a[i].equals(a[i-1]))
        b[i] = b[i-1] + 1;
      else
        b[i] = 1; a[i].equals(a[i-1]) a[i].equals a[i] a i a[i-1] a i-1 i 1 b[i] = b[i-1] + 1 b[i] b i b[i-1] + 1 b[i-1] b i-1 i 1 1 b[i] = 1 b[i] b i 1 int max = b[0]; max b[0] b 0 for(int i=0;i<n;i++){
      if (max<b[i])
        max = b[i];
    } int i=0; int i=0; i 0 i<n i n i++ i++ i {
      if (max<b[i])
        max = b[i];
    } {
      if (max<b[i])
        max = b[i];
    } if (max<b[i])
        max = b[i]; max<b[i] max b[i] b i max = b[i] max b[i] b i for (int i=0; i<n; i++){
      if (b[i] == max)
        System.out.println(a[i]);
    } int i=0; int i=0; i 0 i<n i n i++ i++ i {
      if (b[i] == max)
        System.out.println(a[i]);
    } {
      if (b[i] == max)
        System.out.println(a[i]);
    } if (b[i] == max)
        System.out.println(a[i]); b[i] == max b[i] b i max System.out.println(a[i]) System.out.println System.out System System.out a[i] a i String[] args args public class Main{

  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);

    int n = Integer.parseInt(sc.next());

    String[] a = new String[n];
    int[] b = new int[n];

    for (int i=0; i<n; i++){
      a[i] = sc.next();
    }


    Arrays.sort(a);
    b[0] = 1;
    for (int i=1;i<n;i++){
      if(a[i].equals(a[i-1]))
        b[i] = b[i-1] + 1;
      else
        b[i] = 1;
    }
    int max = b[0];
    for(int i=0;i<n;i++){
      if (max<b[i])
        max = b[i];
    }

    for (int i=0; i<n; i++){
      if (b[i] == max)
        System.out.println(a[i]);
    }
  }
} public class Main{

  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);

    int n = Integer.parseInt(sc.next());

    String[] a = new String[n];
    int[] b = new int[n];

    for (int i=0; i<n; i++){
      a[i] = sc.next();
    }


    Arrays.sort(a);
    b[0] = 1;
    for (int i=1;i<n;i++){
      if(a[i].equals(a[i-1]))
        b[i] = b[i-1] + 1;
      else
        b[i] = 1;
    }
    int max = b[0];
    for(int i=0;i<n;i++){
      if (max<b[i])
        max = b[i];
    }

    for (int i=0; i<n; i++){
      if (b[i] == max)
        System.out.println(a[i]);
    }
  }
} Main
import java.util.*;

public class Main{

  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);

    int n = Integer.parseInt(sc.next());

    String[] a = new String[n];
    int[] b = new int[n];

    for (int i=0; i<n; i++){
      a[i] = sc.next();
    }


    Arrays.sort(a);
    b[0] = 1;
    for (int i=1;i<n;i++){
      if(a[i].equals(a[i-1]))
        b[i] = b[i-1] + 1;
      else
        b[i] = 1;
    }
    int max = b[0];
    for(int i=0;i<n;i++){
      if (max<b[i])
        max = b[i];
    }

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