import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws FileNotFoundException {

		//    	File file = new File("src/in.txt");
		//    	Scanner sc = new Scanner(file);

		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		LinkedHashMap<String, Long> map = new LinkedHashMap<String, Long>();
		long max = 0;
		for (int i=0;i<N;i++) {
			String S = sc.next();
		    if (map.containsKey(S)) {
		        map.put(S, map.get(S) + 1);
		        if(max<map.get(S)) {
		        	max = map.get(S);
		        }
		    } else {
		        map.put(S, (long) 1);
		        if(max<1) {
		        	max=1;
		        }
		    }
		}
		ArrayList<String> s = new ArrayList<String>();
		for(String S :map.keySet()) {
			if(map.get(S)==max) {
				s.add(S);
			}
		}
		Collections.sort(s);
		for(String x : s) {
			System.out.println(x);
		}
	}
} import java.io.FileNotFoundException; FileNotFoundException java.io import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections java.util import java.util.LinkedHashMap; LinkedHashMap java.util import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) throws FileNotFoundException {

		//    	File file = new File("src/in.txt");
		//    	Scanner sc = new Scanner(file);

		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		LinkedHashMap<String, Long> map = new LinkedHashMap<String, Long>();
		long max = 0;
		for (int i=0;i<N;i++) {
			String S = sc.next();
		    if (map.containsKey(S)) {
		        map.put(S, map.get(S) + 1);
		        if(max<map.get(S)) {
		        	max = map.get(S);
		        }
		    } else {
		        map.put(S, (long) 1);
		        if(max<1) {
		        	max=1;
		        }
		    }
		}
		ArrayList<String> s = new ArrayList<String>();
		for(String S :map.keySet()) {
			if(map.get(S)==max) {
				s.add(S);
			}
		}
		Collections.sort(s);
		for(String x : s) {
			System.out.println(x);
		}
	}
} Main public static void main(String[] args) throws FileNotFoundException {

		//    	File file = new File("src/in.txt");
		//    	Scanner sc = new Scanner(file);

		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		LinkedHashMap<String, Long> map = new LinkedHashMap<String, Long>();
		long max = 0;
		for (int i=0;i<N;i++) {
			String S = sc.next();
		    if (map.containsKey(S)) {
		        map.put(S, map.get(S) + 1);
		        if(max<map.get(S)) {
		        	max = map.get(S);
		        }
		    } else {
		        map.put(S, (long) 1);
		        if(max<1) {
		        	max=1;
		        }
		    }
		}
		ArrayList<String> s = new ArrayList<String>();
		for(String S :map.keySet()) {
			if(map.get(S)==max) {
				s.add(S);
			}
		}
		Collections.sort(s);
		for(String x : s) {
			System.out.println(x);
		}
	} main {

		//    	File file = new File("src/in.txt");
		//    	Scanner sc = new Scanner(file);

		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		LinkedHashMap<String, Long> map = new LinkedHashMap<String, Long>();
		long max = 0;
		for (int i=0;i<N;i++) {
			String S = sc.next();
		    if (map.containsKey(S)) {
		        map.put(S, map.get(S) + 1);
		        if(max<map.get(S)) {
		        	max = map.get(S);
		        }
		    } else {
		        map.put(S, (long) 1);
		        if(max<1) {
		        	max=1;
		        }
		    }
		}
		ArrayList<String> s = new ArrayList<String>();
		for(String S :map.keySet()) {
			if(map.get(S)==max) {
				s.add(S);
			}
		}
		Collections.sort(s);
		for(String x : s) {
			System.out.println(x);
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc LinkedHashMap<String, Long> map = new LinkedHashMap<String, Long>(); map new LinkedHashMap<String, Long>() long max = 0; max 0 for (int i=0;i<N;i++) {
			String S = sc.next();
		    if (map.containsKey(S)) {
		        map.put(S, map.get(S) + 1);
		        if(max<map.get(S)) {
		        	max = map.get(S);
		        }
		    } else {
		        map.put(S, (long) 1);
		        if(max<1) {
		        	max=1;
		        }
		    }
		} int i=0; int i=0; i 0 i<N i N i++ i++ i {
			String S = sc.next();
		    if (map.containsKey(S)) {
		        map.put(S, map.get(S) + 1);
		        if(max<map.get(S)) {
		        	max = map.get(S);
		        }
		    } else {
		        map.put(S, (long) 1);
		        if(max<1) {
		        	max=1;
		        }
		    }
		} {
			String S = sc.next();
		    if (map.containsKey(S)) {
		        map.put(S, map.get(S) + 1);
		        if(max<map.get(S)) {
		        	max = map.get(S);
		        }
		    } else {
		        map.put(S, (long) 1);
		        if(max<1) {
		        	max=1;
		        }
		    }
		} String S = sc.next(); S sc.next() sc.next sc if (map.containsKey(S)) {
		        map.put(S, map.get(S) + 1);
		        if(max<map.get(S)) {
		        	max = map.get(S);
		        }
		    } else {
		        map.put(S, (long) 1);
		        if(max<1) {
		        	max=1;
		        }
		    } map.containsKey(S) map.containsKey map S {
		        map.put(S, map.get(S) + 1);
		        if(max<map.get(S)) {
		        	max = map.get(S);
		        }
		    } map.put(S, map.get(S) + 1) map.put map S map.get(S) + 1 map.get(S) map.get map S 1 if(max<map.get(S)) {
		        	max = map.get(S);
		        } max<map.get(S) max map.get(S) map.get map S {
		        	max = map.get(S);
		        } max = map.get(S) max map.get(S) map.get map S {
		        map.put(S, (long) 1);
		        if(max<1) {
		        	max=1;
		        }
		    } map.put(S, (long) 1) map.put map S (long) 1 if(max<1) {
		        	max=1;
		        } max<1 max 1 {
		        	max=1;
		        } max=1 max 1 ArrayList<String> s = new ArrayList<String>(); s new ArrayList<String>() for(String S :map.keySet()) {
			if(map.get(S)==max) {
				s.add(S);
			}
		} String S map.keySet() map.keySet map {
			if(map.get(S)==max) {
				s.add(S);
			}
		} {
			if(map.get(S)==max) {
				s.add(S);
			}
		} if(map.get(S)==max) {
				s.add(S);
			} map.get(S)==max map.get(S) map.get map S max {
				s.add(S);
			} s.add(S) s.add s S Collections.sort(s) Collections.sort Collections s for(String x : s) {
			System.out.println(x);
		} String x s {
			System.out.println(x);
		} {
			System.out.println(x);
		} System.out.println(x) System.out.println System.out System System.out x String[] args args public class Main {
	public static void main(String[] args) throws FileNotFoundException {

		//    	File file = new File("src/in.txt");
		//    	Scanner sc = new Scanner(file);

		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		LinkedHashMap<String, Long> map = new LinkedHashMap<String, Long>();
		long max = 0;
		for (int i=0;i<N;i++) {
			String S = sc.next();
		    if (map.containsKey(S)) {
		        map.put(S, map.get(S) + 1);
		        if(max<map.get(S)) {
		        	max = map.get(S);
		        }
		    } else {
		        map.put(S, (long) 1);
		        if(max<1) {
		        	max=1;
		        }
		    }
		}
		ArrayList<String> s = new ArrayList<String>();
		for(String S :map.keySet()) {
			if(map.get(S)==max) {
				s.add(S);
			}
		}
		Collections.sort(s);
		for(String x : s) {
			System.out.println(x);
		}
	}
} public class Main {
	public static void main(String[] args) throws FileNotFoundException {

		//    	File file = new File("src/in.txt");
		//    	Scanner sc = new Scanner(file);

		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		LinkedHashMap<String, Long> map = new LinkedHashMap<String, Long>();
		long max = 0;
		for (int i=0;i<N;i++) {
			String S = sc.next();
		    if (map.containsKey(S)) {
		        map.put(S, map.get(S) + 1);
		        if(max<map.get(S)) {
		        	max = map.get(S);
		        }
		    } else {
		        map.put(S, (long) 1);
		        if(max<1) {
		        	max=1;
		        }
		    }
		}
		ArrayList<String> s = new ArrayList<String>();
		for(String S :map.keySet()) {
			if(map.get(S)==max) {
				s.add(S);
			}
		}
		Collections.sort(s);
		for(String x : s) {
			System.out.println(x);
		}
	}
} Main
import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws FileNotFoundException {

		//    	File file = new File("src/in.txt");
		//    	Scanner sc = new Scanner(file);

		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		LinkedHashMap<String, Long> map = new LinkedHashMap<String, Long>();
		long max = 0;
		for (int i=0;i<N;i++) {
			String S = sc.next();
		    if (map.containsKey(S)) {
		        map.put(S, map.get(S) + 1);
		        if(max<map.get(S)) {
		        	max = map.get(S);
		        }
		    } else {
		        map.put(S, (long) 1);
		        if(max<1) {
		        	max=1;
		        }
		    }
		}
		ArrayList<String> s = new ArrayList<String>();
		for(String S :map.keySet()) {
			if(map.get(S)==max) {
				s.add(S);
			}
		}
		Collections.sort(s);
		for(String x : s) {
			System.out.println(x);
		}
	}
}