import java.util.*;

public class Main {
    static Scanner sc = new Scanner(System.in);
    public static void main(String[] args) {
        int n = Integer.parseInt(sc.next());
        Map<String, Integer> counts = new HashMap<>();
        int maxCount = 0;
        for(int i = 0; i < n; ++i) {
            String k = sc.next();
            int t = counts.getOrDefault(k, 0);
            counts.put(k, t + 1);
            maxCount = Math.max(maxCount, t + 1);
        }
        
        List<String> sl = new ArrayList<>();
        for(Map.Entry<String, Integer> entry : counts.entrySet()) {
            if(entry.getValue() == maxCount) {
                sl.add(entry.getKey());
            }
        }
        
        Collections.sort(sl);
        for(String s : sl) {
            System.out.println(s);
        }
    }
} import java.util.*; util.* java public class Main {
    static Scanner sc = new Scanner(System.in);
    public static void main(String[] args) {
        int n = Integer.parseInt(sc.next());
        Map<String, Integer> counts = new HashMap<>();
        int maxCount = 0;
        for(int i = 0; i < n; ++i) {
            String k = sc.next();
            int t = counts.getOrDefault(k, 0);
            counts.put(k, t + 1);
            maxCount = Math.max(maxCount, t + 1);
        }
        
        List<String> sl = new ArrayList<>();
        for(Map.Entry<String, Integer> entry : counts.entrySet()) {
            if(entry.getValue() == maxCount) {
                sl.add(entry.getKey());
            }
        }
        
        Collections.sort(sl);
        for(String s : sl) {
            System.out.println(s);
        }
    }
} Main static Scanner sc = new Scanner(System.in); sc new Scanner(System.in) public static void main(String[] args) {
        int n = Integer.parseInt(sc.next());
        Map<String, Integer> counts = new HashMap<>();
        int maxCount = 0;
        for(int i = 0; i < n; ++i) {
            String k = sc.next();
            int t = counts.getOrDefault(k, 0);
            counts.put(k, t + 1);
            maxCount = Math.max(maxCount, t + 1);
        }
        
        List<String> sl = new ArrayList<>();
        for(Map.Entry<String, Integer> entry : counts.entrySet()) {
            if(entry.getValue() == maxCount) {
                sl.add(entry.getKey());
            }
        }
        
        Collections.sort(sl);
        for(String s : sl) {
            System.out.println(s);
        }
    } main {
        int n = Integer.parseInt(sc.next());
        Map<String, Integer> counts = new HashMap<>();
        int maxCount = 0;
        for(int i = 0; i < n; ++i) {
            String k = sc.next();
            int t = counts.getOrDefault(k, 0);
            counts.put(k, t + 1);
            maxCount = Math.max(maxCount, t + 1);
        }
        
        List<String> sl = new ArrayList<>();
        for(Map.Entry<String, Integer> entry : counts.entrySet()) {
            if(entry.getValue() == maxCount) {
                sl.add(entry.getKey());
            }
        }
        
        Collections.sort(sl);
        for(String s : sl) {
            System.out.println(s);
        }
    } int n = Integer.parseInt(sc.next()); n Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc Map<String, Integer> counts = new HashMap<>(); counts new HashMap<>() int maxCount = 0; maxCount 0 for(int i = 0; i < n; ++i) {
            String k = sc.next();
            int t = counts.getOrDefault(k, 0);
            counts.put(k, t + 1);
            maxCount = Math.max(maxCount, t + 1);
        } int i = 0; int i = 0; i 0 i < n i n ++i ++i i {
            String k = sc.next();
            int t = counts.getOrDefault(k, 0);
            counts.put(k, t + 1);
            maxCount = Math.max(maxCount, t + 1);
        } {
            String k = sc.next();
            int t = counts.getOrDefault(k, 0);
            counts.put(k, t + 1);
            maxCount = Math.max(maxCount, t + 1);
        } String k = sc.next(); k sc.next() sc.next sc int t = counts.getOrDefault(k, 0); t counts.getOrDefault(k, 0) counts.getOrDefault counts k 0 counts.put(k, t + 1) counts.put counts k t + 1 t 1 maxCount = Math.max(maxCount, t + 1) maxCount Math.max(maxCount, t + 1) Math.max Math maxCount t + 1 t 1 List<String> sl = new ArrayList<>(); sl new ArrayList<>() for(Map.Entry<String, Integer> entry : counts.entrySet()) {
            if(entry.getValue() == maxCount) {
                sl.add(entry.getKey());
            }
        } Map.Entry<String, Integer> entry counts.entrySet() counts.entrySet counts {
            if(entry.getValue() == maxCount) {
                sl.add(entry.getKey());
            }
        } {
            if(entry.getValue() == maxCount) {
                sl.add(entry.getKey());
            }
        } if(entry.getValue() == maxCount) {
                sl.add(entry.getKey());
            } entry.getValue() == maxCount entry.getValue() entry.getValue entry maxCount {
                sl.add(entry.getKey());
            } sl.add(entry.getKey()) sl.add sl entry.getKey() entry.getKey entry Collections.sort(sl) Collections.sort Collections sl for(String s : sl) {
            System.out.println(s);
        } String s sl {
            System.out.println(s);
        } {
            System.out.println(s);
        } System.out.println(s) System.out.println System.out System System.out s String[] args args public class Main {
    static Scanner sc = new Scanner(System.in);
    public static void main(String[] args) {
        int n = Integer.parseInt(sc.next());
        Map<String, Integer> counts = new HashMap<>();
        int maxCount = 0;
        for(int i = 0; i < n; ++i) {
            String k = sc.next();
            int t = counts.getOrDefault(k, 0);
            counts.put(k, t + 1);
            maxCount = Math.max(maxCount, t + 1);
        }
        
        List<String> sl = new ArrayList<>();
        for(Map.Entry<String, Integer> entry : counts.entrySet()) {
            if(entry.getValue() == maxCount) {
                sl.add(entry.getKey());
            }
        }
        
        Collections.sort(sl);
        for(String s : sl) {
            System.out.println(s);
        }
    }
} public class Main {
    static Scanner sc = new Scanner(System.in);
    public static void main(String[] args) {
        int n = Integer.parseInt(sc.next());
        Map<String, Integer> counts = new HashMap<>();
        int maxCount = 0;
        for(int i = 0; i < n; ++i) {
            String k = sc.next();
            int t = counts.getOrDefault(k, 0);
            counts.put(k, t + 1);
            maxCount = Math.max(maxCount, t + 1);
        }
        
        List<String> sl = new ArrayList<>();
        for(Map.Entry<String, Integer> entry : counts.entrySet()) {
            if(entry.getValue() == maxCount) {
                sl.add(entry.getKey());
            }
        }
        
        Collections.sort(sl);
        for(String s : sl) {
            System.out.println(s);
        }
    }
} Main
import java.util.*;

public class Main {
    static Scanner sc = new Scanner(System.in);
    public static void main(String[] args) {
        int n = Integer.parseInt(sc.next());
        Map<String, Integer> counts = new HashMap<>();
        int maxCount = 0;
        for(int i = 0; i < n; ++i) {
            String k = sc.next();
            int t = counts.getOrDefault(k, 0);
            counts.put(k, t + 1);
            maxCount = Math.max(maxCount, t + 1);
        }
        
        List<String> sl = new ArrayList<>();
        for(Map.Entry<String, Integer> entry : counts.entrySet()) {
            if(entry.getValue() == maxCount) {
                sl.add(entry.getKey());
            }
        }
        
        Collections.sort(sl);
        for(String s : sl) {
            System.out.println(s);
        }
    }
}
