import java.io.*;
import java.util.*;
public class Main {
	static PrintWriter out = new PrintWriter(System.out); 

	public static void main(String[] args)throws Exception {
		try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in))){
			
			int n = Integer.parseInt(br.readLine());
			
			Map<String,Integer> map = new HashMap<>();
			int max = 0,tmp = 0;
			for(int i = 0; i < n; i++) {
				String s =  br.readLine(); 
				
				if(map.containsKey(s)) {
					tmp = map.get(s)+1;
					map.put(s,tmp);
					max = Math.max(tmp, max);
				}else {
					map.put(s,1);
					max = Math.max(max, 1);
				}

				
			}
			
			List<String> list = new ArrayList<>();
			for(String key: map.keySet()) {
				if(map.get(key)==max) {
					list.add(key);
				}
			}
			
			Collections.sort(list);
			
			for(String a: list) {
				out.println(a);
			}
			out.flush();
			
		}		
		
		
	}

} import java.io.*; io.* java import java.util.*; util.* java public class Main {
	static PrintWriter out = new PrintWriter(System.out); 

	public static void main(String[] args)throws Exception {
		try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in))){
			
			int n = Integer.parseInt(br.readLine());
			
			Map<String,Integer> map = new HashMap<>();
			int max = 0,tmp = 0;
			for(int i = 0; i < n; i++) {
				String s =  br.readLine(); 
				
				if(map.containsKey(s)) {
					tmp = map.get(s)+1;
					map.put(s,tmp);
					max = Math.max(tmp, max);
				}else {
					map.put(s,1);
					max = Math.max(max, 1);
				}

				
			}
			
			List<String> list = new ArrayList<>();
			for(String key: map.keySet()) {
				if(map.get(key)==max) {
					list.add(key);
				}
			}
			
			Collections.sort(list);
			
			for(String a: list) {
				out.println(a);
			}
			out.flush();
			
		}		
		
		
	}

} Main static PrintWriter out = new PrintWriter(System.out); out new PrintWriter(System.out) public static void main(String[] args)throws Exception {
		try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in))){
			
			int n = Integer.parseInt(br.readLine());
			
			Map<String,Integer> map = new HashMap<>();
			int max = 0,tmp = 0;
			for(int i = 0; i < n; i++) {
				String s =  br.readLine(); 
				
				if(map.containsKey(s)) {
					tmp = map.get(s)+1;
					map.put(s,tmp);
					max = Math.max(tmp, max);
				}else {
					map.put(s,1);
					max = Math.max(max, 1);
				}

				
			}
			
			List<String> list = new ArrayList<>();
			for(String key: map.keySet()) {
				if(map.get(key)==max) {
					list.add(key);
				}
			}
			
			Collections.sort(list);
			
			for(String a: list) {
				out.println(a);
			}
			out.flush();
			
		}		
		
		
	} main {
		try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in))){
			
			int n = Integer.parseInt(br.readLine());
			
			Map<String,Integer> map = new HashMap<>();
			int max = 0,tmp = 0;
			for(int i = 0; i < n; i++) {
				String s =  br.readLine(); 
				
				if(map.containsKey(s)) {
					tmp = map.get(s)+1;
					map.put(s,tmp);
					max = Math.max(tmp, max);
				}else {
					map.put(s,1);
					max = Math.max(max, 1);
				}

				
			}
			
			List<String> list = new ArrayList<>();
			for(String key: map.keySet()) {
				if(map.get(key)==max) {
					list.add(key);
				}
			}
			
			Collections.sort(list);
			
			for(String a: list) {
				out.println(a);
			}
			out.flush();
			
		}		
		
		
	} try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in))){
			
			int n = Integer.parseInt(br.readLine());
			
			Map<String,Integer> map = new HashMap<>();
			int max = 0,tmp = 0;
			for(int i = 0; i < n; i++) {
				String s =  br.readLine(); 
				
				if(map.containsKey(s)) {
					tmp = map.get(s)+1;
					map.put(s,tmp);
					max = Math.max(tmp, max);
				}else {
					map.put(s,1);
					max = Math.max(max, 1);
				}

				
			}
			
			List<String> list = new ArrayList<>();
			for(String key: map.keySet()) {
				if(map.get(key)==max) {
					list.add(key);
				}
			}
			
			Collections.sort(list);
			
			for(String a: list) {
				out.println(a);
			}
			out.flush();
			
		} {
			
			int n = Integer.parseInt(br.readLine());
			
			Map<String,Integer> map = new HashMap<>();
			int max = 0,tmp = 0;
			for(int i = 0; i < n; i++) {
				String s =  br.readLine(); 
				
				if(map.containsKey(s)) {
					tmp = map.get(s)+1;
					map.put(s,tmp);
					max = Math.max(tmp, max);
				}else {
					map.put(s,1);
					max = Math.max(max, 1);
				}

				
			}
			
			List<String> list = new ArrayList<>();
			for(String key: map.keySet()) {
				if(map.get(key)==max) {
					list.add(key);
				}
			}
			
			Collections.sort(list);
			
			for(String a: list) {
				out.println(a);
			}
			out.flush();
			
		} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)) BufferedReader br = new BufferedReader(new InputStreamReader(System.in)) new BufferedReader(new InputStreamReader(System.in)) int n = Integer.parseInt(br.readLine()); n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br Map<String,Integer> map = new HashMap<>(); map new HashMap<>() int max = 0 max 0 tmp = 0; tmp 0 for(int i = 0; i < n; i++) {
				String s =  br.readLine(); 
				
				if(map.containsKey(s)) {
					tmp = map.get(s)+1;
					map.put(s,tmp);
					max = Math.max(tmp, max);
				}else {
					map.put(s,1);
					max = Math.max(max, 1);
				}

				
			} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
				String s =  br.readLine(); 
				
				if(map.containsKey(s)) {
					tmp = map.get(s)+1;
					map.put(s,tmp);
					max = Math.max(tmp, max);
				}else {
					map.put(s,1);
					max = Math.max(max, 1);
				}

				
			} {
				String s =  br.readLine(); 
				
				if(map.containsKey(s)) {
					tmp = map.get(s)+1;
					map.put(s,tmp);
					max = Math.max(tmp, max);
				}else {
					map.put(s,1);
					max = Math.max(max, 1);
				}

				
			} String s =  br.readLine(); s br.readLine() br.readLine br if(map.containsKey(s)) {
					tmp = map.get(s)+1;
					map.put(s,tmp);
					max = Math.max(tmp, max);
				}else {
					map.put(s,1);
					max = Math.max(max, 1);
				} map.containsKey(s) map.containsKey map s {
					tmp = map.get(s)+1;
					map.put(s,tmp);
					max = Math.max(tmp, max);
				} tmp = map.get(s)+1 tmp map.get(s)+1 map.get(s) map.get map s 1 map.put(s,tmp) map.put map s tmp max = Math.max(tmp, max) max Math.max(tmp, max) Math.max Math tmp max {
					map.put(s,1);
					max = Math.max(max, 1);
				} map.put(s,1) map.put map s 1 max = Math.max(max, 1) max Math.max(max, 1) Math.max Math max 1 List<String> list = new ArrayList<>(); list new ArrayList<>() for(String key: map.keySet()) {
				if(map.get(key)==max) {
					list.add(key);
				}
			} String key map.keySet() map.keySet map {
				if(map.get(key)==max) {
					list.add(key);
				}
			} {
				if(map.get(key)==max) {
					list.add(key);
				}
			} if(map.get(key)==max) {
					list.add(key);
				} map.get(key)==max map.get(key) map.get map key max {
					list.add(key);
				} list.add(key) list.add list key Collections.sort(list) Collections.sort Collections list for(String a: list) {
				out.println(a);
			} String a list {
				out.println(a);
			} {
				out.println(a);
			} out.println(a) out.println out a out.flush() out.flush out String[] args args public class Main {
	static PrintWriter out = new PrintWriter(System.out); 

	public static void main(String[] args)throws Exception {
		try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in))){
			
			int n = Integer.parseInt(br.readLine());
			
			Map<String,Integer> map = new HashMap<>();
			int max = 0,tmp = 0;
			for(int i = 0; i < n; i++) {
				String s =  br.readLine(); 
				
				if(map.containsKey(s)) {
					tmp = map.get(s)+1;
					map.put(s,tmp);
					max = Math.max(tmp, max);
				}else {
					map.put(s,1);
					max = Math.max(max, 1);
				}

				
			}
			
			List<String> list = new ArrayList<>();
			for(String key: map.keySet()) {
				if(map.get(key)==max) {
					list.add(key);
				}
			}
			
			Collections.sort(list);
			
			for(String a: list) {
				out.println(a);
			}
			out.flush();
			
		}		
		
		
	}

} public class Main {
	static PrintWriter out = new PrintWriter(System.out); 

	public static void main(String[] args)throws Exception {
		try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in))){
			
			int n = Integer.parseInt(br.readLine());
			
			Map<String,Integer> map = new HashMap<>();
			int max = 0,tmp = 0;
			for(int i = 0; i < n; i++) {
				String s =  br.readLine(); 
				
				if(map.containsKey(s)) {
					tmp = map.get(s)+1;
					map.put(s,tmp);
					max = Math.max(tmp, max);
				}else {
					map.put(s,1);
					max = Math.max(max, 1);
				}

				
			}
			
			List<String> list = new ArrayList<>();
			for(String key: map.keySet()) {
				if(map.get(key)==max) {
					list.add(key);
				}
			}
			
			Collections.sort(list);
			
			for(String a: list) {
				out.println(a);
			}
			out.flush();
			
		}		
		
		
	}

} Main
import java.io.*;
import java.util.*;
public class Main {
	static PrintWriter out = new PrintWriter(System.out); 

	public static void main(String[] args)throws Exception {
		try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in))){
			
			int n = Integer.parseInt(br.readLine());
			
			Map<String,Integer> map = new HashMap<>();
			int max = 0,tmp = 0;
			for(int i = 0; i < n; i++) {
				String s =  br.readLine(); 
				
				if(map.containsKey(s)) {
					tmp = map.get(s)+1;
					map.put(s,tmp);
					max = Math.max(tmp, max);
				}else {
					map.put(s,1);
					max = Math.max(max, 1);
				}

				
			}
			
			List<String> list = new ArrayList<>();
			for(String key: map.keySet()) {
				if(map.get(key)==max) {
					list.add(key);
				}
			}
			
			Collections.sort(list);
			
			for(String a: list) {
				out.println(a);
			}
			out.flush();
			
		}		
		
		
	}

}
