import java.util.*;
import java.io.*;

public class Main {
	static int mod = (int) 1e9 + 7;
	static int DX[] = { -1, 0, 1, 0 }, DY[] = { 0, -1, 0, 1 };

	public static void main(String[] args) {
		FastScanner fs = new FastScanner(System.in);
		int n = fs.nextInt();
		
		Map<String, Integer> map = new HashMap<>();
		for(int i=0;i<n;i++) {
			String s = fs.next();
			if(map.containsKey(s)) {
				map.put(s, map.get(s)+1);
			}
			else {
				map.put(s, 1);
			}
		}
		
		List<String> ls[] = new ArrayList[n+1];
		int max = 0;
		for(int i=0;i<n+1;i++)ls[i] = new ArrayList<>();
		for(String key:map.keySet()) {
			int v = map.get(key);
			max = Math.max(max, v);
			ls[v].add(key);
		}
		StringBuilder sb = new StringBuilder();
		ArrayList<String> now = (ArrayList)ls[max];
		Collections.sort(now);
		for(String t : now)sb.append(t+"\n");
		
		System.out.println(sb.toString());

	}
}

//高速なScanner
class FastScanner {
	private BufferedReader reader = null;
	private StringTokenizer tokenizer = null;

	public FastScanner(InputStream in) {
		reader = new BufferedReader(new InputStreamReader(in));
		tokenizer = null;
	}

