import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.*;

public class Main {
    static PrintWriter out = new PrintWriter(System.out);
    static Scanner sc = new Scanner(System.in);
    static BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
    public static void main(String[] args) throws IOException {
        Main main = new Main();
        main.solve();
//        System.out.println(main.solve());
    }
    void solve() throws IOException {
        int n = sc.nextInt();
        HashMap<String,Integer> map = new HashMap<>();
        for(int i=0;i<n;i++){
            String s = sc.next();
            map.put(s,map.getOrDefault(s,0)+1);
        }
        int maxi = 1;
        ArrayList<String> res = new ArrayList<>();
        for(String s:map.keySet()){
            int val = map.get(s);
            if(val<maxi) continue;
            if(val==maxi) res.add(s);
            else{
                maxi = val;
                res.clear(); res.add(s);
            }
        }
        Collections.sort(res);
        for(String s:res) System.out.println(s);
    }
}
 import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.PrintWriter; PrintWriter java.io import java.util.*; util.* java public class Main {
    static PrintWriter out = new PrintWriter(System.out);
    static Scanner sc = new Scanner(System.in);
    static BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
    public static void main(String[] args) throws IOException {
        Main main = new Main();
        main.solve();
//        System.out.println(main.solve());
    }
    void solve() throws IOException {
        int n = sc.nextInt();
        HashMap<String,Integer> map = new HashMap<>();
        for(int i=0;i<n;i++){
            String s = sc.next();
            map.put(s,map.getOrDefault(s,0)+1);
        }
        int maxi = 1;
        ArrayList<String> res = new ArrayList<>();
        for(String s:map.keySet()){
            int val = map.get(s);
            if(val<maxi) continue;
            if(val==maxi) res.add(s);
            else{
                maxi = val;
                res.clear(); res.add(s);
            }
        }
        Collections.sort(res);
        for(String s:res) System.out.println(s);
    }
} Main static PrintWriter out = new PrintWriter(System.out); out new PrintWriter(System.out) static Scanner sc = new Scanner(System.in); sc new Scanner(System.in) static BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); reader new BufferedReader(new InputStreamReader(System.in)) public static void main(String[] args) throws IOException {
        Main main = new Main();
        main.solve();
//        System.out.println(main.solve());
    } main {
        Main main = new Main();
        main.solve();
//        System.out.println(main.solve());
    } Main main = new Main(); main new Main() main.solve() main.solve main String[] args args void solve() throws IOException {
        int n = sc.nextInt();
        HashMap<String,Integer> map = new HashMap<>();
        for(int i=0;i<n;i++){
            String s = sc.next();
            map.put(s,map.getOrDefault(s,0)+1);
        }
        int maxi = 1;
        ArrayList<String> res = new ArrayList<>();
        for(String s:map.keySet()){
            int val = map.get(s);
            if(val<maxi) continue;
            if(val==maxi) res.add(s);
            else{
                maxi = val;
                res.clear(); res.add(s);
            }
        }
        Collections.sort(res);
        for(String s:res) System.out.println(s);
    } solve {
        int n = sc.nextInt();
        HashMap<String,Integer> map = new HashMap<>();
        for(int i=0;i<n;i++){
            String s = sc.next();
            map.put(s,map.getOrDefault(s,0)+1);
        }
        int maxi = 1;
        ArrayList<String> res = new ArrayList<>();
        for(String s:map.keySet()){
            int val = map.get(s);
            if(val<maxi) continue;
            if(val==maxi) res.add(s);
            else{
                maxi = val;
                res.clear(); res.add(s);
            }
        }
        Collections.sort(res);
        for(String s:res) System.out.println(s);
    } int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc HashMap<String,Integer> map = new HashMap<>(); map new HashMap<>() for(int i=0;i<n;i++){
            String s = sc.next();
            map.put(s,map.getOrDefault(s,0)+1);
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
            String s = sc.next();
            map.put(s,map.getOrDefault(s,0)+1);
        } {
            String s = sc.next();
            map.put(s,map.getOrDefault(s,0)+1);
        } String s = sc.next(); s sc.next() sc.next sc map.put(s,map.getOrDefault(s,0)+1) map.put map s map.getOrDefault(s,0)+1 map.getOrDefault(s,0) map.getOrDefault map s 0 1 int maxi = 1; maxi 1 ArrayList<String> res = new ArrayList<>(); res new ArrayList<>() for(String s:map.keySet()){
            int val = map.get(s);
            if(val<maxi) continue;
            if(val==maxi) res.add(s);
            else{
                maxi = val;
                res.clear(); res.add(s);
            }
        } String s map.keySet() map.keySet map {
            int val = map.get(s);
            if(val<maxi) continue;
            if(val==maxi) res.add(s);
            else{
                maxi = val;
                res.clear(); res.add(s);
            }
        } {
            int val = map.get(s);
            if(val<maxi) continue;
            if(val==maxi) res.add(s);
            else{
                maxi = val;
                res.clear(); res.add(s);
            }
        } int val = map.get(s); val map.get(s) map.get map s if(val<maxi) continue; val<maxi val maxi continue; if(val==maxi) res.add(s);
            else{
                maxi = val;
                res.clear(); res.add(s);
            } val==maxi val maxi res.add(s) res.add res s {
                maxi = val;
                res.clear(); res.add(s);
            } maxi = val maxi val res.clear() res.clear res res.add(s) res.add res s Collections.sort(res) Collections.sort Collections res for(String s:res) System.out.println(s); String s res System.out.println(s); System.out.println(s) System.out.println System.out System System.out s public class Main {
    static PrintWriter out = new PrintWriter(System.out);
    static Scanner sc = new Scanner(System.in);
    static BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
    public static void main(String[] args) throws IOException {
        Main main = new Main();
        main.solve();
//        System.out.println(main.solve());
    }
    void solve() throws IOException {
        int n = sc.nextInt();
        HashMap<String,Integer> map = new HashMap<>();
        for(int i=0;i<n;i++){
            String s = sc.next();
            map.put(s,map.getOrDefault(s,0)+1);
        }
        int maxi = 1;
        ArrayList<String> res = new ArrayList<>();
        for(String s:map.keySet()){
            int val = map.get(s);
            if(val<maxi) continue;
            if(val==maxi) res.add(s);
            else{
                maxi = val;
                res.clear(); res.add(s);
            }
        }
        Collections.sort(res);
        for(String s:res) System.out.println(s);
    }
} public class Main {
    static PrintWriter out = new PrintWriter(System.out);
    static Scanner sc = new Scanner(System.in);
    static BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
    public static void main(String[] args) throws IOException {
        Main main = new Main();
        main.solve();
//        System.out.println(main.solve());
    }
    void solve() throws IOException {
        int n = sc.nextInt();
        HashMap<String,Integer> map = new HashMap<>();
        for(int i=0;i<n;i++){
            String s = sc.next();
            map.put(s,map.getOrDefault(s,0)+1);
        }
        int maxi = 1;
        ArrayList<String> res = new ArrayList<>();
        for(String s:map.keySet()){
            int val = map.get(s);
            if(val<maxi) continue;
            if(val==maxi) res.add(s);
            else{
                maxi = val;
                res.clear(); res.add(s);
            }
        }
        Collections.sort(res);
        for(String s:res) System.out.println(s);
    }
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.*;

public class Main {
    static PrintWriter out = new PrintWriter(System.out);
    static Scanner sc = new Scanner(System.in);
    static BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
    public static void main(String[] args) throws IOException {
        Main main = new Main();
        main.solve();
//        System.out.println(main.solve());
    }
    void solve() throws IOException {
        int n = sc.nextInt();
        HashMap<String,Integer> map = new HashMap<>();
        for(int i=0;i<n;i++){
            String s = sc.next();
            map.put(s,map.getOrDefault(s,0)+1);
        }
        int maxi = 1;
        ArrayList<String> res = new ArrayList<>();
        for(String s:map.keySet()){
            int val = map.get(s);
            if(val<maxi) continue;
            if(val==maxi) res.add(s);
            else{
                maxi = val;
                res.clear(); res.add(s);
            }
        }
        Collections.sort(res);
        for(String s:res) System.out.println(s);
    }
}

