
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

public class Main {

	public static void main(String[] args) throws NumberFormatException, IOException {
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		Map m = new HashMap<String,Integer>();
		for(int i = 0 ; i < n ; i++) {
			String s = br.readLine();
			if(m.containsKey(s)) {
				m.put(s,(int) m.get(s)+1);	
			}else {
				m.put(s, 1);
			}
		}
		int max =getMax(m);
		ArrayList<String> keylist = new ArrayList<String>();
		for(Object key : m.keySet()) {
			if(max == (int) m.get(key)) {
				keylist.add((String) key);
			}	
		}
		Collections.sort(keylist);
		for(String str : keylist) {
			System.out.println(str);
		}
		
	}
 	public static int getMax(Map<String ,Integer> m ) {
		int res = 0;
		for(Object key : m.keySet()) {
			res = Math.max(res, m.get(key));
		}
		return res;
	}

} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io 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 public class Main {

	public static void main(String[] args) throws NumberFormatException, IOException {
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		Map m = new HashMap<String,Integer>();
		for(int i = 0 ; i < n ; i++) {
			String s = br.readLine();
			if(m.containsKey(s)) {
				m.put(s,(int) m.get(s)+1);	
			}else {
				m.put(s, 1);
			}
		}
		int max =getMax(m);
		ArrayList<String> keylist = new ArrayList<String>();
		for(Object key : m.keySet()) {
			if(max == (int) m.get(key)) {
				keylist.add((String) key);
			}	
		}
		Collections.sort(keylist);
		for(String str : keylist) {
			System.out.println(str);
		}
		
	}
 	public static int getMax(Map<String ,Integer> m ) {
		int res = 0;
		for(Object key : m.keySet()) {
			res = Math.max(res, m.get(key));
		}
		return res;
	}

} Main public static void main(String[] args) throws NumberFormatException, IOException {
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		Map m = new HashMap<String,Integer>();
		for(int i = 0 ; i < n ; i++) {
			String s = br.readLine();
			if(m.containsKey(s)) {
				m.put(s,(int) m.get(s)+1);	
			}else {
				m.put(s, 1);
			}
		}
		int max =getMax(m);
		ArrayList<String> keylist = new ArrayList<String>();
		for(Object key : m.keySet()) {
			if(max == (int) m.get(key)) {
				keylist.add((String) key);
			}	
		}
		Collections.sort(keylist);
		for(String str : keylist) {
			System.out.println(str);
		}
		
	} main {
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		Map m = new HashMap<String,Integer>();
		for(int i = 0 ; i < n ; i++) {
			String s = br.readLine();
			if(m.containsKey(s)) {
				m.put(s,(int) m.get(s)+1);	
			}else {
				m.put(s, 1);
			}
		}
		int max =getMax(m);
		ArrayList<String> keylist = new ArrayList<String>();
		for(Object key : m.keySet()) {
			if(max == (int) m.get(key)) {
				keylist.add((String) key);
			}	
		}
		Collections.sort(keylist);
		for(String str : keylist) {
			System.out.println(str);
		}
		
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br 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 m = new HashMap<String,Integer>(); m new HashMap<String,Integer>() for(int i = 0 ; i < n ; i++) {
			String s = br.readLine();
			if(m.containsKey(s)) {
				m.put(s,(int) m.get(s)+1);	
			}else {
				m.put(s, 1);
			}
		} int i = 0 ; int i = 0 ; i 0 i < n i n i++ i++ i {
			String s = br.readLine();
			if(m.containsKey(s)) {
				m.put(s,(int) m.get(s)+1);	
			}else {
				m.put(s, 1);
			}
		} {
			String s = br.readLine();
			if(m.containsKey(s)) {
				m.put(s,(int) m.get(s)+1);	
			}else {
				m.put(s, 1);
			}
		} String s = br.readLine(); s br.readLine() br.readLine br if(m.containsKey(s)) {
				m.put(s,(int) m.get(s)+1);	
			}else {
				m.put(s, 1);
			} m.containsKey(s) m.containsKey m s {
				m.put(s,(int) m.get(s)+1);	
			} m.put(s,(int) m.get(s)+1) m.put m s (int) m.get(s)+1 (int) m.get(s) m.get m s 1 {
				m.put(s, 1);
			} m.put(s, 1) m.put m s 1 int max =getMax(m); max getMax(m) getMax m ArrayList<String> keylist = new ArrayList<String>(); keylist new ArrayList<String>() for(Object key : m.keySet()) {
			if(max == (int) m.get(key)) {
				keylist.add((String) key);
			}	
		} Object key m.keySet() m.keySet m {
			if(max == (int) m.get(key)) {
				keylist.add((String) key);
			}	
		} {
			if(max == (int) m.get(key)) {
				keylist.add((String) key);
			}	
		} if(max == (int) m.get(key)) {
				keylist.add((String) key);
			} max == (int) m.get(key) max (int) m.get(key) m.get m key {
				keylist.add((String) key);
			} keylist.add((String) key) keylist.add keylist (String) key Collections.sort(keylist) Collections.sort Collections keylist for(String str : keylist) {
			System.out.println(str);
		} String str keylist {
			System.out.println(str);
		} {
			System.out.println(str);
		} System.out.println(str) System.out.println System.out System System.out str String[] args args public static int getMax(Map<String ,Integer> m ) {
		int res = 0;
		for(Object key : m.keySet()) {
			res = Math.max(res, m.get(key));
		}
		return res;
	} getMax {
		int res = 0;
		for(Object key : m.keySet()) {
			res = Math.max(res, m.get(key));
		}
		return res;
	} int res = 0; res 0 for(Object key : m.keySet()) {
			res = Math.max(res, m.get(key));
		} Object key m.keySet() m.keySet m {
			res = Math.max(res, m.get(key));
		} {
			res = Math.max(res, m.get(key));
		} res = Math.max(res, m.get(key)) res Math.max(res, m.get(key)) Math.max Math res m.get(key) m.get m key return res; res Map<String ,Integer> m m public class Main {

	public static void main(String[] args) throws NumberFormatException, IOException {
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		Map m = new HashMap<String,Integer>();
		for(int i = 0 ; i < n ; i++) {
			String s = br.readLine();
			if(m.containsKey(s)) {
				m.put(s,(int) m.get(s)+1);	
			}else {
				m.put(s, 1);
			}
		}
		int max =getMax(m);
		ArrayList<String> keylist = new ArrayList<String>();
		for(Object key : m.keySet()) {
			if(max == (int) m.get(key)) {
				keylist.add((String) key);
			}	
		}
		Collections.sort(keylist);
		for(String str : keylist) {
			System.out.println(str);
		}
		
	}
 	public static int getMax(Map<String ,Integer> m ) {
		int res = 0;
		for(Object key : m.keySet()) {
			res = Math.max(res, m.get(key));
		}
		return res;
	}

} public class Main {

	public static void main(String[] args) throws NumberFormatException, IOException {
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		Map m = new HashMap<String,Integer>();
		for(int i = 0 ; i < n ; i++) {
			String s = br.readLine();
			if(m.containsKey(s)) {
				m.put(s,(int) m.get(s)+1);	
			}else {
				m.put(s, 1);
			}
		}
		int max =getMax(m);
		ArrayList<String> keylist = new ArrayList<String>();
		for(Object key : m.keySet()) {
			if(max == (int) m.get(key)) {
				keylist.add((String) key);
			}	
		}
		Collections.sort(keylist);
		for(String str : keylist) {
			System.out.println(str);
		}
		
	}
 	public static int getMax(Map<String ,Integer> m ) {
		int res = 0;
		for(Object key : m.keySet()) {
			res = Math.max(res, m.get(key));
		}
		return res;
	}

} Main

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

public class Main {

	public static void main(String[] args) throws NumberFormatException, IOException {
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		Map m = new HashMap<String,Integer>();
		for(int i = 0 ; i < n ; i++) {
			String s = br.readLine();
			if(m.containsKey(s)) {
				m.put(s,(int) m.get(s)+1);	
			}else {
				m.put(s, 1);
			}
		}
		int max =getMax(m);
		ArrayList<String> keylist = new ArrayList<String>();
		for(Object key : m.keySet()) {
			if(max == (int) m.get(key)) {
				keylist.add((String) key);
			}	
		}
		Collections.sort(keylist);
		for(String str : keylist) {
			System.out.println(str);
		}
		
	}
 	public static int getMax(Map<String ,Integer> m ) {
		int res = 0;
		for(Object key : m.keySet()) {
			res = Math.max(res, m.get(key));
		}
		return res;
	}

}
