import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Scanner;
import java.util.TreeMap;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		Map<String,Integer> s = new LinkedHashMap<String,Integer>();
		for(int i = 0; i < n; i++) {
			String temp = sc.next();
			if(s.containsKey(temp)) {
				int c = s.get(temp)+1;
				s.put(temp, c);
			}
			else {
				s.put(temp, 1);
			}
		}
		Map<String,Integer> ans = new TreeMap<String,Integer>();
		int count = 0;
		for(String key:s.keySet()) {
			if(count < s.get(key)) {
				ans.clear();
				count = s.get(key);
				ans.put(key, count);
			}
			else if(count==s.get(key)) {
				ans.put(key, count);
			}
		}
		for(String key:ans.keySet()) {
			System.out.println(key);
		}
	}
} import java.util.LinkedHashMap; LinkedHashMap java.util import java.util.Map; Map java.util import java.util.Scanner; Scanner java.util import java.util.TreeMap; TreeMap java.util public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		Map<String,Integer> s = new LinkedHashMap<String,Integer>();
		for(int i = 0; i < n; i++) {
			String temp = sc.next();
			if(s.containsKey(temp)) {
				int c = s.get(temp)+1;
				s.put(temp, c);
			}
			else {
				s.put(temp, 1);
			}
		}
		Map<String,Integer> ans = new TreeMap<String,Integer>();
		int count = 0;
		for(String key:s.keySet()) {
			if(count < s.get(key)) {
				ans.clear();
				count = s.get(key);
				ans.put(key, count);
			}
			else if(count==s.get(key)) {
				ans.put(key, count);
			}
		}
		for(String key:ans.keySet()) {
			System.out.println(key);
		}
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		Map<String,Integer> s = new LinkedHashMap<String,Integer>();
		for(int i = 0; i < n; i++) {
			String temp = sc.next();
			if(s.containsKey(temp)) {
				int c = s.get(temp)+1;
				s.put(temp, c);
			}
			else {
				s.put(temp, 1);
			}
		}
		Map<String,Integer> ans = new TreeMap<String,Integer>();
		int count = 0;
		for(String key:s.keySet()) {
			if(count < s.get(key)) {
				ans.clear();
				count = s.get(key);
				ans.put(key, count);
			}
			else if(count==s.get(key)) {
				ans.put(key, count);
			}
		}
		for(String key:ans.keySet()) {
			System.out.println(key);
		}
	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		Map<String,Integer> s = new LinkedHashMap<String,Integer>();
		for(int i = 0; i < n; i++) {
			String temp = sc.next();
			if(s.containsKey(temp)) {
				int c = s.get(temp)+1;
				s.put(temp, c);
			}
			else {
				s.put(temp, 1);
			}
		}
		Map<String,Integer> ans = new TreeMap<String,Integer>();
		int count = 0;
		for(String key:s.keySet()) {
			if(count < s.get(key)) {
				ans.clear();
				count = s.get(key);
				ans.put(key, count);
			}
			else if(count==s.get(key)) {
				ans.put(key, count);
			}
		}
		for(String key:ans.keySet()) {
			System.out.println(key);
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc Map<String,Integer> s = new LinkedHashMap<String,Integer>(); s new LinkedHashMap<String,Integer>() for(int i = 0; i < n; i++) {
			String temp = sc.next();
			if(s.containsKey(temp)) {
				int c = s.get(temp)+1;
				s.put(temp, c);
			}
			else {
				s.put(temp, 1);
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			String temp = sc.next();
			if(s.containsKey(temp)) {
				int c = s.get(temp)+1;
				s.put(temp, c);
			}
			else {
				s.put(temp, 1);
			}
		} {
			String temp = sc.next();
			if(s.containsKey(temp)) {
				int c = s.get(temp)+1;
				s.put(temp, c);
			}
			else {
				s.put(temp, 1);
			}
		} String temp = sc.next(); temp sc.next() sc.next sc if(s.containsKey(temp)) {
				int c = s.get(temp)+1;
				s.put(temp, c);
			}
			else {
				s.put(temp, 1);
			} s.containsKey(temp) s.containsKey s temp {
				int c = s.get(temp)+1;
				s.put(temp, c);
			} int c = s.get(temp)+1; c s.get(temp)+1 s.get(temp) s.get s temp 1 s.put(temp, c) s.put s temp c {
				s.put(temp, 1);
			} s.put(temp, 1) s.put s temp 1 Map<String,Integer> ans = new TreeMap<String,Integer>(); ans new TreeMap<String,Integer>() int count = 0; count 0 for(String key:s.keySet()) {
			if(count < s.get(key)) {
				ans.clear();
				count = s.get(key);
				ans.put(key, count);
			}
			else if(count==s.get(key)) {
				ans.put(key, count);
			}
		} String key s.keySet() s.keySet s {
			if(count < s.get(key)) {
				ans.clear();
				count = s.get(key);
				ans.put(key, count);
			}
			else if(count==s.get(key)) {
				ans.put(key, count);
			}
		} {
			if(count < s.get(key)) {
				ans.clear();
				count = s.get(key);
				ans.put(key, count);
			}
			else if(count==s.get(key)) {
				ans.put(key, count);
			}
		} if(count < s.get(key)) {
				ans.clear();
				count = s.get(key);
				ans.put(key, count);
			}
			else if(count==s.get(key)) {
				ans.put(key, count);
			} count < s.get(key) count s.get(key) s.get s key {
				ans.clear();
				count = s.get(key);
				ans.put(key, count);
			} ans.clear() ans.clear ans count = s.get(key) count s.get(key) s.get s key ans.put(key, count) ans.put ans key count if(count==s.get(key)) {
				ans.put(key, count);
			} count==s.get(key) count s.get(key) s.get s key {
				ans.put(key, count);
			} ans.put(key, count) ans.put ans key count for(String key:ans.keySet()) {
			System.out.println(key);
		} String key ans.keySet() ans.keySet ans {
			System.out.println(key);
		} {
			System.out.println(key);
		} System.out.println(key) System.out.println System.out System System.out key String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		Map<String,Integer> s = new LinkedHashMap<String,Integer>();
		for(int i = 0; i < n; i++) {
			String temp = sc.next();
			if(s.containsKey(temp)) {
				int c = s.get(temp)+1;
				s.put(temp, c);
			}
			else {
				s.put(temp, 1);
			}
		}
		Map<String,Integer> ans = new TreeMap<String,Integer>();
		int count = 0;
		for(String key:s.keySet()) {
			if(count < s.get(key)) {
				ans.clear();
				count = s.get(key);
				ans.put(key, count);
			}
			else if(count==s.get(key)) {
				ans.put(key, count);
			}
		}
		for(String key:ans.keySet()) {
			System.out.println(key);
		}
	}
} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		Map<String,Integer> s = new LinkedHashMap<String,Integer>();
		for(int i = 0; i < n; i++) {
			String temp = sc.next();
			if(s.containsKey(temp)) {
				int c = s.get(temp)+1;
				s.put(temp, c);
			}
			else {
				s.put(temp, 1);
			}
		}
		Map<String,Integer> ans = new TreeMap<String,Integer>();
		int count = 0;
		for(String key:s.keySet()) {
			if(count < s.get(key)) {
				ans.clear();
				count = s.get(key);
				ans.put(key, count);
			}
			else if(count==s.get(key)) {
				ans.put(key, count);
			}
		}
		for(String key:ans.keySet()) {
			System.out.println(key);
		}
	}
} Main
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Scanner;
import java.util.TreeMap;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		Map<String,Integer> s = new LinkedHashMap<String,Integer>();
		for(int i = 0; i < n; i++) {
			String temp = sc.next();
			if(s.containsKey(temp)) {
				int c = s.get(temp)+1;
				s.put(temp, c);
			}
			else {
				s.put(temp, 1);
			}
		}
		Map<String,Integer> ans = new TreeMap<String,Integer>();
		int count = 0;
		for(String key:s.keySet()) {
			if(count < s.get(key)) {
				ans.clear();
				count = s.get(key);
				ans.put(key, count);
			}
			else if(count==s.get(key)) {
				ans.put(key, count);
			}
		}
		for(String key:ans.keySet()) {
			System.out.println(key);
		}
	}
}