
import java.util.*;

public class Main {

    public static void main(String[] args) {

        Scanner cin = new Scanner(System.in);
        int n = cin.nextInt();
        HashMap<String, Integer> map = new HashMap<>();
        int max = 1;
        for(int i = 0; i < n; ++i){
            String s = cin.next();
            if(!map.containsKey(s)){
                map.put(s,1);
            }else{
                Integer ii = map.get(s);
                map.put(s,ii+1);
                max = Math.max(max,ii+1);
            }
        }

        List<String> ans = new ArrayList<>();
        for (String key: map.keySet()) {
            Integer v = map.get(key);
            if(v == max){
                ans.add(key);
            }
        }

        Collections.sort(ans);
        for (String item:ans){
            System.out.println(item);
        }



    }



} import java.util.*; util.* java public class Main {

    public static void main(String[] args) {

        Scanner cin = new Scanner(System.in);
        int n = cin.nextInt();
        HashMap<String, Integer> map = new HashMap<>();
        int max = 1;
        for(int i = 0; i < n; ++i){
            String s = cin.next();
            if(!map.containsKey(s)){
                map.put(s,1);
            }else{
                Integer ii = map.get(s);
                map.put(s,ii+1);
                max = Math.max(max,ii+1);
            }
        }

        List<String> ans = new ArrayList<>();
        for (String key: map.keySet()) {
            Integer v = map.get(key);
            if(v == max){
                ans.add(key);
            }
        }

        Collections.sort(ans);
        for (String item:ans){
            System.out.println(item);
        }



    }



} Main public static void main(String[] args) {

        Scanner cin = new Scanner(System.in);
        int n = cin.nextInt();
        HashMap<String, Integer> map = new HashMap<>();
        int max = 1;
        for(int i = 0; i < n; ++i){
            String s = cin.next();
            if(!map.containsKey(s)){
                map.put(s,1);
            }else{
                Integer ii = map.get(s);
                map.put(s,ii+1);
                max = Math.max(max,ii+1);
            }
        }

        List<String> ans = new ArrayList<>();
        for (String key: map.keySet()) {
            Integer v = map.get(key);
            if(v == max){
                ans.add(key);
            }
        }

        Collections.sort(ans);
        for (String item:ans){
            System.out.println(item);
        }



    } main {

        Scanner cin = new Scanner(System.in);
        int n = cin.nextInt();
        HashMap<String, Integer> map = new HashMap<>();
        int max = 1;
        for(int i = 0; i < n; ++i){
            String s = cin.next();
            if(!map.containsKey(s)){
                map.put(s,1);
            }else{
                Integer ii = map.get(s);
                map.put(s,ii+1);
                max = Math.max(max,ii+1);
            }
        }

        List<String> ans = new ArrayList<>();
        for (String key: map.keySet()) {
            Integer v = map.get(key);
            if(v == max){
                ans.add(key);
            }
        }

        Collections.sort(ans);
        for (String item:ans){
            System.out.println(item);
        }



    } Scanner cin = new Scanner(System.in); cin new Scanner(System.in) int n = cin.nextInt(); n cin.nextInt() cin.nextInt cin HashMap<String, Integer> map = new HashMap<>(); map new HashMap<>() int max = 1; max 1 for(int i = 0; i < n; ++i){
            String s = cin.next();
            if(!map.containsKey(s)){
                map.put(s,1);
            }else{
                Integer ii = map.get(s);
                map.put(s,ii+1);
                max = Math.max(max,ii+1);
            }
        } int i = 0; int i = 0; i 0 i < n i n ++i ++i i {
            String s = cin.next();
            if(!map.containsKey(s)){
                map.put(s,1);
            }else{
                Integer ii = map.get(s);
                map.put(s,ii+1);
                max = Math.max(max,ii+1);
            }
        } {
            String s = cin.next();
            if(!map.containsKey(s)){
                map.put(s,1);
            }else{
                Integer ii = map.get(s);
                map.put(s,ii+1);
                max = Math.max(max,ii+1);
            }
        } String s = cin.next(); s cin.next() cin.next cin if(!map.containsKey(s)){
                map.put(s,1);
            }else{
                Integer ii = map.get(s);
                map.put(s,ii+1);
                max = Math.max(max,ii+1);
            } !map.containsKey(s) map.containsKey(s) map.containsKey map s {
                map.put(s,1);
            } map.put(s,1) map.put map s 1 {
                Integer ii = map.get(s);
                map.put(s,ii+1);
                max = Math.max(max,ii+1);
            } Integer ii = map.get(s); ii map.get(s) map.get map s map.put(s,ii+1) map.put map s ii+1 ii 1 max = Math.max(max,ii+1) max Math.max(max,ii+1) Math.max Math max ii+1 ii 1 List<String> ans = new ArrayList<>(); ans new ArrayList<>() for (String key: map.keySet()) {
            Integer v = map.get(key);
            if(v == max){
                ans.add(key);
            }
        } String key map.keySet() map.keySet map {
            Integer v = map.get(key);
            if(v == max){
                ans.add(key);
            }
        } {
            Integer v = map.get(key);
            if(v == max){
                ans.add(key);
            }
        } Integer v = map.get(key); v map.get(key) map.get map key if(v == max){
                ans.add(key);
            } v == max v max {
                ans.add(key);
            } ans.add(key) ans.add ans key Collections.sort(ans) Collections.sort Collections ans for (String item:ans){
            System.out.println(item);
        } String item ans {
            System.out.println(item);
        } {
            System.out.println(item);
        } System.out.println(item) System.out.println System.out System System.out item String[] args args public class Main {

    public static void main(String[] args) {

        Scanner cin = new Scanner(System.in);
        int n = cin.nextInt();
        HashMap<String, Integer> map = new HashMap<>();
        int max = 1;
        for(int i = 0; i < n; ++i){
            String s = cin.next();
            if(!map.containsKey(s)){
                map.put(s,1);
            }else{
                Integer ii = map.get(s);
                map.put(s,ii+1);
                max = Math.max(max,ii+1);
            }
        }

        List<String> ans = new ArrayList<>();
        for (String key: map.keySet()) {
            Integer v = map.get(key);
            if(v == max){
                ans.add(key);
            }
        }

        Collections.sort(ans);
        for (String item:ans){
            System.out.println(item);
        }



    }



} public class Main {

    public static void main(String[] args) {

        Scanner cin = new Scanner(System.in);
        int n = cin.nextInt();
        HashMap<String, Integer> map = new HashMap<>();
        int max = 1;
        for(int i = 0; i < n; ++i){
            String s = cin.next();
            if(!map.containsKey(s)){
                map.put(s,1);
            }else{
                Integer ii = map.get(s);
                map.put(s,ii+1);
                max = Math.max(max,ii+1);
            }
        }

        List<String> ans = new ArrayList<>();
        for (String key: map.keySet()) {
            Integer v = map.get(key);
            if(v == max){
                ans.add(key);
            }
        }

        Collections.sort(ans);
        for (String item:ans){
            System.out.println(item);
        }



    }



} Main

import java.util.*;

public class Main {

    public static void main(String[] args) {

        Scanner cin = new Scanner(System.in);
        int n = cin.nextInt();
        HashMap<String, Integer> map = new HashMap<>();
        int max = 1;
        for(int i = 0; i < n; ++i){
            String s = cin.next();
            if(!map.containsKey(s)){
                map.put(s,1);
            }else{
                Integer ii = map.get(s);
                map.put(s,ii+1);
                max = Math.max(max,ii+1);
            }
        }

        List<String> ans = new ArrayList<>();
        for (String key: map.keySet()) {
            Integer v = map.get(key);
            if(v == max){
                ans.add(key);
            }
        }

        Collections.sort(ans);
        for (String item:ans){
            System.out.println(item);
        }



    }



}
