import java.util.*;

import javax.print.attribute.HashAttributeSet;

import java.io.*;

public class Main {

	private static void solve(){
		//Implement solution here.
		int n = ni();
		String[] sa = new String[n];
		for(int i = 0; i < n; i++) sa[i] = next();
		int maxcnt = 0;
		Map<String,Integer> map = new HashMap<>();
		Set<String> set = new HashSet<String>();
		
		for(String s : sa) {
			if(map.containsKey(s)) {
				map.put(s, map.get(s) + 1);
			} else {
				map.put(s, 1);
			}
			
			if(map.get(s) > maxcnt) {
				maxcnt = map.get(s);
				set.clear();
				set.add(s);
			} else if(map.get(s) == maxcnt) {
				set.add(s);				
			}
		}
		Object[] result = set.toArray();
		Arrays.sort(result);
		for(Object s:result) {
			System.out.println((String)s);
		}
			
	}

	//Switch input source (stdin/file)
	private static BufferedReader br;
	public static void main(String[] args){
		br = new BufferedReader(new InputStreamReader(System.in));
		String debugDataPath = System.getenv("DD_PATH");        
		if(debugDataPath != null){
			try{
				br = new BufferedReader(new InputStreamReader(new FileInputStream(new File(debugDataPath))));
			}catch(Exception e){
				throw new RuntimeException(e);
			}
		}
		solve();
	}

