import java.util.Map;
import java.util.Scanner;
import java.util.TreeMap;

public class Main {

    public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);
        
        int n = Integer.parseInt(sc.next());
        Map<String, Integer> map = new TreeMap<>();
        int max = 0;
        for(int i = 0; i < n; i++){
            String s = sc.next();
            int a = map.getOrDefault(s, 0) +1;
            if(a > max) max = a;
            map.put(s, a);
        }
        
        StringBuilder sb = new StringBuilder();
        for (String s : map.keySet()) {
            if(map.get(s) == max){
                sb.append(s).append(System.lineSeparator());
            }
        }
        System.out.print(sb);
    }
} import java.util.Map; Map java.util import java.util.Scanner; Scanner java.util import java.util.TreeMap; TreeMap java.util public class Main {

    public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);
        
        int n = Integer.parseInt(sc.next());
        Map<String, Integer> map = new TreeMap<>();
        int max = 0;
        for(int i = 0; i < n; i++){
            String s = sc.next();
            int a = map.getOrDefault(s, 0) +1;
            if(a > max) max = a;
            map.put(s, a);
        }
        
        StringBuilder sb = new StringBuilder();
        for (String s : map.keySet()) {
            if(map.get(s) == max){
                sb.append(s).append(System.lineSeparator());
            }
        }
        System.out.print(sb);
    }
} Main public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);
        
        int n = Integer.parseInt(sc.next());
        Map<String, Integer> map = new TreeMap<>();
        int max = 0;
        for(int i = 0; i < n; i++){
            String s = sc.next();
            int a = map.getOrDefault(s, 0) +1;
            if(a > max) max = a;
            map.put(s, a);
        }
        
        StringBuilder sb = new StringBuilder();
        for (String s : map.keySet()) {
            if(map.get(s) == max){
                sb.append(s).append(System.lineSeparator());
            }
        }
        System.out.print(sb);
    } main {
        
        Scanner sc = new Scanner(System.in);
        
        int n = Integer.parseInt(sc.next());
        Map<String, Integer> map = new TreeMap<>();
        int max = 0;
        for(int i = 0; i < n; i++){
            String s = sc.next();
            int a = map.getOrDefault(s, 0) +1;
            if(a > max) max = a;
            map.put(s, a);
        }
        
        StringBuilder sb = new StringBuilder();
        for (String s : map.keySet()) {
            if(map.get(s) == max){
                sb.append(s).append(System.lineSeparator());
            }
        }
        System.out.print(sb);
    } 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 Map<String, Integer> map = new TreeMap<>(); map new TreeMap<>() int max = 0; max 0 for(int i = 0; i < n; i++){
            String s = sc.next();
            int a = map.getOrDefault(s, 0) +1;
            if(a > max) max = a;
            map.put(s, a);
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            String s = sc.next();
            int a = map.getOrDefault(s, 0) +1;
            if(a > max) max = a;
            map.put(s, a);
        } {
            String s = sc.next();
            int a = map.getOrDefault(s, 0) +1;
            if(a > max) max = a;
            map.put(s, a);
        } String s = sc.next(); s sc.next() sc.next sc int a = map.getOrDefault(s, 0) +1; a map.getOrDefault(s, 0) +1 map.getOrDefault(s, 0) map.getOrDefault map s 0 1 if(a > max) max = a; a > max a max max = a max a map.put(s, a) map.put map s a StringBuilder sb = new StringBuilder(); sb new StringBuilder() for (String s : map.keySet()) {
            if(map.get(s) == max){
                sb.append(s).append(System.lineSeparator());
            }
        } String s map.keySet() map.keySet map {
            if(map.get(s) == max){
                sb.append(s).append(System.lineSeparator());
            }
        } {
            if(map.get(s) == max){
                sb.append(s).append(System.lineSeparator());
            }
        } if(map.get(s) == max){
                sb.append(s).append(System.lineSeparator());
            } map.get(s) == max map.get(s) map.get map s max {
                sb.append(s).append(System.lineSeparator());
            } sb.append(s).append(System.lineSeparator()) sb.append(s).append sb.append(s) sb.append sb s System.lineSeparator() System.lineSeparator System System.out.print(sb) System.out.print System.out System System.out sb String[] args args public class Main {

    public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);
        
        int n = Integer.parseInt(sc.next());
        Map<String, Integer> map = new TreeMap<>();
        int max = 0;
        for(int i = 0; i < n; i++){
            String s = sc.next();
            int a = map.getOrDefault(s, 0) +1;
            if(a > max) max = a;
            map.put(s, a);
        }
        
        StringBuilder sb = new StringBuilder();
        for (String s : map.keySet()) {
            if(map.get(s) == max){
                sb.append(s).append(System.lineSeparator());
            }
        }
        System.out.print(sb);
    }
} public class Main {

    public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);
        
        int n = Integer.parseInt(sc.next());
        Map<String, Integer> map = new TreeMap<>();
        int max = 0;
        for(int i = 0; i < n; i++){
            String s = sc.next();
            int a = map.getOrDefault(s, 0) +1;
            if(a > max) max = a;
            map.put(s, a);
        }
        
        StringBuilder sb = new StringBuilder();
        for (String s : map.keySet()) {
            if(map.get(s) == max){
                sb.append(s).append(System.lineSeparator());
            }
        }
        System.out.print(sb);
    }
} Main
import java.util.Map;
import java.util.Scanner;
import java.util.TreeMap;

public class Main {

    public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);
        
        int n = Integer.parseInt(sc.next());
        Map<String, Integer> map = new TreeMap<>();
        int max = 0;
        for(int i = 0; i < n; i++){
            String s = sc.next();
            int a = map.getOrDefault(s, 0) +1;
            if(a > max) max = a;
            map.put(s, a);
        }
        
        StringBuilder sb = new StringBuilder();
        for (String s : map.keySet()) {
            if(map.get(s) == max){
                sb.append(s).append(System.lineSeparator());
            }
        }
        System.out.print(sb);
    }
}