import java.util.*;
// import java.util.stream.*;

public class Main {
  public static void main(String[] args) {
    Main main = new Main();
    // System.out.println(main.solve());
    main.solve();
  }

  int n;
  Map<String, Integer> map;

  public Main() {
    Scanner sc = new Scanner(System.in);
    try {
      n = sc.nextInt();
      map = new HashMap<String, Integer>();
      for (int i = 0; i < n; i++) {
        String s = sc.next();
        if (map.containsKey(s)) {
          map.put(s, map.get(s) + 1);
        } else {
          map.put(s, 0);
        }
      }
    } finally {
      sc.close();
    }
  }

  void solve() {
    int v = maxi();
    List<String> list = new ArrayList<String>();
    for (String s: map.keySet()) {
      if (map.get(s) == v) list.add(s);
    }
    Collections.sort(list);
    for (String s: list) {
      System.out.println(s);
    }
  }

  int maxi() {
    int ans = 0;
    for (String s: map.keySet()) {
      if (ans < map.get(s)) ans = map.get(s);
    }
    return ans;
  }
} import java.util.*; util.* java public class Main {
  public static void main(String[] args) {
    Main main = new Main();
    // System.out.println(main.solve());
    main.solve();
  }

  int n;
  Map<String, Integer> map;

  public Main() {
    Scanner sc = new Scanner(System.in);
    try {
      n = sc.nextInt();
      map = new HashMap<String, Integer>();
      for (int i = 0; i < n; i++) {
        String s = sc.next();
        if (map.containsKey(s)) {
          map.put(s, map.get(s) + 1);
        } else {
          map.put(s, 0);
        }
      }
    } finally {
      sc.close();
    }
  }

  void solve() {
    int v = maxi();
    List<String> list = new ArrayList<String>();
    for (String s: map.keySet()) {
      if (map.get(s) == v) list.add(s);
    }
    Collections.sort(list);
    for (String s: list) {
      System.out.println(s);
    }
  }

  int maxi() {
    int ans = 0;
    for (String s: map.keySet()) {
      if (ans < map.get(s)) ans = map.get(s);
    }
    return ans;
  }
} Main int n; n Map<String, Integer> map; map public static void main(String[] args) {
    Main main = new Main();
    // System.out.println(main.solve());
    main.solve();
  } main {
    Main main = new Main();
    // System.out.println(main.solve());
    main.solve();
  } Main main = new Main(); main new Main() main.solve() main.solve main String[] args args public Main() {
    Scanner sc = new Scanner(System.in);
    try {
      n = sc.nextInt();
      map = new HashMap<String, Integer>();
      for (int i = 0; i < n; i++) {
        String s = sc.next();
        if (map.containsKey(s)) {
          map.put(s, map.get(s) + 1);
        } else {
          map.put(s, 0);
        }
      }
    } finally {
      sc.close();
    }
  } Main {
    Scanner sc = new Scanner(System.in);
    try {
      n = sc.nextInt();
      map = new HashMap<String, Integer>();
      for (int i = 0; i < n; i++) {
        String s = sc.next();
        if (map.containsKey(s)) {
          map.put(s, map.get(s) + 1);
        } else {
          map.put(s, 0);
        }
      }
    } finally {
      sc.close();
    }
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) try {
      n = sc.nextInt();
      map = new HashMap<String, Integer>();
      for (int i = 0; i < n; i++) {
        String s = sc.next();
        if (map.containsKey(s)) {
          map.put(s, map.get(s) + 1);
        } else {
          map.put(s, 0);
        }
      }
    } finally {
      sc.close();
    } {
      sc.close();
    } sc.close() sc.close sc {
      n = sc.nextInt();
      map = new HashMap<String, Integer>();
      for (int i = 0; i < n; i++) {
        String s = sc.next();
        if (map.containsKey(s)) {
          map.put(s, map.get(s) + 1);
        } else {
          map.put(s, 0);
        }
      }
    } n = sc.nextInt() n sc.nextInt() sc.nextInt sc map = new HashMap<String, Integer>() map new HashMap<String, Integer>() for (int i = 0; i < n; i++) {
        String s = sc.next();
        if (map.containsKey(s)) {
          map.put(s, map.get(s) + 1);
        } else {
          map.put(s, 0);
        }
      } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
        String s = sc.next();
        if (map.containsKey(s)) {
          map.put(s, map.get(s) + 1);
        } else {
          map.put(s, 0);
        }
      } {
        String s = sc.next();
        if (map.containsKey(s)) {
          map.put(s, map.get(s) + 1);
        } else {
          map.put(s, 0);
        }
      } String s = sc.next(); s sc.next() sc.next sc if (map.containsKey(s)) {
          map.put(s, map.get(s) + 1);
        } else {
          map.put(s, 0);
        } map.containsKey(s) map.containsKey map s {
          map.put(s, map.get(s) + 1);
        } map.put(s, map.get(s) + 1) map.put map s map.get(s) + 1 map.get(s) map.get map s 1 {
          map.put(s, 0);
        } map.put(s, 0) map.put map s 0 void solve() {
    int v = maxi();
    List<String> list = new ArrayList<String>();
    for (String s: map.keySet()) {
      if (map.get(s) == v) list.add(s);
    }
    Collections.sort(list);
    for (String s: list) {
      System.out.println(s);
    }
  } solve {
    int v = maxi();
    List<String> list = new ArrayList<String>();
    for (String s: map.keySet()) {
      if (map.get(s) == v) list.add(s);
    }
    Collections.sort(list);
    for (String s: list) {
      System.out.println(s);
    }
  } int v = maxi(); v maxi() maxi List<String> list = new ArrayList<String>(); list new ArrayList<String>() for (String s: map.keySet()) {
      if (map.get(s) == v) list.add(s);
    } String s map.keySet() map.keySet map {
      if (map.get(s) == v) list.add(s);
    } {
      if (map.get(s) == v) list.add(s);
    } if (map.get(s) == v) list.add(s); map.get(s) == v map.get(s) map.get map s v list.add(s) list.add list s 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 int maxi() {
    int ans = 0;
    for (String s: map.keySet()) {
      if (ans < map.get(s)) ans = map.get(s);
    }
    return ans;
  } maxi {
    int ans = 0;
    for (String s: map.keySet()) {
      if (ans < map.get(s)) ans = map.get(s);
    }
    return ans;
  } int ans = 0; ans 0 for (String s: map.keySet()) {
      if (ans < map.get(s)) ans = map.get(s);
    } String s map.keySet() map.keySet map {
      if (ans < map.get(s)) ans = map.get(s);
    } {
      if (ans < map.get(s)) ans = map.get(s);
    } if (ans < map.get(s)) ans = map.get(s); ans < map.get(s) ans map.get(s) map.get map s ans = map.get(s) ans map.get(s) map.get map s return ans; ans public class Main {
  public static void main(String[] args) {
    Main main = new Main();
    // System.out.println(main.solve());
    main.solve();
  }

  int n;
  Map<String, Integer> map;

  public Main() {
    Scanner sc = new Scanner(System.in);
    try {
      n = sc.nextInt();
      map = new HashMap<String, Integer>();
      for (int i = 0; i < n; i++) {
        String s = sc.next();
        if (map.containsKey(s)) {
          map.put(s, map.get(s) + 1);
        } else {
          map.put(s, 0);
        }
      }
    } finally {
      sc.close();
    }
  }

  void solve() {
    int v = maxi();
    List<String> list = new ArrayList<String>();
    for (String s: map.keySet()) {
      if (map.get(s) == v) list.add(s);
    }
    Collections.sort(list);
    for (String s: list) {
      System.out.println(s);
    }
  }

  int maxi() {
    int ans = 0;
    for (String s: map.keySet()) {
      if (ans < map.get(s)) ans = map.get(s);
    }
    return ans;
  }
} public class Main {
  public static void main(String[] args) {
    Main main = new Main();
    // System.out.println(main.solve());
    main.solve();
  }

  int n;
  Map<String, Integer> map;

  public Main() {
    Scanner sc = new Scanner(System.in);
    try {
      n = sc.nextInt();
      map = new HashMap<String, Integer>();
      for (int i = 0; i < n; i++) {
        String s = sc.next();
        if (map.containsKey(s)) {
          map.put(s, map.get(s) + 1);
        } else {
          map.put(s, 0);
        }
      }
    } finally {
      sc.close();
    }
  }

  void solve() {
    int v = maxi();
    List<String> list = new ArrayList<String>();
    for (String s: map.keySet()) {
      if (map.get(s) == v) list.add(s);
    }
    Collections.sort(list);
    for (String s: list) {
      System.out.println(s);
    }
  }

  int maxi() {
    int ans = 0;
    for (String s: map.keySet()) {
      if (ans < map.get(s)) ans = map.get(s);
    }
    return ans;
  }
} Main
import java.util.*;
// import java.util.stream.*;

public class Main {
  public static void main(String[] args) {
    Main main = new Main();
    // System.out.println(main.solve());
    main.solve();
  }

  int n;
  Map<String, Integer> map;

  public Main() {
    Scanner sc = new Scanner(System.in);
    try {
      n = sc.nextInt();
      map = new HashMap<String, Integer>();
      for (int i = 0; i < n; i++) {
        String s = sc.next();
        if (map.containsKey(s)) {
          map.put(s, map.get(s) + 1);
        } else {
          map.put(s, 0);
        }
      }
    } finally {
      sc.close();
    }
  }

  void solve() {
    int v = maxi();
    List<String> list = new ArrayList<String>();
    for (String s: map.keySet()) {
      if (map.get(s) == v) list.add(s);
    }
    Collections.sort(list);
    for (String s: list) {
      System.out.println(s);
    }
  }

  int maxi() {
    int ans = 0;
    for (String s: map.keySet()) {
      if (ans < map.get(s)) ans = map.get(s);
    }
    return ans;
  }
}
