import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        Map<String, Integer> m = new HashMap<>(n);
        for(int i=0; i<n; i++) {
            String s = in.next();
            if(m.containsKey(s)) {
                m.put(s, m.get(s)+1);
            }
            else {
                m.put(s, 1);
            }
        }
        Set<String> keySet = m.keySet();
        int maxCount = 0;
        Iterator<String> it = keySet.iterator();
        while(it.hasNext()) {
            String s = it.next();
            int c = m.get(s);
            maxCount = Math.max(maxCount, c);
        }
        it = keySet.iterator();
        SortedSet<String> results = new TreeSet<>();
        while(it.hasNext()) {
            String s = it.next();
            int c = m.get(s);
            if(c==maxCount) {
                results.add(s);
            }
        }

        it = results.iterator();
        while(it.hasNext()) {
            System.out.println(it.next());
        }
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        Map<String, Integer> m = new HashMap<>(n);
        for(int i=0; i<n; i++) {
            String s = in.next();
            if(m.containsKey(s)) {
                m.put(s, m.get(s)+1);
            }
            else {
                m.put(s, 1);
            }
        }
        Set<String> keySet = m.keySet();
        int maxCount = 0;
        Iterator<String> it = keySet.iterator();
        while(it.hasNext()) {
            String s = it.next();
            int c = m.get(s);
            maxCount = Math.max(maxCount, c);
        }
        it = keySet.iterator();
        SortedSet<String> results = new TreeSet<>();
        while(it.hasNext()) {
            String s = it.next();
            int c = m.get(s);
            if(c==maxCount) {
                results.add(s);
            }
        }

        it = results.iterator();
        while(it.hasNext()) {
            System.out.println(it.next());
        }
    }
} Main public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        Map<String, Integer> m = new HashMap<>(n);
        for(int i=0; i<n; i++) {
            String s = in.next();
            if(m.containsKey(s)) {
                m.put(s, m.get(s)+1);
            }
            else {
                m.put(s, 1);
            }
        }
        Set<String> keySet = m.keySet();
        int maxCount = 0;
        Iterator<String> it = keySet.iterator();
        while(it.hasNext()) {
            String s = it.next();
            int c = m.get(s);
            maxCount = Math.max(maxCount, c);
        }
        it = keySet.iterator();
        SortedSet<String> results = new TreeSet<>();
        while(it.hasNext()) {
            String s = it.next();
            int c = m.get(s);
            if(c==maxCount) {
                results.add(s);
            }
        }

        it = results.iterator();
        while(it.hasNext()) {
            System.out.println(it.next());
        }
    } main {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        Map<String, Integer> m = new HashMap<>(n);
        for(int i=0; i<n; i++) {
            String s = in.next();
            if(m.containsKey(s)) {
                m.put(s, m.get(s)+1);
            }
            else {
                m.put(s, 1);
            }
        }
        Set<String> keySet = m.keySet();
        int maxCount = 0;
        Iterator<String> it = keySet.iterator();
        while(it.hasNext()) {
            String s = it.next();
            int c = m.get(s);
            maxCount = Math.max(maxCount, c);
        }
        it = keySet.iterator();
        SortedSet<String> results = new TreeSet<>();
        while(it.hasNext()) {
            String s = it.next();
            int c = m.get(s);
            if(c==maxCount) {
                results.add(s);
            }
        }

        it = results.iterator();
        while(it.hasNext()) {
            System.out.println(it.next());
        }
    } Scanner in = new Scanner(System.in); in new Scanner(System.in) int n = in.nextInt(); n in.nextInt() in.nextInt in Map<String, Integer> m = new HashMap<>(n); m new HashMap<>(n) for(int i=0; i<n; i++) {
            String s = in.next();
            if(m.containsKey(s)) {
                m.put(s, m.get(s)+1);
            }
            else {
                m.put(s, 1);
            }
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
            String s = in.next();
            if(m.containsKey(s)) {
                m.put(s, m.get(s)+1);
            }
            else {
                m.put(s, 1);
            }
        } {
            String s = in.next();
            if(m.containsKey(s)) {
                m.put(s, m.get(s)+1);
            }
            else {
                m.put(s, 1);
            }
        } String s = in.next(); s in.next() in.next in if(m.containsKey(s)) {
                m.put(s, m.get(s)+1);
            }
            else {
                m.put(s, 1);
            } m.containsKey(s) m.containsKey m s {
                m.put(s, m.get(s)+1);
            } m.put(s, m.get(s)+1) m.put m s m.get(s)+1 m.get(s) m.get m s 1 {
                m.put(s, 1);
            } m.put(s, 1) m.put m s 1 Set<String> keySet = m.keySet(); keySet m.keySet() m.keySet m int maxCount = 0; maxCount 0 Iterator<String> it = keySet.iterator(); it keySet.iterator() keySet.iterator keySet while(it.hasNext()) {
            String s = it.next();
            int c = m.get(s);
            maxCount = Math.max(maxCount, c);
        } it.hasNext() it.hasNext it {
            String s = it.next();
            int c = m.get(s);
            maxCount = Math.max(maxCount, c);
        } String s = it.next(); s it.next() it.next it int c = m.get(s); c m.get(s) m.get m s maxCount = Math.max(maxCount, c) maxCount Math.max(maxCount, c) Math.max Math maxCount c it = keySet.iterator() it keySet.iterator() keySet.iterator keySet SortedSet<String> results = new TreeSet<>(); results new TreeSet<>() while(it.hasNext()) {
            String s = it.next();
            int c = m.get(s);
            if(c==maxCount) {
                results.add(s);
            }
        } it.hasNext() it.hasNext it {
            String s = it.next();
            int c = m.get(s);
            if(c==maxCount) {
                results.add(s);
            }
        } String s = it.next(); s it.next() it.next it int c = m.get(s); c m.get(s) m.get m s if(c==maxCount) {
                results.add(s);
            } c==maxCount c maxCount {
                results.add(s);
            } results.add(s) results.add results s it = results.iterator() it results.iterator() results.iterator results while(it.hasNext()) {
            System.out.println(it.next());
        } it.hasNext() it.hasNext it {
            System.out.println(it.next());
        } System.out.println(it.next()) System.out.println System.out System System.out it.next() it.next it String[] args args public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        Map<String, Integer> m = new HashMap<>(n);
        for(int i=0; i<n; i++) {
            String s = in.next();
            if(m.containsKey(s)) {
                m.put(s, m.get(s)+1);
            }
            else {
                m.put(s, 1);
            }
        }
        Set<String> keySet = m.keySet();
        int maxCount = 0;
        Iterator<String> it = keySet.iterator();
        while(it.hasNext()) {
            String s = it.next();
            int c = m.get(s);
            maxCount = Math.max(maxCount, c);
        }
        it = keySet.iterator();
        SortedSet<String> results = new TreeSet<>();
        while(it.hasNext()) {
            String s = it.next();
            int c = m.get(s);
            if(c==maxCount) {
                results.add(s);
            }
        }

        it = results.iterator();
        while(it.hasNext()) {
            System.out.println(it.next());
        }
    }
} public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        Map<String, Integer> m = new HashMap<>(n);
        for(int i=0; i<n; i++) {
            String s = in.next();
            if(m.containsKey(s)) {
                m.put(s, m.get(s)+1);
            }
            else {
                m.put(s, 1);
            }
        }
        Set<String> keySet = m.keySet();
        int maxCount = 0;
        Iterator<String> it = keySet.iterator();
        while(it.hasNext()) {
            String s = it.next();
            int c = m.get(s);
            maxCount = Math.max(maxCount, c);
        }
        it = keySet.iterator();
        SortedSet<String> results = new TreeSet<>();
        while(it.hasNext()) {
            String s = it.next();
            int c = m.get(s);
            if(c==maxCount) {
                results.add(s);
            }
        }

        it = results.iterator();
        while(it.hasNext()) {
            System.out.println(it.next());
        }
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        Map<String, Integer> m = new HashMap<>(n);
        for(int i=0; i<n; i++) {
            String s = in.next();
            if(m.containsKey(s)) {
                m.put(s, m.get(s)+1);
            }
            else {
                m.put(s, 1);
            }
        }
        Set<String> keySet = m.keySet();
        int maxCount = 0;
        Iterator<String> it = keySet.iterator();
        while(it.hasNext()) {
            String s = it.next();
            int c = m.get(s);
            maxCount = Math.max(maxCount, c);
        }
        it = keySet.iterator();
        SortedSet<String> results = new TreeSet<>();
        while(it.hasNext()) {
            String s = it.next();
            int c = m.get(s);
            if(c==maxCount) {
                results.add(s);
            }
        }

        it = results.iterator();
        while(it.hasNext()) {
            System.out.println(it.next());
        }
    }
}
