import java.util.*;
import java.io.*;

public class Main {
 
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();   
        String[] s = new String[n];
        for (int i = 0; i < n; i++) {
            s[i] = sc.next();
        }
        Set<String> sets = new HashSet<>();
        for (int i = 0; i < n; i++) {
            sets.add(s[i]);
        }
        Map<String, Integer> map = new HashMap<>();
        for (String set : sets) {
            map.put(set, 0);
        }
        for (int i = 0; i < n; i++) {
            map.put(s[i], map.get(s[i])+1);
        }
        Set<String> results = new HashSet<>();
        int max = map.get(s[0]);
        results.add(s[0]);
        for (int i = 1; i < n; i++) {
            if (map.get(s[i]) > max) {
                max = map.get(s[i]);
                results.clear();
                results.add(s[i]);
            } else if (map.get(s[i]) == max) {
                results.add(s[i]);
            }
        }
        List<String> list = new ArrayList<>();
        for (String result : results) {
            list.add(result);
        }

        Collections.sort(list);
        for (int i = 0; i < list.size(); i++) {
            System.out.println(list.get(i));
        }
        
    }
} import java.util.*; util.* java import java.io.*; io.* java public class Main {
 
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();   
        String[] s = new String[n];
        for (int i = 0; i < n; i++) {
            s[i] = sc.next();
        }
        Set<String> sets = new HashSet<>();
        for (int i = 0; i < n; i++) {
            sets.add(s[i]);
        }
        Map<String, Integer> map = new HashMap<>();
        for (String set : sets) {
            map.put(set, 0);
        }
        for (int i = 0; i < n; i++) {
            map.put(s[i], map.get(s[i])+1);
        }
        Set<String> results = new HashSet<>();
        int max = map.get(s[0]);
        results.add(s[0]);
        for (int i = 1; i < n; i++) {
            if (map.get(s[i]) > max) {
                max = map.get(s[i]);
                results.clear();
                results.add(s[i]);
            } else if (map.get(s[i]) == max) {
                results.add(s[i]);
            }
        }
        List<String> list = new ArrayList<>();
        for (String result : results) {
            list.add(result);
        }

        Collections.sort(list);
        for (int i = 0; i < list.size(); i++) {
            System.out.println(list.get(i));
        }
        
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();   
        String[] s = new String[n];
        for (int i = 0; i < n; i++) {
            s[i] = sc.next();
        }
        Set<String> sets = new HashSet<>();
        for (int i = 0; i < n; i++) {
            sets.add(s[i]);
        }
        Map<String, Integer> map = new HashMap<>();
        for (String set : sets) {
            map.put(set, 0);
        }
        for (int i = 0; i < n; i++) {
            map.put(s[i], map.get(s[i])+1);
        }
        Set<String> results = new HashSet<>();
        int max = map.get(s[0]);
        results.add(s[0]);
        for (int i = 1; i < n; i++) {
            if (map.get(s[i]) > max) {
                max = map.get(s[i]);
                results.clear();
                results.add(s[i]);
            } else if (map.get(s[i]) == max) {
                results.add(s[i]);
            }
        }
        List<String> list = new ArrayList<>();
        for (String result : results) {
            list.add(result);
        }

        Collections.sort(list);
        for (int i = 0; i < list.size(); i++) {
            System.out.println(list.get(i));
        }
        
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();   
        String[] s = new String[n];
        for (int i = 0; i < n; i++) {
            s[i] = sc.next();
        }
        Set<String> sets = new HashSet<>();
        for (int i = 0; i < n; i++) {
            sets.add(s[i]);
        }
        Map<String, Integer> map = new HashMap<>();
        for (String set : sets) {
            map.put(set, 0);
        }
        for (int i = 0; i < n; i++) {
            map.put(s[i], map.get(s[i])+1);
        }
        Set<String> results = new HashSet<>();
        int max = map.get(s[0]);
        results.add(s[0]);
        for (int i = 1; i < n; i++) {
            if (map.get(s[i]) > max) {
                max = map.get(s[i]);
                results.clear();
                results.add(s[i]);
            } else if (map.get(s[i]) == max) {
                results.add(s[i]);
            }
        }
        List<String> list = new ArrayList<>();
        for (String result : results) {
            list.add(result);
        }

        Collections.sort(list);
        for (int i = 0; i < list.size(); i++) {
            System.out.println(list.get(i));
        }
        
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc String[] s = new String[n]; s new String[n] n for (int i = 0; i < n; i++) {
            s[i] = sc.next();
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            s[i] = sc.next();
        } {
            s[i] = sc.next();
        } s[i] = sc.next() s[i] s i sc.next() sc.next sc Set<String> sets = new HashSet<>(); sets new HashSet<>() for (int i = 0; i < n; i++) {
            sets.add(s[i]);
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            sets.add(s[i]);
        } {
            sets.add(s[i]);
        } sets.add(s[i]) sets.add sets s[i] s i Map<String, Integer> map = new HashMap<>(); map new HashMap<>() for (String set : sets) {
            map.put(set, 0);
        } String set sets {
            map.put(set, 0);
        } {
            map.put(set, 0);
        } map.put(set, 0) map.put map set 0 for (int i = 0; i < n; i++) {
            map.put(s[i], map.get(s[i])+1);
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            map.put(s[i], map.get(s[i])+1);
        } {
            map.put(s[i], map.get(s[i])+1);
        } map.put(s[i], map.get(s[i])+1) map.put map s[i] s i map.get(s[i])+1 map.get(s[i]) map.get map s[i] s i 1 Set<String> results = new HashSet<>(); results new HashSet<>() int max = map.get(s[0]); max map.get(s[0]) map.get map s[0] s 0 results.add(s[0]) results.add results s[0] s 0 for (int i = 1; i < n; i++) {
            if (map.get(s[i]) > max) {
                max = map.get(s[i]);
                results.clear();
                results.add(s[i]);
            } else if (map.get(s[i]) == max) {
                results.add(s[i]);
            }
        } int i = 1; int i = 1; i 1 i < n i n i++ i++ i {
            if (map.get(s[i]) > max) {
                max = map.get(s[i]);
                results.clear();
                results.add(s[i]);
            } else if (map.get(s[i]) == max) {
                results.add(s[i]);
            }
        } {
            if (map.get(s[i]) > max) {
                max = map.get(s[i]);
                results.clear();
                results.add(s[i]);
            } else if (map.get(s[i]) == max) {
                results.add(s[i]);
            }
        } if (map.get(s[i]) > max) {
                max = map.get(s[i]);
                results.clear();
                results.add(s[i]);
            } else if (map.get(s[i]) == max) {
                results.add(s[i]);
            } map.get(s[i]) > max map.get(s[i]) map.get map s[i] s i max {
                max = map.get(s[i]);
                results.clear();
                results.add(s[i]);
            } max = map.get(s[i]) max map.get(s[i]) map.get map s[i] s i results.clear() results.clear results results.add(s[i]) results.add results s[i] s i if (map.get(s[i]) == max) {
                results.add(s[i]);
            } map.get(s[i]) == max map.get(s[i]) map.get map s[i] s i max {
                results.add(s[i]);
            } results.add(s[i]) results.add results s[i] s i List<String> list = new ArrayList<>(); list new ArrayList<>() for (String result : results) {
            list.add(result);
        } String result results {
            list.add(result);
        } {
            list.add(result);
        } list.add(result) list.add list result Collections.sort(list) Collections.sort Collections list for (int i = 0; i < list.size(); i++) {
            System.out.println(list.get(i));
        } int i = 0; int i = 0; i 0 i < list.size() i list.size() list.size list i++ i++ i {
            System.out.println(list.get(i));
        } {
            System.out.println(list.get(i));
        } System.out.println(list.get(i)) System.out.println System.out System System.out list.get(i) list.get list i String[] args args public class Main {
 
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();   
        String[] s = new String[n];
        for (int i = 0; i < n; i++) {
            s[i] = sc.next();
        }
        Set<String> sets = new HashSet<>();
        for (int i = 0; i < n; i++) {
            sets.add(s[i]);
        }
        Map<String, Integer> map = new HashMap<>();
        for (String set : sets) {
            map.put(set, 0);
        }
        for (int i = 0; i < n; i++) {
            map.put(s[i], map.get(s[i])+1);
        }
        Set<String> results = new HashSet<>();
        int max = map.get(s[0]);
        results.add(s[0]);
        for (int i = 1; i < n; i++) {
            if (map.get(s[i]) > max) {
                max = map.get(s[i]);
                results.clear();
                results.add(s[i]);
            } else if (map.get(s[i]) == max) {
                results.add(s[i]);
            }
        }
        List<String> list = new ArrayList<>();
        for (String result : results) {
            list.add(result);
        }

        Collections.sort(list);
        for (int i = 0; i < list.size(); i++) {
            System.out.println(list.get(i));
        }
        
    }
} public class Main {
 
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();   
        String[] s = new String[n];
        for (int i = 0; i < n; i++) {
            s[i] = sc.next();
        }
        Set<String> sets = new HashSet<>();
        for (int i = 0; i < n; i++) {
            sets.add(s[i]);
        }
        Map<String, Integer> map = new HashMap<>();
        for (String set : sets) {
            map.put(set, 0);
        }
        for (int i = 0; i < n; i++) {
            map.put(s[i], map.get(s[i])+1);
        }
        Set<String> results = new HashSet<>();
        int max = map.get(s[0]);
        results.add(s[0]);
        for (int i = 1; i < n; i++) {
            if (map.get(s[i]) > max) {
                max = map.get(s[i]);
                results.clear();
                results.add(s[i]);
            } else if (map.get(s[i]) == max) {
                results.add(s[i]);
            }
        }
        List<String> list = new ArrayList<>();
        for (String result : results) {
            list.add(result);
        }

        Collections.sort(list);
        for (int i = 0; i < list.size(); i++) {
            System.out.println(list.get(i));
        }
        
    }
} Main
import java.util.*;
import java.io.*;

public class Main {
 
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();   
        String[] s = new String[n];
        for (int i = 0; i < n; i++) {
            s[i] = sc.next();
        }
        Set<String> sets = new HashSet<>();
        for (int i = 0; i < n; i++) {
            sets.add(s[i]);
        }
        Map<String, Integer> map = new HashMap<>();
        for (String set : sets) {
            map.put(set, 0);
        }
        for (int i = 0; i < n; i++) {
            map.put(s[i], map.get(s[i])+1);
        }
        Set<String> results = new HashSet<>();
        int max = map.get(s[0]);
        results.add(s[0]);
        for (int i = 1; i < n; i++) {
            if (map.get(s[i]) > max) {
                max = map.get(s[i]);
                results.clear();
                results.add(s[i]);
            } else if (map.get(s[i]) == max) {
                results.add(s[i]);
            }
        }
        List<String> list = new ArrayList<>();
        for (String result : results) {
            list.add(result);
        }

        Collections.sort(list);
        for (int i = 0; i < list.size(); i++) {
            System.out.println(list.get(i));
        }
        
    }
}