import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map.Entry;
import java.util.Scanner;

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

	    Scanner sc = new Scanner(System.in);
	    int N = sc.nextInt();
	    String[] S = new String[N];
	    for (int i = 0; i < N; i++) {
	    	S[i] = sc.next();
	    }

	    int max = 0;
	    HashMap<String, Integer> map = new HashMap<>();
	    for ( int i = 0; i < N; i++) {
	    	Integer count = map.get(S[i]);
	    	if (count == null) {
	    		count = 1;
	    	} else {
	    		count++;
	    	}

	    	map.put(S[i], count);

	    	if (count > max) {
	    		max = count;
	    	}
	    }

	    ArrayList<String> list = new ArrayList<>();
	    for (Entry<String, Integer> entry : map.entrySet()) {
	    	if (entry.getValue() == max) {
	    		list.add(entry.getKey());
	    	}
	    }

	    Collections.sort(list);

	    for (String s : list) {
	    	System.out.println(s);
	    }

	}
} 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.Entry; Entry java.util.Map import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {

	    Scanner sc = new Scanner(System.in);
	    int N = sc.nextInt();
	    String[] S = new String[N];
	    for (int i = 0; i < N; i++) {
	    	S[i] = sc.next();
	    }

	    int max = 0;
	    HashMap<String, Integer> map = new HashMap<>();
	    for ( int i = 0; i < N; i++) {
	    	Integer count = map.get(S[i]);
	    	if (count == null) {
	    		count = 1;
	    	} else {
	    		count++;
	    	}

	    	map.put(S[i], count);

	    	if (count > max) {
	    		max = count;
	    	}
	    }

	    ArrayList<String> list = new ArrayList<>();
	    for (Entry<String, Integer> entry : map.entrySet()) {
	    	if (entry.getValue() == max) {
	    		list.add(entry.getKey());
	    	}
	    }

	    Collections.sort(list);

	    for (String s : list) {
	    	System.out.println(s);
	    }

	}
} Main public static void main(String[] args) {

	    Scanner sc = new Scanner(System.in);
	    int N = sc.nextInt();
	    String[] S = new String[N];
	    for (int i = 0; i < N; i++) {
	    	S[i] = sc.next();
	    }

	    int max = 0;
	    HashMap<String, Integer> map = new HashMap<>();
	    for ( int i = 0; i < N; i++) {
	    	Integer count = map.get(S[i]);
	    	if (count == null) {
	    		count = 1;
	    	} else {
	    		count++;
	    	}

	    	map.put(S[i], count);

	    	if (count > max) {
	    		max = count;
	    	}
	    }

	    ArrayList<String> list = new ArrayList<>();
	    for (Entry<String, Integer> entry : map.entrySet()) {
	    	if (entry.getValue() == max) {
	    		list.add(entry.getKey());
	    	}
	    }

	    Collections.sort(list);

	    for (String s : list) {
	    	System.out.println(s);
	    }

	} main {

	    Scanner sc = new Scanner(System.in);
	    int N = sc.nextInt();
	    String[] S = new String[N];
	    for (int i = 0; i < N; i++) {
	    	S[i] = sc.next();
	    }

	    int max = 0;
	    HashMap<String, Integer> map = new HashMap<>();
	    for ( int i = 0; i < N; i++) {
	    	Integer count = map.get(S[i]);
	    	if (count == null) {
	    		count = 1;
	    	} else {
	    		count++;
	    	}

	    	map.put(S[i], count);

	    	if (count > max) {
	    		max = count;
	    	}
	    }

	    ArrayList<String> list = new ArrayList<>();
	    for (Entry<String, Integer> entry : map.entrySet()) {
	    	if (entry.getValue() == max) {
	    		list.add(entry.getKey());
	    	}
	    }

	    Collections.sort(list);

	    for (String s : list) {
	    	System.out.println(s);
	    }

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc String[] S = new String[N]; S new String[N] N for (int i = 0; i < N; i++) {
	    	S[i] = sc.next();
	    } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
	    	S[i] = sc.next();
	    } {
	    	S[i] = sc.next();
	    } S[i] = sc.next() S[i] S i sc.next() sc.next sc int max = 0; max 0 HashMap<String, Integer> map = new HashMap<>(); map new HashMap<>() for ( int i = 0; i < N; i++) {
	    	Integer count = map.get(S[i]);
	    	if (count == null) {
	    		count = 1;
	    	} else {
	    		count++;
	    	}

	    	map.put(S[i], count);

	    	if (count > max) {
	    		max = count;
	    	}
	    } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
	    	Integer count = map.get(S[i]);
	    	if (count == null) {
	    		count = 1;
	    	} else {
	    		count++;
	    	}

	    	map.put(S[i], count);

	    	if (count > max) {
	    		max = count;
	    	}
	    } {
	    	Integer count = map.get(S[i]);
	    	if (count == null) {
	    		count = 1;
	    	} else {
	    		count++;
	    	}

	    	map.put(S[i], count);

	    	if (count > max) {
	    		max = count;
	    	}
	    } Integer count = map.get(S[i]); count map.get(S[i]) map.get map S[i] S i if (count == null) {
	    		count = 1;
	    	} else {
	    		count++;
	    	} count == null count null {
	    		count = 1;
	    	} count = 1 count 1 {
	    		count++;
	    	} count++ count map.put(S[i], count) map.put map S[i] S i count if (count > max) {
	    		max = count;
	    	} count > max count max {
	    		max = count;
	    	} max = count max count ArrayList<String> list = new ArrayList<>(); list new ArrayList<>() for (Entry<String, Integer> entry : map.entrySet()) {
	    	if (entry.getValue() == max) {
	    		list.add(entry.getKey());
	    	}
	    } Entry<String, Integer> entry map.entrySet() map.entrySet map {
	    	if (entry.getValue() == max) {
	    		list.add(entry.getKey());
	    	}
	    } {
	    	if (entry.getValue() == max) {
	    		list.add(entry.getKey());
	    	}
	    } if (entry.getValue() == max) {
	    		list.add(entry.getKey());
	    	} entry.getValue() == max entry.getValue() entry.getValue entry max {
	    		list.add(entry.getKey());
	    	} list.add(entry.getKey()) list.add list entry.getKey() entry.getKey entry Collections.sort(list) Collections.sort Collections list for (String s : list) {
	    	System.out.println(s);
	    } String s list {
	    	System.out.println(s);
	    } {
	    	System.out.println(s);
	    } System.out.println(s) System.out.println System.out System System.out s String[] args args public class Main {
	public static void main(String[] args) {

	    Scanner sc = new Scanner(System.in);
	    int N = sc.nextInt();
	    String[] S = new String[N];
	    for (int i = 0; i < N; i++) {
	    	S[i] = sc.next();
	    }

	    int max = 0;
	    HashMap<String, Integer> map = new HashMap<>();
	    for ( int i = 0; i < N; i++) {
	    	Integer count = map.get(S[i]);
	    	if (count == null) {
	    		count = 1;
	    	} else {
	    		count++;
	    	}

	    	map.put(S[i], count);

	    	if (count > max) {
	    		max = count;
	    	}
	    }

	    ArrayList<String> list = new ArrayList<>();
	    for (Entry<String, Integer> entry : map.entrySet()) {
	    	if (entry.getValue() == max) {
	    		list.add(entry.getKey());
	    	}
	    }

	    Collections.sort(list);

	    for (String s : list) {
	    	System.out.println(s);
	    }

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

	    Scanner sc = new Scanner(System.in);
	    int N = sc.nextInt();
	    String[] S = new String[N];
	    for (int i = 0; i < N; i++) {
	    	S[i] = sc.next();
	    }

	    int max = 0;
	    HashMap<String, Integer> map = new HashMap<>();
	    for ( int i = 0; i < N; i++) {
	    	Integer count = map.get(S[i]);
	    	if (count == null) {
	    		count = 1;
	    	} else {
	    		count++;
	    	}

	    	map.put(S[i], count);

	    	if (count > max) {
	    		max = count;
	    	}
	    }

	    ArrayList<String> list = new ArrayList<>();
	    for (Entry<String, Integer> entry : map.entrySet()) {
	    	if (entry.getValue() == max) {
	    		list.add(entry.getKey());
	    	}
	    }

	    Collections.sort(list);

	    for (String s : list) {
	    	System.out.println(s);
	    }

	}
} Main
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map.Entry;
import java.util.Scanner;

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

	    Scanner sc = new Scanner(System.in);
	    int N = sc.nextInt();
	    String[] S = new String[N];
	    for (int i = 0; i < N; i++) {
	    	S[i] = sc.next();
	    }

	    int max = 0;
	    HashMap<String, Integer> map = new HashMap<>();
	    for ( int i = 0; i < N; i++) {
	    	Integer count = map.get(S[i]);
	    	if (count == null) {
	    		count = 1;
	    	} else {
	    		count++;
	    	}

	    	map.put(S[i], count);

	    	if (count > max) {
	    		max = count;
	    	}
	    }

	    ArrayList<String> list = new ArrayList<>();
	    for (Entry<String, Integer> entry : map.entrySet()) {
	    	if (entry.getValue() == max) {
	    		list.add(entry.getKey());
	    	}
	    }

	    Collections.sort(list);

	    for (String s : list) {
	    	System.out.println(s);
	    }

	}
}