

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

public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();

		HashMap<String, Integer> vote = new HashMap<>();
		String temp;
		for (int i = 0; i < N; i++) {
			temp = scan.next();

			if (vote.containsKey(temp)) {
				vote.put(temp, vote.get(temp) + 1);
			} else {
				vote.put(temp, 1);
			}
		}

		int max = Collections.max(vote.values());

		ArrayList<String> anser = new ArrayList<String>();
		for (Map.Entry<String, Integer> map : vote.entrySet()) {
			if (map.getValue() == max) {
				anser.add(map.getKey());
			}
		}

		Collections.sort(anser);

		for (String s : anser) {
			System.out.println(s);
		}

	}

} import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections java.util import java.util.HashMap; HashMap java.util import java.util.Map; Map java.util import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();

		HashMap<String, Integer> vote = new HashMap<>();
		String temp;
		for (int i = 0; i < N; i++) {
			temp = scan.next();

			if (vote.containsKey(temp)) {
				vote.put(temp, vote.get(temp) + 1);
			} else {
				vote.put(temp, 1);
			}
		}

		int max = Collections.max(vote.values());

		ArrayList<String> anser = new ArrayList<String>();
		for (Map.Entry<String, Integer> map : vote.entrySet()) {
			if (map.getValue() == max) {
				anser.add(map.getKey());
			}
		}

		Collections.sort(anser);

		for (String s : anser) {
			System.out.println(s);
		}

	}

} Main public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();

		HashMap<String, Integer> vote = new HashMap<>();
		String temp;
		for (int i = 0; i < N; i++) {
			temp = scan.next();

			if (vote.containsKey(temp)) {
				vote.put(temp, vote.get(temp) + 1);
			} else {
				vote.put(temp, 1);
			}
		}

		int max = Collections.max(vote.values());

		ArrayList<String> anser = new ArrayList<String>();
		for (Map.Entry<String, Integer> map : vote.entrySet()) {
			if (map.getValue() == max) {
				anser.add(map.getKey());
			}
		}

		Collections.sort(anser);

		for (String s : anser) {
			System.out.println(s);
		}

	} main {

		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();

		HashMap<String, Integer> vote = new HashMap<>();
		String temp;
		for (int i = 0; i < N; i++) {
			temp = scan.next();

			if (vote.containsKey(temp)) {
				vote.put(temp, vote.get(temp) + 1);
			} else {
				vote.put(temp, 1);
			}
		}

		int max = Collections.max(vote.values());

		ArrayList<String> anser = new ArrayList<String>();
		for (Map.Entry<String, Integer> map : vote.entrySet()) {
			if (map.getValue() == max) {
				anser.add(map.getKey());
			}
		}

		Collections.sort(anser);

		for (String s : anser) {
			System.out.println(s);
		}

	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int N = scan.nextInt(); N scan.nextInt() scan.nextInt scan HashMap<String, Integer> vote = new HashMap<>(); vote new HashMap<>() String temp; temp for (int i = 0; i < N; i++) {
			temp = scan.next();

			if (vote.containsKey(temp)) {
				vote.put(temp, vote.get(temp) + 1);
			} else {
				vote.put(temp, 1);
			}
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			temp = scan.next();

			if (vote.containsKey(temp)) {
				vote.put(temp, vote.get(temp) + 1);
			} else {
				vote.put(temp, 1);
			}
		} {
			temp = scan.next();

			if (vote.containsKey(temp)) {
				vote.put(temp, vote.get(temp) + 1);
			} else {
				vote.put(temp, 1);
			}
		} temp = scan.next() temp scan.next() scan.next scan if (vote.containsKey(temp)) {
				vote.put(temp, vote.get(temp) + 1);
			} else {
				vote.put(temp, 1);
			} vote.containsKey(temp) vote.containsKey vote temp {
				vote.put(temp, vote.get(temp) + 1);
			} vote.put(temp, vote.get(temp) + 1) vote.put vote temp vote.get(temp) + 1 vote.get(temp) vote.get vote temp 1 {
				vote.put(temp, 1);
			} vote.put(temp, 1) vote.put vote temp 1 int max = Collections.max(vote.values()); max Collections.max(vote.values()) Collections.max Collections vote.values() vote.values vote ArrayList<String> anser = new ArrayList<String>(); anser new ArrayList<String>() for (Map.Entry<String, Integer> map : vote.entrySet()) {
			if (map.getValue() == max) {
				anser.add(map.getKey());
			}
		} Map.Entry<String, Integer> map vote.entrySet() vote.entrySet vote {
			if (map.getValue() == max) {
				anser.add(map.getKey());
			}
		} {
			if (map.getValue() == max) {
				anser.add(map.getKey());
			}
		} if (map.getValue() == max) {
				anser.add(map.getKey());
			} map.getValue() == max map.getValue() map.getValue map max {
				anser.add(map.getKey());
			} anser.add(map.getKey()) anser.add anser map.getKey() map.getKey map Collections.sort(anser) Collections.sort Collections anser for (String s : anser) {
			System.out.println(s);
		} String s anser {
			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 {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();

		HashMap<String, Integer> vote = new HashMap<>();
		String temp;
		for (int i = 0; i < N; i++) {
			temp = scan.next();

			if (vote.containsKey(temp)) {
				vote.put(temp, vote.get(temp) + 1);
			} else {
				vote.put(temp, 1);
			}
		}

		int max = Collections.max(vote.values());

		ArrayList<String> anser = new ArrayList<String>();
		for (Map.Entry<String, Integer> map : vote.entrySet()) {
			if (map.getValue() == max) {
				anser.add(map.getKey());
			}
		}

		Collections.sort(anser);

		for (String s : anser) {
			System.out.println(s);
		}

	}

} public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();

		HashMap<String, Integer> vote = new HashMap<>();
		String temp;
		for (int i = 0; i < N; i++) {
			temp = scan.next();

			if (vote.containsKey(temp)) {
				vote.put(temp, vote.get(temp) + 1);
			} else {
				vote.put(temp, 1);
			}
		}

		int max = Collections.max(vote.values());

		ArrayList<String> anser = new ArrayList<String>();
		for (Map.Entry<String, Integer> map : vote.entrySet()) {
			if (map.getValue() == max) {
				anser.add(map.getKey());
			}
		}

		Collections.sort(anser);

		for (String s : anser) {
			System.out.println(s);
		}

	}

} Main


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

public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();

		HashMap<String, Integer> vote = new HashMap<>();
		String temp;
		for (int i = 0; i < N; i++) {
			temp = scan.next();

			if (vote.containsKey(temp)) {
				vote.put(temp, vote.get(temp) + 1);
			} else {
				vote.put(temp, 1);
			}
		}

		int max = Collections.max(vote.values());

		ArrayList<String> anser = new ArrayList<String>();
		for (Map.Entry<String, Integer> map : vote.entrySet()) {
			if (map.getValue() == max) {
				anser.add(map.getKey());
			}
		}

		Collections.sort(anser);

		for (String s : anser) {
			System.out.println(s);
		}

	}

}