	public String next() {
		if (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				tokenizer = new StringTokenizer(reader.readLine());
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken();
	}

	public String nextLine() {
		if (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				return reader.readLine();
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken("\n");
	}

	public long nextLong() {
		return Long.parseLong(next());
	}

	public int nextInt() {
		return Integer.parseInt(next());
	}

	public double nextDouble() {
		return Double.parseDouble(next());
	}

	public int[] nextIntArray(int n) {
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = nextInt();
		return a;
	}

	public long[] nextLongArray(int n) {
		long[] a = new long[n];
		for (int i = 0; i < n; i++)
			a[i] = nextLong();
		return a;
	}
} import java.util.*; util.* java import java.io.*; io.* java public class Main {
	static int mod = (int) 1e9 + 7;
	static int DX[] = { -1, 0, 1, 0 }, DY[] = { 0, -1, 0, 1 };

	public static void main(String[] args) {
		FastScanner fs = new FastScanner(System.in);
		int n = fs.nextInt();
		
		Map<String, Integer> map = new HashMap<>();
		for(int i=0;i<n;i++) {
			String s = fs.next();
			if(map.containsKey(s)) {
				map.put(s, map.get(s)+1);
			}
			else {
				map.put(s, 1);
			}
		}
		
		List<String> ls[] = new ArrayList[n+1];
		int max = 0;
		for(int i=0;i<n+1;i++)ls[i] = new ArrayList<>();
		for(String key:map.keySet()) {
			int v = map.get(key);
			max = Math.max(max, v);
			ls[v].add(key);
		}
		StringBuilder sb = new StringBuilder();
		ArrayList<String> now = (ArrayList)ls[max];
		Collections.sort(now);
		for(String t : now)sb.append(t+"\n");
		
		System.out.println(sb.toString());

	}
} Main static int mod = (int) 1e9 + 7; mod (int) 1e9 + 7 (int) 1e9 7 static int DX[] = { -1, 0, 1, 0 } DX { -1, 0, 1, 0 } -1 1 0 1 0 DY[] = { 0, -1, 0, 1 }; DY { 0, -1, 0, 1 } 0 -1 1 0 1 public static void main(String[] args) {
		FastScanner fs = new FastScanner(System.in);
		int n = fs.nextInt();
		
		Map<String, Integer> map = new HashMap<>();
		for(int i=0;i<n;i++) {
			String s = fs.next();
			if(map.containsKey(s)) {
				map.put(s, map.get(s)+1);
			}
			else {
				map.put(s, 1);
			}
		}
		
		List<String> ls[] = new ArrayList[n+1];
		int max = 0;
		for(int i=0;i<n+1;i++)ls[i] = new ArrayList<>();
		for(String key:map.keySet()) {
			int v = map.get(key);
			max = Math.max(max, v);
			ls[v].add(key);
		}
		StringBuilder sb = new StringBuilder();
		ArrayList<String> now = (ArrayList)ls[max];
		Collections.sort(now);
		for(String t : now)sb.append(t+"\n");
		
		System.out.println(sb.toString());

	} main {
		FastScanner fs = new FastScanner(System.in);
		int n = fs.nextInt();
		
		Map<String, Integer> map = new HashMap<>();
		for(int i=0;i<n;i++) {
			String s = fs.next();
			if(map.containsKey(s)) {
				map.put(s, map.get(s)+1);
			}
			else {
				map.put(s, 1);
			}
		}
		
		List<String> ls[] = new ArrayList[n+1];
		int max = 0;
		for(int i=0;i<n+1;i++)ls[i] = new ArrayList<>();
		for(String key:map.keySet()) {
			int v = map.get(key);
			max = Math.max(max, v);
			ls[v].add(key);
		}
		StringBuilder sb = new StringBuilder();
		ArrayList<String> now = (ArrayList)ls[max];
		Collections.sort(now);
		for(String t : now)sb.append(t+"\n");
		
		System.out.println(sb.toString());

	} FastScanner fs = new FastScanner(System.in); fs new FastScanner(System.in) int n = fs.nextInt(); n fs.nextInt() fs.nextInt fs Map<String, Integer> map = new HashMap<>(); map new HashMap<>() for(int i=0;i<n;i++) {
			String s = fs.next();
			if(map.containsKey(s)) {
				map.put(s, map.get(s)+1);
			}
			else {
				map.put(s, 1);
			}
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			String s = fs.next();
			if(map.containsKey(s)) {
				map.put(s, map.get(s)+1);
			}
			else {
				map.put(s, 1);
			}
		} {
			String s = fs.next();
			if(map.containsKey(s)) {
				map.put(s, map.get(s)+1);
			}
			else {
				map.put(s, 1);
			}
		} String s = fs.next(); s fs.next() fs.next fs 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 List<String> ls[] = new ArrayList[n+1]; ls new ArrayList[n+1] n+1 n 1 int max = 0; max 0 for(int i=0;i<n+1;i++)ls[i] = new ArrayList<>(); int i=0; int i=0; i 0 i<n+1 i n+1 n 1 i++ i++ i ls[i] = new ArrayList<>(); ls[i] = new ArrayList<>() ls[i] ls i new ArrayList<>() for(String key:map.keySet()) {
			int v = map.get(key);
			max = Math.max(max, v);
			ls[v].add(key);
		} String key map.keySet() map.keySet map {
			int v = map.get(key);
			max = Math.max(max, v);
			ls[v].add(key);
		} {
			int v = map.get(key);
			max = Math.max(max, v);
			ls[v].add(key);
		} int v = map.get(key); v map.get(key) map.get map key max = Math.max(max, v) max Math.max(max, v) Math.max Math max v ls[v].add(key) ls[v].add ls[v] ls v key StringBuilder sb = new StringBuilder(); sb new StringBuilder() ArrayList<String> now = (ArrayList)ls[max]; now (ArrayList)ls[max] ls max Collections.sort(now) Collections.sort Collections now for(String t : now)sb.append(t+"\n"); String t now sb.append(t+"\n"); sb.append(t+"\n") sb.append sb t+"\n" t "\n" System.out.println(sb.toString()) System.out.println System.out System System.out sb.toString() sb.toString sb String[] args args class FastScanner {
	private BufferedReader reader = null;
	private StringTokenizer tokenizer = null;

	public FastScanner(InputStream in) {
		reader = new BufferedReader(new InputStreamReader(in));
		tokenizer = null;
	}

	public String next() {
		if (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				tokenizer = new StringTokenizer(reader.readLine());
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken();
	}

	public String nextLine() {
		if (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				return reader.readLine();
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken("\n");
	}

	public long nextLong() {
		return Long.parseLong(next());
	}

	public int nextInt() {
		return Integer.parseInt(next());
	}

	public double nextDouble() {
		return Double.parseDouble(next());
	}

	public int[] nextIntArray(int n) {
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = nextInt();
		return a;
	}

	public long[] nextLongArray(int n) {
		long[] a = new long[n];
		for (int i = 0; i < n; i++)
			a[i] = nextLong();
		return a;
	}
} FastScanner private BufferedReader reader = null; reader null private StringTokenizer tokenizer = null; tokenizer null public FastScanner(InputStream in) {
		reader = new BufferedReader(new InputStreamReader(in));
		tokenizer = null;
	} FastScanner {
		reader = new BufferedReader(new InputStreamReader(in));
		tokenizer = null;
	} reader = new BufferedReader(new InputStreamReader(in)) reader new BufferedReader(new InputStreamReader(in)) tokenizer = null tokenizer null InputStream in in public String next() {
		if (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				tokenizer = new StringTokenizer(reader.readLine());
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken();
	} next {
		if (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				tokenizer = new StringTokenizer(reader.readLine());
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken();
	} if (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				tokenizer = new StringTokenizer(reader.readLine());
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		} tokenizer == null || !tokenizer.hasMoreTokens() tokenizer == null tokenizer null !tokenizer.hasMoreTokens() tokenizer.hasMoreTokens() tokenizer.hasMoreTokens tokenizer {
			try {
				tokenizer = new StringTokenizer(reader.readLine());
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		} try {
				tokenizer = new StringTokenizer(reader.readLine());
			} catch (IOException e) {
				throw new RuntimeException(e);
			} catch (IOException e) {
				throw new RuntimeException(e);
			} IOException e {
				throw new RuntimeException(e);
			} throw new RuntimeException(e); new RuntimeException(e) {
				tokenizer = new StringTokenizer(reader.readLine());
			} tokenizer = new StringTokenizer(reader.readLine()) tokenizer new StringTokenizer(reader.readLine()) return tokenizer.nextToken(); tokenizer.nextToken() tokenizer.nextToken tokenizer public String nextLine() {
		if (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				return reader.readLine();
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken("\n");
	} nextLine {
		if (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				return reader.readLine();
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken("\n");
	} if (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				return reader.readLine();
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		} tokenizer == null || !tokenizer.hasMoreTokens() tokenizer == null tokenizer null !tokenizer.hasMoreTokens() tokenizer.hasMoreTokens() tokenizer.hasMoreTokens tokenizer {
			try {
				return reader.readLine();
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		} try {
				return reader.readLine();
			} catch (IOException e) {
				throw new RuntimeException(e);
			} catch (IOException e) {
				throw new RuntimeException(e);
			} IOException e {
				throw new RuntimeException(e);
			} throw new RuntimeException(e); new RuntimeException(e) {
				return reader.readLine();
			} return reader.readLine(); reader.readLine() reader.readLine reader return tokenizer.nextToken("\n"); tokenizer.nextToken("\n") tokenizer.nextToken tokenizer "\n" public long nextLong() {
		return Long.parseLong(next());
	} nextLong {
		return Long.parseLong(next());
	} return Long.parseLong(next()); Long.parseLong(next()) Long.parseLong Long next() next public int nextInt() {
		return Integer.parseInt(next());
	} nextInt {
		return Integer.parseInt(next());
	} return Integer.parseInt(next()); Integer.parseInt(next()) Integer.parseInt Integer next() next public double nextDouble() {
		return Double.parseDouble(next());
	} nextDouble {
		return Double.parseDouble(next());
	} return Double.parseDouble(next()); Double.parseDouble(next()) Double.parseDouble Double next() next public int[] nextIntArray(int n) {
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = nextInt();
		return a;
	} nextIntArray {
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = nextInt();
		return a;
	} int[] a = new int[n]; a new int[n] n for (int i = 0; i < n; i++)
			a[i] = nextInt(); int i = 0; int i = 0; i 0 i < n i n i++ i++ i a[i] = nextInt(); a[i] = nextInt() a[i] a i nextInt() nextInt return a; a int n n public long[] nextLongArray(int n) {
		long[] a = new long[n];
		for (int i = 0; i < n; i++)
			a[i] = nextLong();
		return a;
	} nextLongArray {
		long[] a = new long[n];
		for (int i = 0; i < n; i++)
			a[i] = nextLong();
		return a;
	} long[] a = new long[n]; a new long[n] n for (int i = 0; i < n; i++)
			a[i] = nextLong(); int i = 0; int i = 0; i 0 i < n i n i++ i++ i a[i] = nextLong(); a[i] = nextLong() a[i] a i nextLong() nextLong return a; a int n n public class Main {
	static int mod = (int) 1e9 + 7;
	static int DX[] = { -1, 0, 1, 0 }, DY[] = { 0, -1, 0, 1 };

	public static void main(String[] args) {
		FastScanner fs = new FastScanner(System.in);
		int n = fs.nextInt();
		
		Map<String, Integer> map = new HashMap<>();
		for(int i=0;i<n;i++) {
			String s = fs.next();
			if(map.containsKey(s)) {
				map.put(s, map.get(s)+1);
			}
			else {
				map.put(s, 1);
			}
		}
		
		List<String> ls[] = new ArrayList[n+1];
		int max = 0;
		for(int i=0;i<n+1;i++)ls[i] = new ArrayList<>();
		for(String key:map.keySet()) {
			int v = map.get(key);
			max = Math.max(max, v);
			ls[v].add(key);
		}
		StringBuilder sb = new StringBuilder();
		ArrayList<String> now = (ArrayList)ls[max];
		Collections.sort(now);
		for(String t : now)sb.append(t+"\n");
		
		System.out.println(sb.toString());

	}
} public class Main {
	static int mod = (int) 1e9 + 7;
	static int DX[] = { -1, 0, 1, 0 }, DY[] = { 0, -1, 0, 1 };

	public static void main(String[] args) {
		FastScanner fs = new FastScanner(System.in);
		int n = fs.nextInt();
		
		Map<String, Integer> map = new HashMap<>();
		for(int i=0;i<n;i++) {
			String s = fs.next();
			if(map.containsKey(s)) {
				map.put(s, map.get(s)+1);
			}
			else {
				map.put(s, 1);
			}
		}
		
		List<String> ls[] = new ArrayList[n+1];
		int max = 0;
		for(int i=0;i<n+1;i++)ls[i] = new ArrayList<>();
		for(String key:map.keySet()) {
			int v = map.get(key);
			max = Math.max(max, v);
			ls[v].add(key);
		}
		StringBuilder sb = new StringBuilder();
		ArrayList<String> now = (ArrayList)ls[max];
		Collections.sort(now);
		for(String t : now)sb.append(t+"\n");
		
		System.out.println(sb.toString());

	}
} Main
import java.util.*;
import java.io.*;

public class Main {
	static int mod = (int) 1e9 + 7;
	static int DX[] = { -1, 0, 1, 0 }, DY[] = { 0, -1, 0, 1 };

	public static void main(String[] args) {
		FastScanner fs = new FastScanner(System.in);
		int n = fs.nextInt();
		
		Map<String, Integer> map = new HashMap<>();
		for(int i=0;i<n;i++) {
			String s = fs.next();
			if(map.containsKey(s)) {
				map.put(s, map.get(s)+1);
			}
			else {
				map.put(s, 1);
			}
		}
		
		List<String> ls[] = new ArrayList[n+1];
		int max = 0;
		for(int i=0;i<n+1;i++)ls[i] = new ArrayList<>();
		for(String key:map.keySet()) {
			int v = map.get(key);
			max = Math.max(max, v);
			ls[v].add(key);
		}
		StringBuilder sb = new StringBuilder();
		ArrayList<String> now = (ArrayList)ls[max];
		Collections.sort(now);
		for(String t : now)sb.append(t+"\n");
		
		System.out.println(sb.toString());

	}
}

//高速なScanner
class FastScanner {
	private BufferedReader reader = null;
	private StringTokenizer tokenizer = null;

	public FastScanner(InputStream in) {
		reader = new BufferedReader(new InputStreamReader(in));
		tokenizer = null;
	}

	public String next() {
		if (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				tokenizer = new StringTokenizer(reader.readLine());
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken();
	}

	public String nextLine() {
		if (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				return reader.readLine();
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken("\n");
	}

	public long nextLong() {
		return Long.parseLong(next());
	}

	public int nextInt() {
		return Integer.parseInt(next());
	}

	public double nextDouble() {
		return Double.parseDouble(next());
	}

	public int[] nextIntArray(int n) {
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = nextInt();
		return a;
	}

	public long[] nextLongArray(int n) {
		long[] a = new long[n];
		for (int i = 0; i < n; i++)
			a[i] = nextLong();
		return a;
	}
}