	//Input read utility
	private static StringTokenizer tokenizer = null;
	public static String next() {
		while (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				tokenizer = new StringTokenizer(br.readLine());
			} catch (Exception e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken();
	}
	//Get next single int
	private static int ni() {
		return Integer.parseInt(next());
	}
	//Get next single long
	private static long nl() {
		return Long.parseLong(next());
	}
	//Get next single double
	private static double nd() {
		return Double.parseDouble(next());
	}
	//Get next int array from one line
	private static int[] na(int n) {
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = ni();
		return a;
	}
	//Get next char array from one line
	private static char[] ns() {
		return next().toCharArray();
	}
	//Get next long array from one line
	private static long[] nal(int n) {
		long[] a = new long[n];
		for (int i = 0; i < n; i++)
			a[i] = nl();
		return a;
	}
} import java.util.*; util.* java import javax.print.attribute.HashAttributeSet; HashAttributeSet javax.print.attribute import java.io.*; io.* java public class Main {

	private static void solve(){
		//Implement solution here.
		int n = ni();
		String[] sa = new String[n];
		for(int i = 0; i < n; i++) sa[i] = next();
		int maxcnt = 0;
		Map<String,Integer> map = new HashMap<>();
		Set<String> set = new HashSet<String>();
		
		for(String s : sa) {
			if(map.containsKey(s)) {
				map.put(s, map.get(s) + 1);
			} else {
				map.put(s, 1);
			}
			
			if(map.get(s) > maxcnt) {
				maxcnt = map.get(s);
				set.clear();
				set.add(s);
			} else if(map.get(s) == maxcnt) {
				set.add(s);				
			}
		}
		Object[] result = set.toArray();
		Arrays.sort(result);
		for(Object s:result) {
			System.out.println((String)s);
		}
			
	}

	//Switch input source (stdin/file)
	private static BufferedReader br;
	public static void main(String[] args){
		br = new BufferedReader(new InputStreamReader(System.in));
		String debugDataPath = System.getenv("DD_PATH");        
		if(debugDataPath != null){
			try{
				br = new BufferedReader(new InputStreamReader(new FileInputStream(new File(debugDataPath))));
			}catch(Exception e){
				throw new RuntimeException(e);
			}
		}
		solve();
	}

	//Input read utility
	private static StringTokenizer tokenizer = null;
	public static String next() {
		while (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				tokenizer = new StringTokenizer(br.readLine());
			} catch (Exception e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken();
	}
	//Get next single int
	private static int ni() {
		return Integer.parseInt(next());
	}
	//Get next single long
	private static long nl() {
		return Long.parseLong(next());
	}
	//Get next single double
	private static double nd() {
		return Double.parseDouble(next());
	}
	//Get next int array from one line
	private static int[] na(int n) {
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = ni();
		return a;
	}
	//Get next char array from one line
	private static char[] ns() {
		return next().toCharArray();
	}
	//Get next long array from one line
	private static long[] nal(int n) {
		long[] a = new long[n];
		for (int i = 0; i < n; i++)
			a[i] = nl();
		return a;
	}
} Main //Switch input source (stdin/file)
	private static BufferedReader br; br //Input read utility
	private static StringTokenizer tokenizer = null; tokenizer null private static void solve(){
		//Implement solution here.
		int n = ni();
		String[] sa = new String[n];
		for(int i = 0; i < n; i++) sa[i] = next();
		int maxcnt = 0;
		Map<String,Integer> map = new HashMap<>();
		Set<String> set = new HashSet<String>();
		
		for(String s : sa) {
			if(map.containsKey(s)) {
				map.put(s, map.get(s) + 1);
			} else {
				map.put(s, 1);
			}
			
			if(map.get(s) > maxcnt) {
				maxcnt = map.get(s);
				set.clear();
				set.add(s);
			} else if(map.get(s) == maxcnt) {
				set.add(s);				
			}
		}
		Object[] result = set.toArray();
		Arrays.sort(result);
		for(Object s:result) {
			System.out.println((String)s);
		}
			
	} solve {
		//Implement solution here.
		int n = ni();
		String[] sa = new String[n];
		for(int i = 0; i < n; i++) sa[i] = next();
		int maxcnt = 0;
		Map<String,Integer> map = new HashMap<>();
		Set<String> set = new HashSet<String>();
		
		for(String s : sa) {
			if(map.containsKey(s)) {
				map.put(s, map.get(s) + 1);
			} else {
				map.put(s, 1);
			}
			
			if(map.get(s) > maxcnt) {
				maxcnt = map.get(s);
				set.clear();
				set.add(s);
			} else if(map.get(s) == maxcnt) {
				set.add(s);				
			}
		}
		Object[] result = set.toArray();
		Arrays.sort(result);
		for(Object s:result) {
			System.out.println((String)s);
		}
			
	} int n = ni(); n ni() ni String[] sa = new String[n]; sa new String[n] n for(int i = 0; i < n; i++) sa[i] = next(); int i = 0; int i = 0; i 0 i < n i n i++ i++ i sa[i] = next(); sa[i] = next() sa[i] sa i next() next int maxcnt = 0; maxcnt 0 Map<String,Integer> map = new HashMap<>(); map new HashMap<>() Set<String> set = new HashSet<String>(); set new HashSet<String>() for(String s : sa) {
			if(map.containsKey(s)) {
				map.put(s, map.get(s) + 1);
			} else {
				map.put(s, 1);
			}
			
			if(map.get(s) > maxcnt) {
				maxcnt = map.get(s);
				set.clear();
				set.add(s);
			} else if(map.get(s) == maxcnt) {
				set.add(s);				
			}
		} String s sa {
			if(map.containsKey(s)) {
				map.put(s, map.get(s) + 1);
			} else {
				map.put(s, 1);
			}
			
			if(map.get(s) > maxcnt) {
				maxcnt = map.get(s);
				set.clear();
				set.add(s);
			} else if(map.get(s) == maxcnt) {
				set.add(s);				
			}
		} {
			if(map.containsKey(s)) {
				map.put(s, map.get(s) + 1);
			} else {
				map.put(s, 1);
			}
			
			if(map.get(s) > maxcnt) {
				maxcnt = map.get(s);
				set.clear();
				set.add(s);
			} else if(map.get(s) == maxcnt) {
				set.add(s);				
			}
		} if(map.containsKey(s)) {
				map.put(s, map.get(s) + 1);
			} else {
				map.put(s, 1);
			} map.containsKey(s) map.containsKey map s {
				map.put(s, map.get(s) + 1);
			} map.put(s, map.get(s) + 1) map.put map s map.get(s) + 1 map.get(s) map.get map s 1 {
				map.put(s, 1);
			} map.put(s, 1) map.put map s 1 if(map.get(s) > maxcnt) {
				maxcnt = map.get(s);
				set.clear();
				set.add(s);
			} else if(map.get(s) == maxcnt) {
				set.add(s);				
			} map.get(s) > maxcnt map.get(s) map.get map s maxcnt {
				maxcnt = map.get(s);
				set.clear();
				set.add(s);
			} maxcnt = map.get(s) maxcnt map.get(s) map.get map s set.clear() set.clear set set.add(s) set.add set s if(map.get(s) == maxcnt) {
				set.add(s);				
			} map.get(s) == maxcnt map.get(s) map.get map s maxcnt {
				set.add(s);				
			} set.add(s) set.add set s Object[] result = set.toArray(); result set.toArray() set.toArray set Arrays.sort(result) Arrays.sort Arrays result for(Object s:result) {
			System.out.println((String)s);
		} Object s result {
			System.out.println((String)s);
		} {
			System.out.println((String)s);
		} System.out.println((String)s) System.out.println System.out System System.out (String)s public static void main(String[] args){
		br = new BufferedReader(new InputStreamReader(System.in));
		String debugDataPath = System.getenv("DD_PATH");        
		if(debugDataPath != null){
			try{
				br = new BufferedReader(new InputStreamReader(new FileInputStream(new File(debugDataPath))));
			}catch(Exception e){
				throw new RuntimeException(e);
			}
		}
		solve();
	} main {
		br = new BufferedReader(new InputStreamReader(System.in));
		String debugDataPath = System.getenv("DD_PATH");        
		if(debugDataPath != null){
			try{
				br = new BufferedReader(new InputStreamReader(new FileInputStream(new File(debugDataPath))));
			}catch(Exception e){
				throw new RuntimeException(e);
			}
		}
		solve();
	} br = new BufferedReader(new InputStreamReader(System.in)) br new BufferedReader(new InputStreamReader(System.in)) String debugDataPath = System.getenv("DD_PATH"); debugDataPath System.getenv("DD_PATH") System.getenv System "DD_PATH" if(debugDataPath != null){
			try{
				br = new BufferedReader(new InputStreamReader(new FileInputStream(new File(debugDataPath))));
			}catch(Exception e){
				throw new RuntimeException(e);
			}
		} debugDataPath != null debugDataPath null {
			try{
				br = new BufferedReader(new InputStreamReader(new FileInputStream(new File(debugDataPath))));
			}catch(Exception e){
				throw new RuntimeException(e);
			}
		} try{
				br = new BufferedReader(new InputStreamReader(new FileInputStream(new File(debugDataPath))));
			}catch(Exception e){
				throw new RuntimeException(e);
			} catch(Exception e){
				throw new RuntimeException(e);
			} Exception e {
				throw new RuntimeException(e);
			} throw new RuntimeException(e); new RuntimeException(e) {
				br = new BufferedReader(new InputStreamReader(new FileInputStream(new File(debugDataPath))));
			} br = new BufferedReader(new InputStreamReader(new FileInputStream(new File(debugDataPath)))) br new BufferedReader(new InputStreamReader(new FileInputStream(new File(debugDataPath)))) solve() solve String[] args args public static String next() {
		while (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				tokenizer = new StringTokenizer(br.readLine());
			} catch (Exception e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken();
	} next {
		while (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				tokenizer = new StringTokenizer(br.readLine());
			} catch (Exception e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken();
	} while (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				tokenizer = new StringTokenizer(br.readLine());
			} catch (Exception e) {
				throw new RuntimeException(e);
			}
		} tokenizer == null || !tokenizer.hasMoreTokens() tokenizer == null tokenizer null !tokenizer.hasMoreTokens() tokenizer.hasMoreTokens() tokenizer.hasMoreTokens tokenizer {
			try {
				tokenizer = new StringTokenizer(br.readLine());
			} catch (Exception e) {
				throw new RuntimeException(e);
			}
		} try {
				tokenizer = new StringTokenizer(br.readLine());
			} catch (Exception e) {
				throw new RuntimeException(e);
			} catch (Exception e) {
				throw new RuntimeException(e);
			} Exception e {
				throw new RuntimeException(e);
			} throw new RuntimeException(e); new RuntimeException(e) {
				tokenizer = new StringTokenizer(br.readLine());
			} tokenizer = new StringTokenizer(br.readLine()) tokenizer new StringTokenizer(br.readLine()) return tokenizer.nextToken(); tokenizer.nextToken() tokenizer.nextToken tokenizer //Get next single int
	private static int ni() {
		return Integer.parseInt(next());
	} ni {
		return Integer.parseInt(next());
	} return Integer.parseInt(next()); Integer.parseInt(next()) Integer.parseInt Integer next() next //Get next single long
	private static long nl() {
		return Long.parseLong(next());
	} nl {
		return Long.parseLong(next());
	} return Long.parseLong(next()); Long.parseLong(next()) Long.parseLong Long next() next //Get next single double
	private static double nd() {
		return Double.parseDouble(next());
	} nd {
		return Double.parseDouble(next());
	} return Double.parseDouble(next()); Double.parseDouble(next()) Double.parseDouble Double next() next //Get next int array from one line
	private static int[] na(int n) {
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = ni();
		return a;
	} na {
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = ni();
		return a;
	} int[] a = new int[n]; a new int[n] n for (int i = 0; i < n; i++)
			a[i] = ni(); int i = 0; int i = 0; i 0 i < n i n i++ i++ i a[i] = ni(); a[i] = ni() a[i] a i ni() ni return a; a int n n //Get next char array from one line
	private static char[] ns() {
		return next().toCharArray();
	} ns {
		return next().toCharArray();
	} return next().toCharArray(); next().toCharArray() next().toCharArray next() next //Get next long array from one line
	private static long[] nal(int n) {
		long[] a = new long[n];
		for (int i = 0; i < n; i++)
			a[i] = nl();
		return a;
	} nal {
		long[] a = new long[n];
		for (int i = 0; i < n; i++)
			a[i] = nl();
		return a;
	} long[] a = new long[n]; a new long[n] n for (int i = 0; i < n; i++)
			a[i] = nl(); int i = 0; int i = 0; i 0 i < n i n i++ i++ i a[i] = nl(); a[i] = nl() a[i] a i nl() nl return a; a int n n public class Main {

	private static void solve(){
		//Implement solution here.
		int n = ni();
		String[] sa = new String[n];
		for(int i = 0; i < n; i++) sa[i] = next();
		int maxcnt = 0;
		Map<String,Integer> map = new HashMap<>();
		Set<String> set = new HashSet<String>();
		
		for(String s : sa) {
			if(map.containsKey(s)) {
				map.put(s, map.get(s) + 1);
			} else {
				map.put(s, 1);
			}
			
			if(map.get(s) > maxcnt) {
				maxcnt = map.get(s);
				set.clear();
				set.add(s);
			} else if(map.get(s) == maxcnt) {
				set.add(s);				
			}
		}
		Object[] result = set.toArray();
		Arrays.sort(result);
		for(Object s:result) {
			System.out.println((String)s);
		}
			
	}

	//Switch input source (stdin/file)
	private static BufferedReader br;
	public static void main(String[] args){
		br = new BufferedReader(new InputStreamReader(System.in));
		String debugDataPath = System.getenv("DD_PATH");        
		if(debugDataPath != null){
			try{
				br = new BufferedReader(new InputStreamReader(new FileInputStream(new File(debugDataPath))));
			}catch(Exception e){
				throw new RuntimeException(e);
			}
		}
		solve();
	}

	//Input read utility
	private static StringTokenizer tokenizer = null;
	public static String next() {
		while (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				tokenizer = new StringTokenizer(br.readLine());
			} catch (Exception e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken();
	}
	//Get next single int
	private static int ni() {
		return Integer.parseInt(next());
	}
	//Get next single long
	private static long nl() {
		return Long.parseLong(next());
	}
	//Get next single double
	private static double nd() {
		return Double.parseDouble(next());
	}
	//Get next int array from one line
	private static int[] na(int n) {
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = ni();
		return a;
	}
	//Get next char array from one line
	private static char[] ns() {
		return next().toCharArray();
	}
	//Get next long array from one line
	private static long[] nal(int n) {
		long[] a = new long[n];
		for (int i = 0; i < n; i++)
			a[i] = nl();
		return a;
	}
} public class Main {

	private static void solve(){
		//Implement solution here.
		int n = ni();
		String[] sa = new String[n];
		for(int i = 0; i < n; i++) sa[i] = next();
		int maxcnt = 0;
		Map<String,Integer> map = new HashMap<>();
		Set<String> set = new HashSet<String>();
		
		for(String s : sa) {
			if(map.containsKey(s)) {
				map.put(s, map.get(s) + 1);
			} else {
				map.put(s, 1);
			}
			
			if(map.get(s) > maxcnt) {
				maxcnt = map.get(s);
				set.clear();
				set.add(s);
			} else if(map.get(s) == maxcnt) {
				set.add(s);				
			}
		}
		Object[] result = set.toArray();
		Arrays.sort(result);
		for(Object s:result) {
			System.out.println((String)s);
		}
			
	}

	//Switch input source (stdin/file)
	private static BufferedReader br;
	public static void main(String[] args){
		br = new BufferedReader(new InputStreamReader(System.in));
		String debugDataPath = System.getenv("DD_PATH");        
		if(debugDataPath != null){
			try{
				br = new BufferedReader(new InputStreamReader(new FileInputStream(new File(debugDataPath))));
			}catch(Exception e){
				throw new RuntimeException(e);
			}
		}
		solve();
	}

	//Input read utility
	private static StringTokenizer tokenizer = null;
	public static String next() {
		while (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				tokenizer = new StringTokenizer(br.readLine());
			} catch (Exception e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken();
	}
	//Get next single int
	private static int ni() {
		return Integer.parseInt(next());
	}
	//Get next single long
	private static long nl() {
		return Long.parseLong(next());
	}
	//Get next single double
	private static double nd() {
		return Double.parseDouble(next());
	}
	//Get next int array from one line
	private static int[] na(int n) {
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = ni();
		return a;
	}
	//Get next char array from one line
	private static char[] ns() {
		return next().toCharArray();
	}
	//Get next long array from one line
	private static long[] nal(int n) {
		long[] a = new long[n];
		for (int i = 0; i < n; i++)
			a[i] = nl();
		return a;
	}
} Main
import java.util.*;

import javax.print.attribute.HashAttributeSet;

import java.io.*;

public class Main {

	private static void solve(){
		//Implement solution here.
		int n = ni();
		String[] sa = new String[n];
		for(int i = 0; i < n; i++) sa[i] = next();
		int maxcnt = 0;
		Map<String,Integer> map = new HashMap<>();
		Set<String> set = new HashSet<String>();
		
		for(String s : sa) {
			if(map.containsKey(s)) {
				map.put(s, map.get(s) + 1);
			} else {
				map.put(s, 1);
			}
			
			if(map.get(s) > maxcnt) {
				maxcnt = map.get(s);
				set.clear();
				set.add(s);
			} else if(map.get(s) == maxcnt) {
				set.add(s);				
			}
		}
		Object[] result = set.toArray();
		Arrays.sort(result);
		for(Object s:result) {
			System.out.println((String)s);
		}
			
	}

	//Switch input source (stdin/file)
	private static BufferedReader br;
	public static void main(String[] args){
		br = new BufferedReader(new InputStreamReader(System.in));
		String debugDataPath = System.getenv("DD_PATH");        
		if(debugDataPath != null){
			try{
				br = new BufferedReader(new InputStreamReader(new FileInputStream(new File(debugDataPath))));
			}catch(Exception e){
				throw new RuntimeException(e);
			}
		}
		solve();
	}

	//Input read utility
	private static StringTokenizer tokenizer = null;
	public static String next() {
		while (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				tokenizer = new StringTokenizer(br.readLine());
			} catch (Exception e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken();
	}
	//Get next single int
	private static int ni() {
		return Integer.parseInt(next());
	}
	//Get next single long
	private static long nl() {
		return Long.parseLong(next());
	}
	//Get next single double
	private static double nd() {
		return Double.parseDouble(next());
	}
	//Get next int array from one line
	private static int[] na(int n) {
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = ni();
		return a;
	}
	//Get next char array from one line
	private static char[] ns() {
		return next().toCharArray();
	}
	//Get next long array from one line
	private static long[] nal(int n) {
		long[] a = new long[n];
		for (int i = 0; i < n; i++)
			a[i] = nl();
		return a;
	}
}