import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
import java.util.Set;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Map<String,Integer> map = new HashMap<>();
        for(int i=0; i<n; i++) {
            String key = sc.next();
            if(map.containsKey(key)) {
                map.put(key, map.get(key) + 1);
            }else {
                map.put(key, 1);
            }
        }
        int max = Collections.max(map.values());
        List<String> s = new ArrayList<>();
        Set<Map.Entry<String,Integer>> entries = map.entrySet();
        for(Map.Entry<String, Integer> entry : entries) {
            if(entry.getValue() == max ) {
                s.add(entry.getKey());
            }
        }
        Collections.sort(s);
        for(String ss : s) {
            System.out.println(ss);
        }
    }
} import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections java.util import java.util.HashMap; HashMap java.util import java.util.List; List java.util import java.util.Map; Map java.util import java.util.Scanner; Scanner java.util import java.util.Set; Set java.util public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Map<String,Integer> map = new HashMap<>();
        for(int i=0; i<n; i++) {
            String key = sc.next();
            if(map.containsKey(key)) {
                map.put(key, map.get(key) + 1);
            }else {
                map.put(key, 1);
            }
        }
        int max = Collections.max(map.values());
        List<String> s = new ArrayList<>();
        Set<Map.Entry<String,Integer>> entries = map.entrySet();
        for(Map.Entry<String, Integer> entry : entries) {
            if(entry.getValue() == max ) {
                s.add(entry.getKey());
            }
        }
        Collections.sort(s);
        for(String ss : s) {
            System.out.println(ss);
        }
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Map<String,Integer> map = new HashMap<>();
        for(int i=0; i<n; i++) {
            String key = sc.next();
            if(map.containsKey(key)) {
                map.put(key, map.get(key) + 1);
            }else {
                map.put(key, 1);
            }
        }
        int max = Collections.max(map.values());
        List<String> s = new ArrayList<>();
        Set<Map.Entry<String,Integer>> entries = map.entrySet();
        for(Map.Entry<String, Integer> entry : entries) {
            if(entry.getValue() == max ) {
                s.add(entry.getKey());
            }
        }
        Collections.sort(s);
        for(String ss : s) {
            System.out.println(ss);
        }
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Map<String,Integer> map = new HashMap<>();
        for(int i=0; i<n; i++) {
            String key = sc.next();
            if(map.containsKey(key)) {
                map.put(key, map.get(key) + 1);
            }else {
                map.put(key, 1);
            }
        }
        int max = Collections.max(map.values());
        List<String> s = new ArrayList<>();
        Set<Map.Entry<String,Integer>> entries = map.entrySet();
        for(Map.Entry<String, Integer> entry : entries) {
            if(entry.getValue() == max ) {
                s.add(entry.getKey());
            }
        }
        Collections.sort(s);
        for(String ss : s) {
            System.out.println(ss);
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc Map<String,Integer> map = new HashMap<>(); map new HashMap<>() for(int i=0; i<n; i++) {
            String key = sc.next();
            if(map.containsKey(key)) {
                map.put(key, map.get(key) + 1);
            }else {
                map.put(key, 1);
            }
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
            String key = sc.next();
            if(map.containsKey(key)) {
                map.put(key, map.get(key) + 1);
            }else {
                map.put(key, 1);
            }
        } {
            String key = sc.next();
            if(map.containsKey(key)) {
                map.put(key, map.get(key) + 1);
            }else {
                map.put(key, 1);
            }
        } String key = sc.next(); key sc.next() sc.next sc if(map.containsKey(key)) {
                map.put(key, map.get(key) + 1);
            }else {
                map.put(key, 1);
            } map.containsKey(key) map.containsKey map key {
                map.put(key, map.get(key) + 1);
            } map.put(key, map.get(key) + 1) map.put map key map.get(key) + 1 map.get(key) map.get map key 1 {
                map.put(key, 1);
            } map.put(key, 1) map.put map key 1 int max = Collections.max(map.values()); max Collections.max(map.values()) Collections.max Collections map.values() map.values map List<String> s = new ArrayList<>(); s new ArrayList<>() Set<Map.Entry<String,Integer>> entries = map.entrySet(); entries map.entrySet() map.entrySet map for(Map.Entry<String, Integer> entry : entries) {
            if(entry.getValue() == max ) {
                s.add(entry.getKey());
            }
        } Map.Entry<String, Integer> entry entries {
            if(entry.getValue() == max ) {
                s.add(entry.getKey());
            }
        } {
            if(entry.getValue() == max ) {
                s.add(entry.getKey());
            }
        } if(entry.getValue() == max ) {
                s.add(entry.getKey());
            } entry.getValue() == max entry.getValue() entry.getValue entry max {
                s.add(entry.getKey());
            } s.add(entry.getKey()) s.add s entry.getKey() entry.getKey entry Collections.sort(s) Collections.sort Collections s for(String ss : s) {
            System.out.println(ss);
        } String ss s {
            System.out.println(ss);
        } {
            System.out.println(ss);
        } System.out.println(ss) System.out.println System.out System System.out ss String[] args args public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Map<String,Integer> map = new HashMap<>();
        for(int i=0; i<n; i++) {
            String key = sc.next();
            if(map.containsKey(key)) {
                map.put(key, map.get(key) + 1);
            }else {
                map.put(key, 1);
            }
        }
        int max = Collections.max(map.values());
        List<String> s = new ArrayList<>();
        Set<Map.Entry<String,Integer>> entries = map.entrySet();
        for(Map.Entry<String, Integer> entry : entries) {
            if(entry.getValue() == max ) {
                s.add(entry.getKey());
            }
        }
        Collections.sort(s);
        for(String ss : s) {
            System.out.println(ss);
        }
    }
} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Map<String,Integer> map = new HashMap<>();
        for(int i=0; i<n; i++) {
            String key = sc.next();
            if(map.containsKey(key)) {
                map.put(key, map.get(key) + 1);
            }else {
                map.put(key, 1);
            }
        }
        int max = Collections.max(map.values());
        List<String> s = new ArrayList<>();
        Set<Map.Entry<String,Integer>> entries = map.entrySet();
        for(Map.Entry<String, Integer> entry : entries) {
            if(entry.getValue() == max ) {
                s.add(entry.getKey());
            }
        }
        Collections.sort(s);
        for(String ss : s) {
            System.out.println(ss);
        }
    }
} Main
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
import java.util.Set;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Map<String,Integer> map = new HashMap<>();
        for(int i=0; i<n; i++) {
            String key = sc.next();
            if(map.containsKey(key)) {
                map.put(key, map.get(key) + 1);
            }else {
                map.put(key, 1);
            }
        }
        int max = Collections.max(map.values());
        List<String> s = new ArrayList<>();
        Set<Map.Entry<String,Integer>> entries = map.entrySet();
        for(Map.Entry<String, Integer> entry : entries) {
            if(entry.getValue() == max ) {
                s.add(entry.getKey());
            }
        }
        Collections.sort(s);
        for(String ss : s) {
            System.out.println(ss);
        }
    }
}