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

public class Main {

	public static void main(String[] args) {
		HashMap<String, Integer> s = new HashMap<>();
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int max = 0;
		String in ;
		for(int i=0;i<n;i++) {
			in = sc.next();
			if(s.containsKey(in)) {
				s.put(in, s.get(in)+1);
			}else {
				s.put(in, 1);
			}
			max = Math.max(max, s.get(in));
		}

		ArrayList<String> out = new ArrayList<>();
		for( String key : s.keySet()) {
			if(s.get(key) == max) {
				out.add(key);
			}
		}
		Collections.sort(out);
		for(int i=0;i<out.size();i++) {
			System.out.println(out.get(i));
		}
	}
} import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections java.util import java.util.HashMap; HashMap java.util import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		HashMap<String, Integer> s = new HashMap<>();
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int max = 0;
		String in ;
		for(int i=0;i<n;i++) {
			in = sc.next();
			if(s.containsKey(in)) {
				s.put(in, s.get(in)+1);
			}else {
				s.put(in, 1);
			}
			max = Math.max(max, s.get(in));
		}

		ArrayList<String> out = new ArrayList<>();
		for( String key : s.keySet()) {
			if(s.get(key) == max) {
				out.add(key);
			}
		}
		Collections.sort(out);
		for(int i=0;i<out.size();i++) {
			System.out.println(out.get(i));
		}
	}
} Main public static void main(String[] args) {
		HashMap<String, Integer> s = new HashMap<>();
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int max = 0;
		String in ;
		for(int i=0;i<n;i++) {
			in = sc.next();
			if(s.containsKey(in)) {
				s.put(in, s.get(in)+1);
			}else {
				s.put(in, 1);
			}
			max = Math.max(max, s.get(in));
		}

		ArrayList<String> out = new ArrayList<>();
		for( String key : s.keySet()) {
			if(s.get(key) == max) {
				out.add(key);
			}
		}
		Collections.sort(out);
		for(int i=0;i<out.size();i++) {
			System.out.println(out.get(i));
		}
	} main {
		HashMap<String, Integer> s = new HashMap<>();
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int max = 0;
		String in ;
		for(int i=0;i<n;i++) {
			in = sc.next();
			if(s.containsKey(in)) {
				s.put(in, s.get(in)+1);
			}else {
				s.put(in, 1);
			}
			max = Math.max(max, s.get(in));
		}

		ArrayList<String> out = new ArrayList<>();
		for( String key : s.keySet()) {
			if(s.get(key) == max) {
				out.add(key);
			}
		}
		Collections.sort(out);
		for(int i=0;i<out.size();i++) {
			System.out.println(out.get(i));
		}
	} HashMap<String, Integer> s = new HashMap<>(); s new HashMap<>() Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int max = 0; max 0 String in ; in for(int i=0;i<n;i++) {
			in = sc.next();
			if(s.containsKey(in)) {
				s.put(in, s.get(in)+1);
			}else {
				s.put(in, 1);
			}
			max = Math.max(max, s.get(in));
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			in = sc.next();
			if(s.containsKey(in)) {
				s.put(in, s.get(in)+1);
			}else {
				s.put(in, 1);
			}
			max = Math.max(max, s.get(in));
		} {
			in = sc.next();
			if(s.containsKey(in)) {
				s.put(in, s.get(in)+1);
			}else {
				s.put(in, 1);
			}
			max = Math.max(max, s.get(in));
		} in = sc.next() in sc.next() sc.next sc if(s.containsKey(in)) {
				s.put(in, s.get(in)+1);
			}else {
				s.put(in, 1);
			} s.containsKey(in) s.containsKey s in {
				s.put(in, s.get(in)+1);
			} s.put(in, s.get(in)+1) s.put s in s.get(in)+1 s.get(in) s.get s in 1 {
				s.put(in, 1);
			} s.put(in, 1) s.put s in 1 max = Math.max(max, s.get(in)) max Math.max(max, s.get(in)) Math.max Math max s.get(in) s.get s in ArrayList<String> out = new ArrayList<>(); out new ArrayList<>() for( String key : s.keySet()) {
			if(s.get(key) == max) {
				out.add(key);
			}
		} String key s.keySet() s.keySet s {
			if(s.get(key) == max) {
				out.add(key);
			}
		} {
			if(s.get(key) == max) {
				out.add(key);
			}
		} if(s.get(key) == max) {
				out.add(key);
			} s.get(key) == max s.get(key) s.get s key max {
				out.add(key);
			} out.add(key) out.add out key Collections.sort(out) Collections.sort Collections out for(int i=0;i<out.size();i++) {
			System.out.println(out.get(i));
		} int i=0; int i=0; i 0 i<out.size() i out.size() out.size out i++ i++ i {
			System.out.println(out.get(i));
		} {
			System.out.println(out.get(i));
		} System.out.println(out.get(i)) System.out.println System.out System System.out out.get(i) out.get out i String[] args args public class Main {

	public static void main(String[] args) {
		HashMap<String, Integer> s = new HashMap<>();
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int max = 0;
		String in ;
		for(int i=0;i<n;i++) {
			in = sc.next();
			if(s.containsKey(in)) {
				s.put(in, s.get(in)+1);
			}else {
				s.put(in, 1);
			}
			max = Math.max(max, s.get(in));
		}

		ArrayList<String> out = new ArrayList<>();
		for( String key : s.keySet()) {
			if(s.get(key) == max) {
				out.add(key);
			}
		}
		Collections.sort(out);
		for(int i=0;i<out.size();i++) {
			System.out.println(out.get(i));
		}
	}
} public class Main {

	public static void main(String[] args) {
		HashMap<String, Integer> s = new HashMap<>();
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int max = 0;
		String in ;
		for(int i=0;i<n;i++) {
			in = sc.next();
			if(s.containsKey(in)) {
				s.put(in, s.get(in)+1);
			}else {
				s.put(in, 1);
			}
			max = Math.max(max, s.get(in));
		}

		ArrayList<String> out = new ArrayList<>();
		for( String key : s.keySet()) {
			if(s.get(key) == max) {
				out.add(key);
			}
		}
		Collections.sort(out);
		for(int i=0;i<out.size();i++) {
			System.out.println(out.get(i));
		}
	}
} Main
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		HashMap<String, Integer> s = new HashMap<>();
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int max = 0;
		String in ;
		for(int i=0;i<n;i++) {
			in = sc.next();
			if(s.containsKey(in)) {
				s.put(in, s.get(in)+1);
			}else {
				s.put(in, 1);
			}
			max = Math.max(max, s.get(in));
		}

		ArrayList<String> out = new ArrayList<>();
		for( String key : s.keySet()) {
			if(s.get(key) == max) {
				out.add(key);
			}
		}
		Collections.sort(out);
		for(int i=0;i<out.size();i++) {
			System.out.println(out.get(i));
		}
	}
}
