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

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        Map<String, Long> voteMap = new HashMap<>();
        long N = Long.parseLong(sc.nextLine());
        long maxCount = 0L;
        for (long i = 0; i < N; i++) {
            String voteName = sc.nextLine();
            Long count = voteMap.get(voteName);
            if (Objects.isNull(count)) {
                voteMap.put(voteName, 1L);
            } else {
                long newCount = count + 1;
                if (newCount > maxCount) {
                    maxCount = newCount;
                }
                voteMap.put(voteName, newCount);
            }
        }
        sc.close();
        List<String> maxNames = new ArrayList<>();
        for (String name : voteMap.keySet()) {
            long count = voteMap.get(name);
            if (count == maxCount || maxCount == 0) {
                maxNames.add(name);
            }
        }
        Collections.sort(maxNames);
        for (String name : maxNames) {
            System.out.println(name);
        }
    }

} import java.util.Map; Map java.util import java.util.Objects; Objects java.util import java.util.Scanner; Scanner java.util 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 public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        Map<String, Long> voteMap = new HashMap<>();
        long N = Long.parseLong(sc.nextLine());
        long maxCount = 0L;
        for (long i = 0; i < N; i++) {
            String voteName = sc.nextLine();
            Long count = voteMap.get(voteName);
            if (Objects.isNull(count)) {
                voteMap.put(voteName, 1L);
            } else {
                long newCount = count + 1;
                if (newCount > maxCount) {
                    maxCount = newCount;
                }
                voteMap.put(voteName, newCount);
            }
        }
        sc.close();
        List<String> maxNames = new ArrayList<>();
        for (String name : voteMap.keySet()) {
            long count = voteMap.get(name);
            if (count == maxCount || maxCount == 0) {
                maxNames.add(name);
            }
        }
        Collections.sort(maxNames);
        for (String name : maxNames) {
            System.out.println(name);
        }
    }

} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        Map<String, Long> voteMap = new HashMap<>();
        long N = Long.parseLong(sc.nextLine());
        long maxCount = 0L;
        for (long i = 0; i < N; i++) {
            String voteName = sc.nextLine();
            Long count = voteMap.get(voteName);
            if (Objects.isNull(count)) {
                voteMap.put(voteName, 1L);
            } else {
                long newCount = count + 1;
                if (newCount > maxCount) {
                    maxCount = newCount;
                }
                voteMap.put(voteName, newCount);
            }
        }
        sc.close();
        List<String> maxNames = new ArrayList<>();
        for (String name : voteMap.keySet()) {
            long count = voteMap.get(name);
            if (count == maxCount || maxCount == 0) {
                maxNames.add(name);
            }
        }
        Collections.sort(maxNames);
        for (String name : maxNames) {
            System.out.println(name);
        }
    } main {
        Scanner sc = new Scanner(System.in);
        Map<String, Long> voteMap = new HashMap<>();
        long N = Long.parseLong(sc.nextLine());
        long maxCount = 0L;
        for (long i = 0; i < N; i++) {
            String voteName = sc.nextLine();
            Long count = voteMap.get(voteName);
            if (Objects.isNull(count)) {
                voteMap.put(voteName, 1L);
            } else {
                long newCount = count + 1;
                if (newCount > maxCount) {
                    maxCount = newCount;
                }
                voteMap.put(voteName, newCount);
            }
        }
        sc.close();
        List<String> maxNames = new ArrayList<>();
        for (String name : voteMap.keySet()) {
            long count = voteMap.get(name);
            if (count == maxCount || maxCount == 0) {
                maxNames.add(name);
            }
        }
        Collections.sort(maxNames);
        for (String name : maxNames) {
            System.out.println(name);
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) Map<String, Long> voteMap = new HashMap<>(); voteMap new HashMap<>() long N = Long.parseLong(sc.nextLine()); N Long.parseLong(sc.nextLine()) Long.parseLong Long sc.nextLine() sc.nextLine sc long maxCount = 0L; maxCount 0L for (long i = 0; i < N; i++) {
            String voteName = sc.nextLine();
            Long count = voteMap.get(voteName);
            if (Objects.isNull(count)) {
                voteMap.put(voteName, 1L);
            } else {
                long newCount = count + 1;
                if (newCount > maxCount) {
                    maxCount = newCount;
                }
                voteMap.put(voteName, newCount);
            }
        } long i = 0; long i = 0; i 0 i < N i N i++ i++ i {
            String voteName = sc.nextLine();
            Long count = voteMap.get(voteName);
            if (Objects.isNull(count)) {
                voteMap.put(voteName, 1L);
            } else {
                long newCount = count + 1;
                if (newCount > maxCount) {
                    maxCount = newCount;
                }
                voteMap.put(voteName, newCount);
            }
        } {
            String voteName = sc.nextLine();
            Long count = voteMap.get(voteName);
            if (Objects.isNull(count)) {
                voteMap.put(voteName, 1L);
            } else {
                long newCount = count + 1;
                if (newCount > maxCount) {
                    maxCount = newCount;
                }
                voteMap.put(voteName, newCount);
            }
        } String voteName = sc.nextLine(); voteName sc.nextLine() sc.nextLine sc Long count = voteMap.get(voteName); count voteMap.get(voteName) voteMap.get voteMap voteName if (Objects.isNull(count)) {
                voteMap.put(voteName, 1L);
            } else {
                long newCount = count + 1;
                if (newCount > maxCount) {
                    maxCount = newCount;
                }
                voteMap.put(voteName, newCount);
            } Objects.isNull(count) Objects.isNull Objects count {
                voteMap.put(voteName, 1L);
            } voteMap.put(voteName, 1L) voteMap.put voteMap voteName 1L {
                long newCount = count + 1;
                if (newCount > maxCount) {
                    maxCount = newCount;
                }
                voteMap.put(voteName, newCount);
            } long newCount = count + 1; newCount count + 1 count 1 if (newCount > maxCount) {
                    maxCount = newCount;
                } newCount > maxCount newCount maxCount {
                    maxCount = newCount;
                } maxCount = newCount maxCount newCount voteMap.put(voteName, newCount) voteMap.put voteMap voteName newCount sc.close() sc.close sc List<String> maxNames = new ArrayList<>(); maxNames new ArrayList<>() for (String name : voteMap.keySet()) {
            long count = voteMap.get(name);
            if (count == maxCount || maxCount == 0) {
                maxNames.add(name);
            }
        } String name voteMap.keySet() voteMap.keySet voteMap {
            long count = voteMap.get(name);
            if (count == maxCount || maxCount == 0) {
                maxNames.add(name);
            }
        } {
            long count = voteMap.get(name);
            if (count == maxCount || maxCount == 0) {
                maxNames.add(name);
            }
        } long count = voteMap.get(name); count voteMap.get(name) voteMap.get voteMap name if (count == maxCount || maxCount == 0) {
                maxNames.add(name);
            } count == maxCount || maxCount == 0 count == maxCount count maxCount maxCount == 0 maxCount 0 {
                maxNames.add(name);
            } maxNames.add(name) maxNames.add maxNames name Collections.sort(maxNames) Collections.sort Collections maxNames for (String name : maxNames) {
            System.out.println(name);
        } String name maxNames {
            System.out.println(name);
        } {
            System.out.println(name);
        } System.out.println(name) System.out.println System.out System System.out name String[] args args public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        Map<String, Long> voteMap = new HashMap<>();
        long N = Long.parseLong(sc.nextLine());
        long maxCount = 0L;
        for (long i = 0; i < N; i++) {
            String voteName = sc.nextLine();
            Long count = voteMap.get(voteName);
            if (Objects.isNull(count)) {
                voteMap.put(voteName, 1L);
            } else {
                long newCount = count + 1;
                if (newCount > maxCount) {
                    maxCount = newCount;
                }
                voteMap.put(voteName, newCount);
            }
        }
        sc.close();
        List<String> maxNames = new ArrayList<>();
        for (String name : voteMap.keySet()) {
            long count = voteMap.get(name);
            if (count == maxCount || maxCount == 0) {
                maxNames.add(name);
            }
        }
        Collections.sort(maxNames);
        for (String name : maxNames) {
            System.out.println(name);
        }
    }

} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        Map<String, Long> voteMap = new HashMap<>();
        long N = Long.parseLong(sc.nextLine());
        long maxCount = 0L;
        for (long i = 0; i < N; i++) {
            String voteName = sc.nextLine();
            Long count = voteMap.get(voteName);
            if (Objects.isNull(count)) {
                voteMap.put(voteName, 1L);
            } else {
                long newCount = count + 1;
                if (newCount > maxCount) {
                    maxCount = newCount;
                }
                voteMap.put(voteName, newCount);
            }
        }
        sc.close();
        List<String> maxNames = new ArrayList<>();
        for (String name : voteMap.keySet()) {
            long count = voteMap.get(name);
            if (count == maxCount || maxCount == 0) {
                maxNames.add(name);
            }
        }
        Collections.sort(maxNames);
        for (String name : maxNames) {
            System.out.println(name);
        }
    }

} Main
import java.util.Map;
import java.util.Objects;
import java.util.Scanner;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        Map<String, Long> voteMap = new HashMap<>();
        long N = Long.parseLong(sc.nextLine());
        long maxCount = 0L;
        for (long i = 0; i < N; i++) {
            String voteName = sc.nextLine();
            Long count = voteMap.get(voteName);
            if (Objects.isNull(count)) {
                voteMap.put(voteName, 1L);
            } else {
                long newCount = count + 1;
                if (newCount > maxCount) {
                    maxCount = newCount;
                }
                voteMap.put(voteName, newCount);
            }
        }
        sc.close();
        List<String> maxNames = new ArrayList<>();
        for (String name : voteMap.keySet()) {
            long count = voteMap.get(name);
            if (count == maxCount || maxCount == 0) {
                maxNames.add(name);
            }
        }
        Collections.sort(maxNames);
        for (String name : maxNames) {
            System.out.println(name);
        }
    }

}
