import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;

public class Main
{
    public static void main(String[] args) throws IOException
    {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        int N = Integer.valueOf(reader.readLine());
        int maxFreq = 0;
        HashMap<String, Integer> map = new HashMap<>();

        for (int i = 0; i < N; i++){
          String word = reader.readLine();
          if (map.containsKey(word)){
            map.put(word, map.get(word) + 1);
          } else {
            map.put(word, 1);
          }
          maxFreq = Math.max(maxFreq, map.get(word));
        }

        List<String> words = new ArrayList<>();
        for (String j : map.keySet()) {
          if (map.get(j) == maxFreq){
            words.add(j+"\n");
          }
        }
        Collections.sort(words);

        for (String k : words){
          System.out.print(k);
        }
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.*; util.* java public class Main
{
    public static void main(String[] args) throws IOException
    {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        int N = Integer.valueOf(reader.readLine());
        int maxFreq = 0;
        HashMap<String, Integer> map = new HashMap<>();

        for (int i = 0; i < N; i++){
          String word = reader.readLine();
          if (map.containsKey(word)){
            map.put(word, map.get(word) + 1);
          } else {
            map.put(word, 1);
          }
          maxFreq = Math.max(maxFreq, map.get(word));
        }

        List<String> words = new ArrayList<>();
        for (String j : map.keySet()) {
          if (map.get(j) == maxFreq){
            words.add(j+"\n");
          }
        }
        Collections.sort(words);

        for (String k : words){
          System.out.print(k);
        }
    }
} Main public static void main(String[] args) throws IOException
    {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        int N = Integer.valueOf(reader.readLine());
        int maxFreq = 0;
        HashMap<String, Integer> map = new HashMap<>();

        for (int i = 0; i < N; i++){
          String word = reader.readLine();
          if (map.containsKey(word)){
            map.put(word, map.get(word) + 1);
          } else {
            map.put(word, 1);
          }
          maxFreq = Math.max(maxFreq, map.get(word));
        }

        List<String> words = new ArrayList<>();
        for (String j : map.keySet()) {
          if (map.get(j) == maxFreq){
            words.add(j+"\n");
          }
        }
        Collections.sort(words);

        for (String k : words){
          System.out.print(k);
        }
    } main {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        int N = Integer.valueOf(reader.readLine());
        int maxFreq = 0;
        HashMap<String, Integer> map = new HashMap<>();

        for (int i = 0; i < N; i++){
          String word = reader.readLine();
          if (map.containsKey(word)){
            map.put(word, map.get(word) + 1);
          } else {
            map.put(word, 1);
          }
          maxFreq = Math.max(maxFreq, map.get(word));
        }

        List<String> words = new ArrayList<>();
        for (String j : map.keySet()) {
          if (map.get(j) == maxFreq){
            words.add(j+"\n");
          }
        }
        Collections.sort(words);

        for (String k : words){
          System.out.print(k);
        }
    } BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); reader new BufferedReader(new InputStreamReader(System.in)) int N = Integer.valueOf(reader.readLine()); N Integer.valueOf(reader.readLine()) Integer.valueOf Integer reader.readLine() reader.readLine reader int maxFreq = 0; maxFreq 0 HashMap<String, Integer> map = new HashMap<>(); map new HashMap<>() for (int i = 0; i < N; i++){
          String word = reader.readLine();
          if (map.containsKey(word)){
            map.put(word, map.get(word) + 1);
          } else {
            map.put(word, 1);
          }
          maxFreq = Math.max(maxFreq, map.get(word));
        } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
          String word = reader.readLine();
          if (map.containsKey(word)){
            map.put(word, map.get(word) + 1);
          } else {
            map.put(word, 1);
          }
          maxFreq = Math.max(maxFreq, map.get(word));
        } {
          String word = reader.readLine();
          if (map.containsKey(word)){
            map.put(word, map.get(word) + 1);
          } else {
            map.put(word, 1);
          }
          maxFreq = Math.max(maxFreq, map.get(word));
        } String word = reader.readLine(); word reader.readLine() reader.readLine reader if (map.containsKey(word)){
            map.put(word, map.get(word) + 1);
          } else {
            map.put(word, 1);
          } map.containsKey(word) map.containsKey map word {
            map.put(word, map.get(word) + 1);
          } map.put(word, map.get(word) + 1) map.put map word map.get(word) + 1 map.get(word) map.get map word 1 {
            map.put(word, 1);
          } map.put(word, 1) map.put map word 1 maxFreq = Math.max(maxFreq, map.get(word)) maxFreq Math.max(maxFreq, map.get(word)) Math.max Math maxFreq map.get(word) map.get map word List<String> words = new ArrayList<>(); words new ArrayList<>() for (String j : map.keySet()) {
          if (map.get(j) == maxFreq){
            words.add(j+"\n");
          }
        } String j map.keySet() map.keySet map {
          if (map.get(j) == maxFreq){
            words.add(j+"\n");
          }
        } {
          if (map.get(j) == maxFreq){
            words.add(j+"\n");
          }
        } if (map.get(j) == maxFreq){
            words.add(j+"\n");
          } map.get(j) == maxFreq map.get(j) map.get map j maxFreq {
            words.add(j+"\n");
          } words.add(j+"\n") words.add words j+"\n" j "\n" Collections.sort(words) Collections.sort Collections words for (String k : words){
          System.out.print(k);
        } String k words {
          System.out.print(k);
        } {
          System.out.print(k);
        } System.out.print(k) System.out.print System.out System System.out k String[] args args public class Main
{
    public static void main(String[] args) throws IOException
    {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        int N = Integer.valueOf(reader.readLine());
        int maxFreq = 0;
        HashMap<String, Integer> map = new HashMap<>();

        for (int i = 0; i < N; i++){
          String word = reader.readLine();
          if (map.containsKey(word)){
            map.put(word, map.get(word) + 1);
          } else {
            map.put(word, 1);
          }
          maxFreq = Math.max(maxFreq, map.get(word));
        }

        List<String> words = new ArrayList<>();
        for (String j : map.keySet()) {
          if (map.get(j) == maxFreq){
            words.add(j+"\n");
          }
        }
        Collections.sort(words);

        for (String k : words){
          System.out.print(k);
        }
    }
} public class Main
{
    public static void main(String[] args) throws IOException
    {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        int N = Integer.valueOf(reader.readLine());
        int maxFreq = 0;
        HashMap<String, Integer> map = new HashMap<>();

        for (int i = 0; i < N; i++){
          String word = reader.readLine();
          if (map.containsKey(word)){
            map.put(word, map.get(word) + 1);
          } else {
            map.put(word, 1);
          }
          maxFreq = Math.max(maxFreq, map.get(word));
        }

        List<String> words = new ArrayList<>();
        for (String j : map.keySet()) {
          if (map.get(j) == maxFreq){
            words.add(j+"\n");
          }
        }
        Collections.sort(words);

        for (String k : words){
          System.out.print(k);
        }
    }
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;

public class Main
{
    public static void main(String[] args) throws IOException
    {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        int N = Integer.valueOf(reader.readLine());
        int maxFreq = 0;
        HashMap<String, Integer> map = new HashMap<>();

        for (int i = 0; i < N; i++){
          String word = reader.readLine();
          if (map.containsKey(word)){
            map.put(word, map.get(word) + 1);
          } else {
            map.put(word, 1);
          }
          maxFreq = Math.max(maxFreq, map.get(word));
        }

        List<String> words = new ArrayList<>();
        for (String j : map.keySet()) {
          if (map.get(j) == maxFreq){
            words.add(j+"\n");
          }
        }
        Collections.sort(words);

        for (String k : words){
          System.out.print(k);
        }
    }
}
