import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        HashMap<String,Integer> vote = new HashMap<>();
        int n = sc.nextInt();

        for(int i=0;i<n;i++){
            String name = sc.next();
            if(vote.containsKey(name)){
                int temp = vote.get(name);
                vote.remove(name);
                vote.put(name,temp+1);
            }
            else{
                vote.put(name,1);
            }
        }
        int max = 0;
        for(String s:vote.keySet()){
            max = Math.max(max,vote.get(s));
        }
        ArrayList<String> names = new ArrayList<>();

        for(String s:vote.keySet()){
            if(vote.get(s)==max) names.add(s);
        }
        Collections.sort(names);

        for(String s:names) System.out.println(s);
    }

}

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

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        HashMap<String,Integer> vote = new HashMap<>();
        int n = sc.nextInt();

        for(int i=0;i<n;i++){
            String name = sc.next();
            if(vote.containsKey(name)){
                int temp = vote.get(name);
                vote.remove(name);
                vote.put(name,temp+1);
            }
            else{
                vote.put(name,1);
            }
        }
        int max = 0;
        for(String s:vote.keySet()){
            max = Math.max(max,vote.get(s));
        }
        ArrayList<String> names = new ArrayList<>();

        for(String s:vote.keySet()){
            if(vote.get(s)==max) names.add(s);
        }
        Collections.sort(names);

        for(String s:names) System.out.println(s);
    }

} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        HashMap<String,Integer> vote = new HashMap<>();
        int n = sc.nextInt();

        for(int i=0;i<n;i++){
            String name = sc.next();
            if(vote.containsKey(name)){
                int temp = vote.get(name);
                vote.remove(name);
                vote.put(name,temp+1);
            }
            else{
                vote.put(name,1);
            }
        }
        int max = 0;
        for(String s:vote.keySet()){
            max = Math.max(max,vote.get(s));
        }
        ArrayList<String> names = new ArrayList<>();

        for(String s:vote.keySet()){
            if(vote.get(s)==max) names.add(s);
        }
        Collections.sort(names);

        for(String s:names) System.out.println(s);
    } main {
        Scanner sc = new Scanner(System.in);
        HashMap<String,Integer> vote = new HashMap<>();
        int n = sc.nextInt();

        for(int i=0;i<n;i++){
            String name = sc.next();
            if(vote.containsKey(name)){
                int temp = vote.get(name);
                vote.remove(name);
                vote.put(name,temp+1);
            }
            else{
                vote.put(name,1);
            }
        }
        int max = 0;
        for(String s:vote.keySet()){
            max = Math.max(max,vote.get(s));
        }
        ArrayList<String> names = new ArrayList<>();

        for(String s:vote.keySet()){
            if(vote.get(s)==max) names.add(s);
        }
        Collections.sort(names);

        for(String s:names) System.out.println(s);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) HashMap<String,Integer> vote = new HashMap<>(); vote new HashMap<>() int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc for(int i=0;i<n;i++){
            String name = sc.next();
            if(vote.containsKey(name)){
                int temp = vote.get(name);
                vote.remove(name);
                vote.put(name,temp+1);
            }
            else{
                vote.put(name,1);
            }
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
            String name = sc.next();
            if(vote.containsKey(name)){
                int temp = vote.get(name);
                vote.remove(name);
                vote.put(name,temp+1);
            }
            else{
                vote.put(name,1);
            }
        } {
            String name = sc.next();
            if(vote.containsKey(name)){
                int temp = vote.get(name);
                vote.remove(name);
                vote.put(name,temp+1);
            }
            else{
                vote.put(name,1);
            }
        } String name = sc.next(); name sc.next() sc.next sc if(vote.containsKey(name)){
                int temp = vote.get(name);
                vote.remove(name);
                vote.put(name,temp+1);
            }
            else{
                vote.put(name,1);
            } vote.containsKey(name) vote.containsKey vote name {
                int temp = vote.get(name);
                vote.remove(name);
                vote.put(name,temp+1);
            } int temp = vote.get(name); temp vote.get(name) vote.get vote name vote.remove(name) vote.remove vote name vote.put(name,temp+1) vote.put vote name temp+1 temp 1 {
                vote.put(name,1);
            } vote.put(name,1) vote.put vote name 1 int max = 0; max 0 for(String s:vote.keySet()){
            max = Math.max(max,vote.get(s));
        } String s vote.keySet() vote.keySet vote {
            max = Math.max(max,vote.get(s));
        } {
            max = Math.max(max,vote.get(s));
        } max = Math.max(max,vote.get(s)) max Math.max(max,vote.get(s)) Math.max Math max vote.get(s) vote.get vote s ArrayList<String> names = new ArrayList<>(); names new ArrayList<>() for(String s:vote.keySet()){
            if(vote.get(s)==max) names.add(s);
        } String s vote.keySet() vote.keySet vote {
            if(vote.get(s)==max) names.add(s);
        } {
            if(vote.get(s)==max) names.add(s);
        } if(vote.get(s)==max) names.add(s); vote.get(s)==max vote.get(s) vote.get vote s max names.add(s) names.add names s Collections.sort(names) Collections.sort Collections names for(String s:names) System.out.println(s); String s names System.out.println(s); System.out.println(s) System.out.println System.out System System.out s String[] args args public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        HashMap<String,Integer> vote = new HashMap<>();
        int n = sc.nextInt();

        for(int i=0;i<n;i++){
            String name = sc.next();
            if(vote.containsKey(name)){
                int temp = vote.get(name);
                vote.remove(name);
                vote.put(name,temp+1);
            }
            else{
                vote.put(name,1);
            }
        }
        int max = 0;
        for(String s:vote.keySet()){
            max = Math.max(max,vote.get(s));
        }
        ArrayList<String> names = new ArrayList<>();

        for(String s:vote.keySet()){
            if(vote.get(s)==max) names.add(s);
        }
        Collections.sort(names);

        for(String s:names) System.out.println(s);
    }

} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        HashMap<String,Integer> vote = new HashMap<>();
        int n = sc.nextInt();

        for(int i=0;i<n;i++){
            String name = sc.next();
            if(vote.containsKey(name)){
                int temp = vote.get(name);
                vote.remove(name);
                vote.put(name,temp+1);
            }
            else{
                vote.put(name,1);
            }
        }
        int max = 0;
        for(String s:vote.keySet()){
            max = Math.max(max,vote.get(s));
        }
        ArrayList<String> names = new ArrayList<>();

        for(String s:vote.keySet()){
            if(vote.get(s)==max) names.add(s);
        }
        Collections.sort(names);

        for(String s:names) System.out.println(s);
    }

} Main
import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        HashMap<String,Integer> vote = new HashMap<>();
        int n = sc.nextInt();

        for(int i=0;i<n;i++){
            String name = sc.next();
            if(vote.containsKey(name)){
                int temp = vote.get(name);
                vote.remove(name);
                vote.put(name,temp+1);
            }
            else{
                vote.put(name,1);
            }
        }
        int max = 0;
        for(String s:vote.keySet()){
            max = Math.max(max,vote.get(s));
        }
        ArrayList<String> names = new ArrayList<>();

        for(String s:vote.keySet()){
            if(vote.get(s)==max) names.add(s);
        }
        Collections.sort(names);

        for(String s:names) System.out.println(s);
    }

}


