import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
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();
		Map<String, Integer> map = new HashMap<String,Integer>();
		for(int i = 0; i < n; i++) {
			String s = scan.next();
			if(map.get(s) == null) {
				map.put(s, 1);
			} else {
				int num = map.get(s);
				map.put(s, num + 1);
			}
		}
		int max= 0;
		List<String> list = new ArrayList<String>();
		for(Map.Entry<String, Integer> entry : map.entrySet()) {
			if(max < entry.getValue()) {
				max = entry.getValue();
				list.clear();
				list.add(entry.getKey());
			} else if(max == entry.getValue()){
				list.add(entry.getKey());
			}
		}
		Collections.sort(list);
		
		for(int i = 0; i < list.size(); i++) {
			System.out.println(list.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.List; List 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();
		Map<String, Integer> map = new HashMap<String,Integer>();
		for(int i = 0; i < n; i++) {
			String s = scan.next();
			if(map.get(s) == null) {
				map.put(s, 1);
			} else {
				int num = map.get(s);
				map.put(s, num + 1);
			}
		}
		int max= 0;
		List<String> list = new ArrayList<String>();
		for(Map.Entry<String, Integer> entry : map.entrySet()) {
			if(max < entry.getValue()) {
				max = entry.getValue();
				list.clear();
				list.add(entry.getKey());
			} else if(max == entry.getValue()){
				list.add(entry.getKey());
			}
		}
		Collections.sort(list);
		
		for(int i = 0; i < list.size(); i++) {
			System.out.println(list.get(i));
		}
	}
} Main public static void main (String args[]) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		Map<String, Integer> map = new HashMap<String,Integer>();
		for(int i = 0; i < n; i++) {
			String s = scan.next();
			if(map.get(s) == null) {
				map.put(s, 1);
			} else {
				int num = map.get(s);
				map.put(s, num + 1);
			}
		}
		int max= 0;
		List<String> list = new ArrayList<String>();
		for(Map.Entry<String, Integer> entry : map.entrySet()) {
			if(max < entry.getValue()) {
				max = entry.getValue();
				list.clear();
				list.add(entry.getKey());
			} else if(max == entry.getValue()){
				list.add(entry.getKey());
			}
		}
		Collections.sort(list);
		
		for(int i = 0; i < list.size(); i++) {
			System.out.println(list.get(i));
		}
	} main {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		Map<String, Integer> map = new HashMap<String,Integer>();
		for(int i = 0; i < n; i++) {
			String s = scan.next();
			if(map.get(s) == null) {
				map.put(s, 1);
			} else {
				int num = map.get(s);
				map.put(s, num + 1);
			}
		}
		int max= 0;
		List<String> list = new ArrayList<String>();
		for(Map.Entry<String, Integer> entry : map.entrySet()) {
			if(max < entry.getValue()) {
				max = entry.getValue();
				list.clear();
				list.add(entry.getKey());
			} else if(max == entry.getValue()){
				list.add(entry.getKey());
			}
		}
		Collections.sort(list);
		
		for(int i = 0; i < list.size(); i++) {
			System.out.println(list.get(i));
		}
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan Map<String, Integer> map = new HashMap<String,Integer>(); map new HashMap<String,Integer>() for(int i = 0; i < n; i++) {
			String s = scan.next();
			if(map.get(s) == null) {
				map.put(s, 1);
			} else {
				int num = map.get(s);
				map.put(s, num + 1);
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			String s = scan.next();
			if(map.get(s) == null) {
				map.put(s, 1);
			} else {
				int num = map.get(s);
				map.put(s, num + 1);
			}
		} {
			String s = scan.next();
			if(map.get(s) == null) {
				map.put(s, 1);
			} else {
				int num = map.get(s);
				map.put(s, num + 1);
			}
		} String s = scan.next(); s scan.next() scan.next scan if(map.get(s) == null) {
				map.put(s, 1);
			} else {
				int num = map.get(s);
				map.put(s, num + 1);
			} map.get(s) == null map.get(s) map.get map s null {
				map.put(s, 1);
			} map.put(s, 1) map.put map s 1 {
				int num = map.get(s);
				map.put(s, num + 1);
			} int num = map.get(s); num map.get(s) map.get map s map.put(s, num + 1) map.put map s num + 1 num 1 int max= 0; max 0 List<String> list = new ArrayList<String>(); list new ArrayList<String>() for(Map.Entry<String, Integer> entry : map.entrySet()) {
			if(max < entry.getValue()) {
				max = entry.getValue();
				list.clear();
				list.add(entry.getKey());
			} else if(max == entry.getValue()){
				list.add(entry.getKey());
			}
		} Map.Entry<String, Integer> entry map.entrySet() map.entrySet map {
			if(max < entry.getValue()) {
				max = entry.getValue();
				list.clear();
				list.add(entry.getKey());
			} else if(max == entry.getValue()){
				list.add(entry.getKey());
			}
		} {
			if(max < entry.getValue()) {
				max = entry.getValue();
				list.clear();
				list.add(entry.getKey());
			} else if(max == entry.getValue()){
				list.add(entry.getKey());
			}
		} if(max < entry.getValue()) {
				max = entry.getValue();
				list.clear();
				list.add(entry.getKey());
			} else if(max == entry.getValue()){
				list.add(entry.getKey());
			} max < entry.getValue() max entry.getValue() entry.getValue entry {
				max = entry.getValue();
				list.clear();
				list.add(entry.getKey());
			} max = entry.getValue() max entry.getValue() entry.getValue entry list.clear() list.clear list list.add(entry.getKey()) list.add list entry.getKey() entry.getKey entry if(max == entry.getValue()){
				list.add(entry.getKey());
			} max == entry.getValue() max entry.getValue() entry.getValue entry {
				list.add(entry.getKey());
			} list.add(entry.getKey()) list.add list entry.getKey() entry.getKey entry Collections.sort(list) Collections.sort Collections list for(int i = 0; i < list.size(); i++) {
			System.out.println(list.get(i));
		} int i = 0; int i = 0; i 0 i < list.size() i list.size() list.size list i++ i++ i {
			System.out.println(list.get(i));
		} {
			System.out.println(list.get(i));
		} System.out.println(list.get(i)) System.out.println System.out System System.out list.get(i) list.get list i String args[] args public class Main {
	public static void main (String args[]) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		Map<String, Integer> map = new HashMap<String,Integer>();
		for(int i = 0; i < n; i++) {
			String s = scan.next();
			if(map.get(s) == null) {
				map.put(s, 1);
			} else {
				int num = map.get(s);
				map.put(s, num + 1);
			}
		}
		int max= 0;
		List<String> list = new ArrayList<String>();
		for(Map.Entry<String, Integer> entry : map.entrySet()) {
			if(max < entry.getValue()) {
				max = entry.getValue();
				list.clear();
				list.add(entry.getKey());
			} else if(max == entry.getValue()){
				list.add(entry.getKey());
			}
		}
		Collections.sort(list);
		
		for(int i = 0; i < list.size(); i++) {
			System.out.println(list.get(i));
		}
	}
} public class Main {
	public static void main (String args[]) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		Map<String, Integer> map = new HashMap<String,Integer>();
		for(int i = 0; i < n; i++) {
			String s = scan.next();
			if(map.get(s) == null) {
				map.put(s, 1);
			} else {
				int num = map.get(s);
				map.put(s, num + 1);
			}
		}
		int max= 0;
		List<String> list = new ArrayList<String>();
		for(Map.Entry<String, Integer> entry : map.entrySet()) {
			if(max < entry.getValue()) {
				max = entry.getValue();
				list.clear();
				list.add(entry.getKey());
			} else if(max == entry.getValue()){
				list.add(entry.getKey());
			}
		}
		Collections.sort(list);
		
		for(int i = 0; i < list.size(); i++) {
			System.out.println(list.get(i));
		}
	}
} Main
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
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();
		Map<String, Integer> map = new HashMap<String,Integer>();
		for(int i = 0; i < n; i++) {
			String s = scan.next();
			if(map.get(s) == null) {
				map.put(s, 1);
			} else {
				int num = map.get(s);
				map.put(s, num + 1);
			}
		}
		int max= 0;
		List<String> list = new ArrayList<String>();
		for(Map.Entry<String, Integer> entry : map.entrySet()) {
			if(max < entry.getValue()) {
				max = entry.getValue();
				list.clear();
				list.add(entry.getKey());
			} else if(max == entry.getValue()){
				list.add(entry.getKey());
			}
		}
		Collections.sort(list);
		
		for(int i = 0; i < list.size(); i++) {
			System.out.println(list.get(i));
		}
	}
}