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

/**
 * Created by Ayushi on 16 Feb 2020.
 * Problem:
 * Round:
 */

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String temp = br.readLine();
        int n = Integer.parseInt(temp);
        String[] ans = new String[n];
        int a = 0;
        int m = 1;
        HashMap<String, Integer> hmap = new HashMap<>();
        hmap.put("", 0);
        for (int i = 0; i < n; i++) {
            temp = br.readLine();

            if (hmap.containsKey(temp)) {
                hmap.replace(temp, hmap.get(temp)+1);
                m = Math.max(m, hmap.get(temp));
                ans[i] = "";
            }
            else {
                hmap.put(temp, 1);
                ans[i] = temp;
                a++;
            }
        }
        br.close();

        Arrays.sort(ans);
        for (int j = n-a; j < n; j++) {
            if (hmap.get(ans[j]) != m) {
                ans[j] = "";
            }
        }
        Arrays.sort(ans);
        for (int k = 0; k < n; k++) {
            if (!(ans[k].equals(""))) System.out.println(ans[k]);
        }
    }
} import java.io.*; io.* java import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String temp = br.readLine();
        int n = Integer.parseInt(temp);
        String[] ans = new String[n];
        int a = 0;
        int m = 1;
        HashMap<String, Integer> hmap = new HashMap<>();
        hmap.put("", 0);
        for (int i = 0; i < n; i++) {
            temp = br.readLine();

            if (hmap.containsKey(temp)) {
                hmap.replace(temp, hmap.get(temp)+1);
                m = Math.max(m, hmap.get(temp));
                ans[i] = "";
            }
            else {
                hmap.put(temp, 1);
                ans[i] = temp;
                a++;
            }
        }
        br.close();

        Arrays.sort(ans);
        for (int j = n-a; j < n; j++) {
            if (hmap.get(ans[j]) != m) {
                ans[j] = "";
            }
        }
        Arrays.sort(ans);
        for (int k = 0; k < n; k++) {
            if (!(ans[k].equals(""))) System.out.println(ans[k]);
        }
    }
} Main public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String temp = br.readLine();
        int n = Integer.parseInt(temp);
        String[] ans = new String[n];
        int a = 0;
        int m = 1;
        HashMap<String, Integer> hmap = new HashMap<>();
        hmap.put("", 0);
        for (int i = 0; i < n; i++) {
            temp = br.readLine();

            if (hmap.containsKey(temp)) {
                hmap.replace(temp, hmap.get(temp)+1);
                m = Math.max(m, hmap.get(temp));
                ans[i] = "";
            }
            else {
                hmap.put(temp, 1);
                ans[i] = temp;
                a++;
            }
        }
        br.close();

        Arrays.sort(ans);
        for (int j = n-a; j < n; j++) {
            if (hmap.get(ans[j]) != m) {
                ans[j] = "";
            }
        }
        Arrays.sort(ans);
        for (int k = 0; k < n; k++) {
            if (!(ans[k].equals(""))) System.out.println(ans[k]);
        }
    } main {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String temp = br.readLine();
        int n = Integer.parseInt(temp);
        String[] ans = new String[n];
        int a = 0;
        int m = 1;
        HashMap<String, Integer> hmap = new HashMap<>();
        hmap.put("", 0);
        for (int i = 0; i < n; i++) {
            temp = br.readLine();

            if (hmap.containsKey(temp)) {
                hmap.replace(temp, hmap.get(temp)+1);
                m = Math.max(m, hmap.get(temp));
                ans[i] = "";
            }
            else {
                hmap.put(temp, 1);
                ans[i] = temp;
                a++;
            }
        }
        br.close();

        Arrays.sort(ans);
        for (int j = n-a; j < n; j++) {
            if (hmap.get(ans[j]) != m) {
                ans[j] = "";
            }
        }
        Arrays.sort(ans);
        for (int k = 0; k < n; k++) {
            if (!(ans[k].equals(""))) System.out.println(ans[k]);
        }
    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String temp = br.readLine(); temp br.readLine() br.readLine br int n = Integer.parseInt(temp); n Integer.parseInt(temp) Integer.parseInt Integer temp String[] ans = new String[n]; ans new String[n] n int a = 0; a 0 int m = 1; m 1 HashMap<String, Integer> hmap = new HashMap<>(); hmap new HashMap<>() hmap.put("", 0) hmap.put hmap "" 0 for (int i = 0; i < n; i++) {
            temp = br.readLine();

            if (hmap.containsKey(temp)) {
                hmap.replace(temp, hmap.get(temp)+1);
                m = Math.max(m, hmap.get(temp));
                ans[i] = "";
            }
            else {
                hmap.put(temp, 1);
                ans[i] = temp;
                a++;
            }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            temp = br.readLine();

            if (hmap.containsKey(temp)) {
                hmap.replace(temp, hmap.get(temp)+1);
                m = Math.max(m, hmap.get(temp));
                ans[i] = "";
            }
            else {
                hmap.put(temp, 1);
                ans[i] = temp;
                a++;
            }
        } {
            temp = br.readLine();

            if (hmap.containsKey(temp)) {
                hmap.replace(temp, hmap.get(temp)+1);
                m = Math.max(m, hmap.get(temp));
                ans[i] = "";
            }
            else {
                hmap.put(temp, 1);
                ans[i] = temp;
                a++;
            }
        } temp = br.readLine() temp br.readLine() br.readLine br if (hmap.containsKey(temp)) {
                hmap.replace(temp, hmap.get(temp)+1);
                m = Math.max(m, hmap.get(temp));
                ans[i] = "";
            }
            else {
                hmap.put(temp, 1);
                ans[i] = temp;
                a++;
            } hmap.containsKey(temp) hmap.containsKey hmap temp {
                hmap.replace(temp, hmap.get(temp)+1);
                m = Math.max(m, hmap.get(temp));
                ans[i] = "";
            } hmap.replace(temp, hmap.get(temp)+1) hmap.replace hmap temp hmap.get(temp)+1 hmap.get(temp) hmap.get hmap temp 1 m = Math.max(m, hmap.get(temp)) m Math.max(m, hmap.get(temp)) Math.max Math m hmap.get(temp) hmap.get hmap temp ans[i] = "" ans[i] ans i "" {
                hmap.put(temp, 1);
                ans[i] = temp;
                a++;
            } hmap.put(temp, 1) hmap.put hmap temp 1 ans[i] = temp ans[i] ans i temp a++ a br.close() br.close br Arrays.sort(ans) Arrays.sort Arrays ans for (int j = n-a; j < n; j++) {
            if (hmap.get(ans[j]) != m) {
                ans[j] = "";
            }
        } int j = n-a; int j = n-a; j n-a n a j < n j n j++ j++ j {
            if (hmap.get(ans[j]) != m) {
                ans[j] = "";
            }
        } {
            if (hmap.get(ans[j]) != m) {
                ans[j] = "";
            }
        } if (hmap.get(ans[j]) != m) {
                ans[j] = "";
            } hmap.get(ans[j]) != m hmap.get(ans[j]) hmap.get hmap ans[j] ans j m {
                ans[j] = "";
            } ans[j] = "" ans[j] ans j "" Arrays.sort(ans) Arrays.sort Arrays ans for (int k = 0; k < n; k++) {
            if (!(ans[k].equals(""))) System.out.println(ans[k]);
        } int k = 0; int k = 0; k 0 k < n k n k++ k++ k {
            if (!(ans[k].equals(""))) System.out.println(ans[k]);
        } {
            if (!(ans[k].equals(""))) System.out.println(ans[k]);
        } if (!(ans[k].equals(""))) System.out.println(ans[k]); !(ans[k].equals("")) (ans[k].equals("")) ans[k].equals ans[k] ans k "" System.out.println(ans[k]) System.out.println System.out System System.out ans[k] ans k String[] args args public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String temp = br.readLine();
        int n = Integer.parseInt(temp);
        String[] ans = new String[n];
        int a = 0;
        int m = 1;
        HashMap<String, Integer> hmap = new HashMap<>();
        hmap.put("", 0);
        for (int i = 0; i < n; i++) {
            temp = br.readLine();

            if (hmap.containsKey(temp)) {
                hmap.replace(temp, hmap.get(temp)+1);
                m = Math.max(m, hmap.get(temp));
                ans[i] = "";
            }
            else {
                hmap.put(temp, 1);
                ans[i] = temp;
                a++;
            }
        }
        br.close();

        Arrays.sort(ans);
        for (int j = n-a; j < n; j++) {
            if (hmap.get(ans[j]) != m) {
                ans[j] = "";
            }
        }
        Arrays.sort(ans);
        for (int k = 0; k < n; k++) {
            if (!(ans[k].equals(""))) System.out.println(ans[k]);
        }
    }
} public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String temp = br.readLine();
        int n = Integer.parseInt(temp);
        String[] ans = new String[n];
        int a = 0;
        int m = 1;
        HashMap<String, Integer> hmap = new HashMap<>();
        hmap.put("", 0);
        for (int i = 0; i < n; i++) {
            temp = br.readLine();

            if (hmap.containsKey(temp)) {
                hmap.replace(temp, hmap.get(temp)+1);
                m = Math.max(m, hmap.get(temp));
                ans[i] = "";
            }
            else {
                hmap.put(temp, 1);
                ans[i] = temp;
                a++;
            }
        }
        br.close();

        Arrays.sort(ans);
        for (int j = n-a; j < n; j++) {
            if (hmap.get(ans[j]) != m) {
                ans[j] = "";
            }
        }
        Arrays.sort(ans);
        for (int k = 0; k < n; k++) {
            if (!(ans[k].equals(""))) System.out.println(ans[k]);
        }
    }
} Main
import java.io.*;
import java.util.*;

/**
 * Created by Ayushi on 16 Feb 2020.
 * Problem:
 * Round:
 */

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String temp = br.readLine();
        int n = Integer.parseInt(temp);
        String[] ans = new String[n];
        int a = 0;
        int m = 1;
        HashMap<String, Integer> hmap = new HashMap<>();
        hmap.put("", 0);
        for (int i = 0; i < n; i++) {
            temp = br.readLine();

            if (hmap.containsKey(temp)) {
                hmap.replace(temp, hmap.get(temp)+1);
                m = Math.max(m, hmap.get(temp));
                ans[i] = "";
            }
            else {
                hmap.put(temp, 1);
                ans[i] = temp;
                a++;
            }
        }
        br.close();

        Arrays.sort(ans);
        for (int j = n-a; j < n; j++) {
            if (hmap.get(ans[j]) != m) {
                ans[j] = "";
            }
        }
        Arrays.sort(ans);
        for (int k = 0; k < n; k++) {
            if (!(ans[k].equals(""))) System.out.println(ans[k]);
        }
    }
}
