import java.util.*;
import java.math.*;

public class Main {

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

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

    Arrays.sort(s);

    int[] c = new int[n];
    int max = 0;

    for (int i = 0; i < n-1; i++) {
      if (s[i].equals(s[i+1])) {
        c[i+1] += c[i] + 1;
        max = Math.max(max,c[i+1]);
      }
    }

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


  }

} import java.util.*; util.* java import java.math.*; math.* 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];

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

    Arrays.sort(s);

    int[] c = new int[n];
    int max = 0;

    for (int i = 0; i < n-1; i++) {
      if (s[i].equals(s[i+1])) {
        c[i+1] += c[i] + 1;
        max = Math.max(max,c[i+1]);
      }
    }

    for (int i = 0; i < n; i++) {
      if (c[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];

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

    Arrays.sort(s);

    int[] c = new int[n];
    int max = 0;

    for (int i = 0; i < n-1; i++) {
      if (s[i].equals(s[i+1])) {
        c[i+1] += c[i] + 1;
        max = Math.max(max,c[i+1]);
      }
    }

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


  } main {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    String[] s = new String[n];

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

    Arrays.sort(s);

    int[] c = new int[n];
    int max = 0;

    for (int i = 0; i < n-1; i++) {
      if (s[i].equals(s[i+1])) {
        c[i+1] += c[i] + 1;
        max = Math.max(max,c[i+1]);
      }
    }

    for (int i = 0; i < n; i++) {
      if (c[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 for (int i = 0; i < n; i++) {
      s[i] = sc.next();
    } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
      s[i] = sc.next();
    } {
      s[i] = sc.next();
    } s[i] = sc.next() s[i] s i sc.next() sc.next sc Arrays.sort(s) Arrays.sort Arrays s int[] c = new int[n]; c new int[n] n int max = 0; max 0 for (int i = 0; i < n-1; i++) {
      if (s[i].equals(s[i+1])) {
        c[i+1] += c[i] + 1;
        max = Math.max(max,c[i+1]);
      }
    } int i = 0; int i = 0; i 0 i < n-1 i n-1 n 1 i++ i++ i {
      if (s[i].equals(s[i+1])) {
        c[i+1] += c[i] + 1;
        max = Math.max(max,c[i+1]);
      }
    } {
      if (s[i].equals(s[i+1])) {
        c[i+1] += c[i] + 1;
        max = Math.max(max,c[i+1]);
      }
    } if (s[i].equals(s[i+1])) {
        c[i+1] += c[i] + 1;
        max = Math.max(max,c[i+1]);
      } s[i].equals(s[i+1]) s[i].equals s[i] s i s[i+1] s i+1 i 1 {
        c[i+1] += c[i] + 1;
        max = Math.max(max,c[i+1]);
      } c[i+1] += c[i] + 1 c[i+1] c i+1 i 1 c[i] + 1 c[i] c i 1 max = Math.max(max,c[i+1]) max Math.max(max,c[i+1]) Math.max Math max c[i+1] c i+1 i 1 for (int i = 0; i < n; i++) {
      if (c[i] == max) {
        System.out.println(s[i]);
      }
    } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
      if (c[i] == max) {
        System.out.println(s[i]);
      }
    } {
      if (c[i] == max) {
        System.out.println(s[i]);
      }
    } if (c[i] == max) {
        System.out.println(s[i]);
      } c[i] == max c[i] c 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];

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

    Arrays.sort(s);

    int[] c = new int[n];
    int max = 0;

    for (int i = 0; i < n-1; i++) {
      if (s[i].equals(s[i+1])) {
        c[i+1] += c[i] + 1;
        max = Math.max(max,c[i+1]);
      }
    }

    for (int i = 0; i < n; i++) {
      if (c[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];

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

    Arrays.sort(s);

    int[] c = new int[n];
    int max = 0;

    for (int i = 0; i < n-1; i++) {
      if (s[i].equals(s[i+1])) {
        c[i+1] += c[i] + 1;
        max = Math.max(max,c[i+1]);
      }
    }

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


  }

} Main
import java.util.*;
import java.math.*;

public class Main {

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

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

    Arrays.sort(s);

    int[] c = new int[n];
    int max = 0;

    for (int i = 0; i < n-1; i++) {
      if (s[i].equals(s[i+1])) {
        c[i+1] += c[i] + 1;
        max = Math.max(max,c[i+1]);
      }
    }

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


  }

}
