import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        Map<String, Integer> map = new TreeMap<>();
        for(int i = 0; i < num; i++){
            String word = sc.next();
            if(map.containsKey(word))
              map.put(word, map.get(word)+1);
            else
              map.put(word, 1);
        }

        int most = 0;
        for(String n: map.keySet()){
          if(map.get(n) > most)
            most = map.get(n);
        }
        for(String n: map.keySet()){
          if(map.get(n) == most)
            System.out.println(n);
        }
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        Map<String, Integer> map = new TreeMap<>();
        for(int i = 0; i < num; i++){
            String word = sc.next();
            if(map.containsKey(word))
              map.put(word, map.get(word)+1);
            else
              map.put(word, 1);
        }

        int most = 0;
        for(String n: map.keySet()){
          if(map.get(n) > most)
            most = map.get(n);
        }
        for(String n: map.keySet()){
          if(map.get(n) == most)
            System.out.println(n);
        }
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        Map<String, Integer> map = new TreeMap<>();
        for(int i = 0; i < num; i++){
            String word = sc.next();
            if(map.containsKey(word))
              map.put(word, map.get(word)+1);
            else
              map.put(word, 1);
        }

        int most = 0;
        for(String n: map.keySet()){
          if(map.get(n) > most)
            most = map.get(n);
        }
        for(String n: map.keySet()){
          if(map.get(n) == most)
            System.out.println(n);
        }
    } main {
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        Map<String, Integer> map = new TreeMap<>();
        for(int i = 0; i < num; i++){
            String word = sc.next();
            if(map.containsKey(word))
              map.put(word, map.get(word)+1);
            else
              map.put(word, 1);
        }

        int most = 0;
        for(String n: map.keySet()){
          if(map.get(n) > most)
            most = map.get(n);
        }
        for(String n: map.keySet()){
          if(map.get(n) == most)
            System.out.println(n);
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int num = sc.nextInt(); num sc.nextInt() sc.nextInt sc Map<String, Integer> map = new TreeMap<>(); map new TreeMap<>() for(int i = 0; i < num; i++){
            String word = sc.next();
            if(map.containsKey(word))
              map.put(word, map.get(word)+1);
            else
              map.put(word, 1);
        } int i = 0; int i = 0; i 0 i < num i num i++ i++ i {
            String word = sc.next();
            if(map.containsKey(word))
              map.put(word, map.get(word)+1);
            else
              map.put(word, 1);
        } {
            String word = sc.next();
            if(map.containsKey(word))
              map.put(word, map.get(word)+1);
            else
              map.put(word, 1);
        } String word = sc.next(); word sc.next() sc.next sc 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 map word map.get(word)+1 map.get(word) map.get map word 1 map.put(word, 1) map.put map word 1 int most = 0; most 0 for(String n: map.keySet()){
          if(map.get(n) > most)
            most = map.get(n);
        } String n map.keySet() map.keySet map {
          if(map.get(n) > most)
            most = map.get(n);
        } {
          if(map.get(n) > most)
            most = map.get(n);
        } if(map.get(n) > most)
            most = map.get(n); map.get(n) > most map.get(n) map.get map n most most = map.get(n) most map.get(n) map.get map n for(String n: map.keySet()){
          if(map.get(n) == most)
            System.out.println(n);
        } String n map.keySet() map.keySet map {
          if(map.get(n) == most)
            System.out.println(n);
        } {
          if(map.get(n) == most)
            System.out.println(n);
        } if(map.get(n) == most)
            System.out.println(n); map.get(n) == most map.get(n) map.get map n most System.out.println(n) System.out.println System.out System System.out n String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        Map<String, Integer> map = new TreeMap<>();
        for(int i = 0; i < num; i++){
            String word = sc.next();
            if(map.containsKey(word))
              map.put(word, map.get(word)+1);
            else
              map.put(word, 1);
        }

        int most = 0;
        for(String n: map.keySet()){
          if(map.get(n) > most)
            most = map.get(n);
        }
        for(String n: map.keySet()){
          if(map.get(n) == most)
            System.out.println(n);
        }
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        Map<String, Integer> map = new TreeMap<>();
        for(int i = 0; i < num; i++){
            String word = sc.next();
            if(map.containsKey(word))
              map.put(word, map.get(word)+1);
            else
              map.put(word, 1);
        }

        int most = 0;
        for(String n: map.keySet()){
          if(map.get(n) > most)
            most = map.get(n);
        }
        for(String n: map.keySet()){
          if(map.get(n) == most)
            System.out.println(n);
        }
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        Map<String, Integer> map = new TreeMap<>();
        for(int i = 0; i < num; i++){
            String word = sc.next();
            if(map.containsKey(word))
              map.put(word, map.get(word)+1);
            else
              map.put(word, 1);
        }

        int most = 0;
        for(String n: map.keySet()){
          if(map.get(n) > most)
            most = map.get(n);
        }
        for(String n: map.keySet()){
          if(map.get(n) == most)
            System.out.println(n);
        }
    }
}
