import java.util.*;
 
class Main{
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Map<String, Integer> strs = new HashMap<>();
        Integer max = 1;
        for(int i=0;i<n;i++){
            String tmp = sc.next();
            if(strs.containsKey(tmp)){
                Integer p = strs.get(tmp)+1;
                max = max < p ? p : max;
                strs.put(tmp, p);
            }
            else{
                strs.put(tmp, 1);
            }
        }
        List<String> employeeByKey = new ArrayList<>(strs.keySet());
        Collections.sort(employeeByKey);
 
        for(String key : employeeByKey){
            if(strs.get(key)==max){
                System.out.println(key);
            }
        }
    }
} import java.util.*; util.* java class Main{
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Map<String, Integer> strs = new HashMap<>();
        Integer max = 1;
        for(int i=0;i<n;i++){
            String tmp = sc.next();
            if(strs.containsKey(tmp)){
                Integer p = strs.get(tmp)+1;
                max = max < p ? p : max;
                strs.put(tmp, p);
            }
            else{
                strs.put(tmp, 1);
            }
        }
        List<String> employeeByKey = new ArrayList<>(strs.keySet());
        Collections.sort(employeeByKey);
 
        for(String key : employeeByKey){
            if(strs.get(key)==max){
                System.out.println(key);
            }
        }
    }
} Main public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Map<String, Integer> strs = new HashMap<>();
        Integer max = 1;
        for(int i=0;i<n;i++){
            String tmp = sc.next();
            if(strs.containsKey(tmp)){
                Integer p = strs.get(tmp)+1;
                max = max < p ? p : max;
                strs.put(tmp, p);
            }
            else{
                strs.put(tmp, 1);
            }
        }
        List<String> employeeByKey = new ArrayList<>(strs.keySet());
        Collections.sort(employeeByKey);
 
        for(String key : employeeByKey){
            if(strs.get(key)==max){
                System.out.println(key);
            }
        }
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Map<String, Integer> strs = new HashMap<>();
        Integer max = 1;
        for(int i=0;i<n;i++){
            String tmp = sc.next();
            if(strs.containsKey(tmp)){
                Integer p = strs.get(tmp)+1;
                max = max < p ? p : max;
                strs.put(tmp, p);
            }
            else{
                strs.put(tmp, 1);
            }
        }
        List<String> employeeByKey = new ArrayList<>(strs.keySet());
        Collections.sort(employeeByKey);
 
        for(String key : employeeByKey){
            if(strs.get(key)==max){
                System.out.println(key);
            }
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc Map<String, Integer> strs = new HashMap<>(); strs new HashMap<>() Integer max = 1; max 1 for(int i=0;i<n;i++){
            String tmp = sc.next();
            if(strs.containsKey(tmp)){
                Integer p = strs.get(tmp)+1;
                max = max < p ? p : max;
                strs.put(tmp, p);
            }
            else{
                strs.put(tmp, 1);
            }
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
            String tmp = sc.next();
            if(strs.containsKey(tmp)){
                Integer p = strs.get(tmp)+1;
                max = max < p ? p : max;
                strs.put(tmp, p);
            }
            else{
                strs.put(tmp, 1);
            }
        } {
            String tmp = sc.next();
            if(strs.containsKey(tmp)){
                Integer p = strs.get(tmp)+1;
                max = max < p ? p : max;
                strs.put(tmp, p);
            }
            else{
                strs.put(tmp, 1);
            }
        } String tmp = sc.next(); tmp sc.next() sc.next sc if(strs.containsKey(tmp)){
                Integer p = strs.get(tmp)+1;
                max = max < p ? p : max;
                strs.put(tmp, p);
            }
            else{
                strs.put(tmp, 1);
            } strs.containsKey(tmp) strs.containsKey strs tmp {
                Integer p = strs.get(tmp)+1;
                max = max < p ? p : max;
                strs.put(tmp, p);
            } Integer p = strs.get(tmp)+1; p strs.get(tmp)+1 strs.get(tmp) strs.get strs tmp 1 max = max < p ? p : max max max < p ? p : max max < p max p p max strs.put(tmp, p) strs.put strs tmp p {
                strs.put(tmp, 1);
            } strs.put(tmp, 1) strs.put strs tmp 1 List<String> employeeByKey = new ArrayList<>(strs.keySet()); employeeByKey new ArrayList<>(strs.keySet()) Collections.sort(employeeByKey) Collections.sort Collections employeeByKey for(String key : employeeByKey){
            if(strs.get(key)==max){
                System.out.println(key);
            }
        } String key employeeByKey {
            if(strs.get(key)==max){
                System.out.println(key);
            }
        } {
            if(strs.get(key)==max){
                System.out.println(key);
            }
        } if(strs.get(key)==max){
                System.out.println(key);
            } strs.get(key)==max strs.get(key) strs.get strs key max {
                System.out.println(key);
            } System.out.println(key) System.out.println System.out System System.out key String args[] args
import java.util.*;
 
class Main{
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Map<String, Integer> strs = new HashMap<>();
        Integer max = 1;
        for(int i=0;i<n;i++){
            String tmp = sc.next();
            if(strs.containsKey(tmp)){
                Integer p = strs.get(tmp)+1;
                max = max < p ? p : max;
                strs.put(tmp, p);
            }
            else{
                strs.put(tmp, 1);
            }
        }
        List<String> employeeByKey = new ArrayList<>(strs.keySet());
        Collections.sort(employeeByKey);
 
        for(String key : employeeByKey){
            if(strs.get(key)==max){
                System.out.println(key);
            }
        }
    }
}