import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
    	try {
    		final int N = sc.nextInt();
    		String [] A = new String[N];
    		for (int i=0; i<N; i++) {
    			A[i] = sc.next();
    		}

    		HashMap<String, Integer> map = new HashMap<>();

    		for (int i=0; i<N; i++) {
    			if (map.containsKey(A[i])) {
    				int count = map.get(A[i]);
    				count++;
    				map.put(A[i], count);
    			} else {
    				map.put(A[i], 1);
    			}
    		}

    		int maxCount = 0;
    		ArrayList<String> list = new ArrayList<>();
    		Iterator<String> it = map.keySet().iterator();
    		while (it.hasNext()) {
    			String s = it.next();
    			int count = map.get(s);
    			if (maxCount < count) {
    				list.clear();
    				list.add(s);
    				maxCount = count;
    			} else if (maxCount == count) {
    				list.add(s);
    			}
    		}

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

    	} finally {
    		sc.close();
    	}
    }
} import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections java.util import java.util.HashMap; HashMap java.util import java.util.Iterator; Iterator java.util import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
    	try {
    		final int N = sc.nextInt();
    		String [] A = new String[N];
    		for (int i=0; i<N; i++) {
    			A[i] = sc.next();
    		}

    		HashMap<String, Integer> map = new HashMap<>();

    		for (int i=0; i<N; i++) {
    			if (map.containsKey(A[i])) {
    				int count = map.get(A[i]);
    				count++;
    				map.put(A[i], count);
    			} else {
    				map.put(A[i], 1);
    			}
    		}

    		int maxCount = 0;
    		ArrayList<String> list = new ArrayList<>();
    		Iterator<String> it = map.keySet().iterator();
    		while (it.hasNext()) {
    			String s = it.next();
    			int count = map.get(s);
    			if (maxCount < count) {
    				list.clear();
    				list.add(s);
    				maxCount = count;
    			} else if (maxCount == count) {
    				list.add(s);
    			}
    		}

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

    	} finally {
    		sc.close();
    	}
    }
} Main public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
    	try {
    		final int N = sc.nextInt();
    		String [] A = new String[N];
    		for (int i=0; i<N; i++) {
    			A[i] = sc.next();
    		}

    		HashMap<String, Integer> map = new HashMap<>();

    		for (int i=0; i<N; i++) {
    			if (map.containsKey(A[i])) {
    				int count = map.get(A[i]);
    				count++;
    				map.put(A[i], count);
    			} else {
    				map.put(A[i], 1);
    			}
    		}

    		int maxCount = 0;
    		ArrayList<String> list = new ArrayList<>();
    		Iterator<String> it = map.keySet().iterator();
    		while (it.hasNext()) {
    			String s = it.next();
    			int count = map.get(s);
    			if (maxCount < count) {
    				list.clear();
    				list.add(s);
    				maxCount = count;
    			} else if (maxCount == count) {
    				list.add(s);
    			}
    		}

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

    	} finally {
    		sc.close();
    	}
    } main {
    	Scanner sc = new Scanner(System.in);
    	try {
    		final int N = sc.nextInt();
    		String [] A = new String[N];
    		for (int i=0; i<N; i++) {
    			A[i] = sc.next();
    		}

    		HashMap<String, Integer> map = new HashMap<>();

    		for (int i=0; i<N; i++) {
    			if (map.containsKey(A[i])) {
    				int count = map.get(A[i]);
    				count++;
    				map.put(A[i], count);
    			} else {
    				map.put(A[i], 1);
    			}
    		}

    		int maxCount = 0;
    		ArrayList<String> list = new ArrayList<>();
    		Iterator<String> it = map.keySet().iterator();
    		while (it.hasNext()) {
    			String s = it.next();
    			int count = map.get(s);
    			if (maxCount < count) {
    				list.clear();
    				list.add(s);
    				maxCount = count;
    			} else if (maxCount == count) {
    				list.add(s);
    			}
    		}

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

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

    		HashMap<String, Integer> map = new HashMap<>();

    		for (int i=0; i<N; i++) {
    			if (map.containsKey(A[i])) {
    				int count = map.get(A[i]);
    				count++;
    				map.put(A[i], count);
    			} else {
    				map.put(A[i], 1);
    			}
    		}

    		int maxCount = 0;
    		ArrayList<String> list = new ArrayList<>();
    		Iterator<String> it = map.keySet().iterator();
    		while (it.hasNext()) {
    			String s = it.next();
    			int count = map.get(s);
    			if (maxCount < count) {
    				list.clear();
    				list.add(s);
    				maxCount = count;
    			} else if (maxCount == count) {
    				list.add(s);
    			}
    		}

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

    	} finally {
    		sc.close();
    	} {
    		sc.close();
    	} sc.close() sc.close sc {
    		final int N = sc.nextInt();
    		String [] A = new String[N];
    		for (int i=0; i<N; i++) {
    			A[i] = sc.next();
    		}

    		HashMap<String, Integer> map = new HashMap<>();

    		for (int i=0; i<N; i++) {
    			if (map.containsKey(A[i])) {
    				int count = map.get(A[i]);
    				count++;
    				map.put(A[i], count);
    			} else {
    				map.put(A[i], 1);
    			}
    		}

    		int maxCount = 0;
    		ArrayList<String> list = new ArrayList<>();
    		Iterator<String> it = map.keySet().iterator();
    		while (it.hasNext()) {
    			String s = it.next();
    			int count = map.get(s);
    			if (maxCount < count) {
    				list.clear();
    				list.add(s);
    				maxCount = count;
    			} else if (maxCount == count) {
    				list.add(s);
    			}
    		}

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

    	} final int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc String [] A = new String[N]; A new String[N] N for (int i=0; i<N; i++) {
    			A[i] = sc.next();
    		} int i=0; int i=0; i 0 i<N i N i++ i++ i {
    			A[i] = sc.next();
    		} {
    			A[i] = sc.next();
    		} A[i] = sc.next() A[i] A i sc.next() sc.next sc HashMap<String, Integer> map = new HashMap<>(); map new HashMap<>() for (int i=0; i<N; i++) {
    			if (map.containsKey(A[i])) {
    				int count = map.get(A[i]);
    				count++;
    				map.put(A[i], count);
    			} else {
    				map.put(A[i], 1);
    			}
    		} int i=0; int i=0; i 0 i<N i N i++ i++ i {
    			if (map.containsKey(A[i])) {
    				int count = map.get(A[i]);
    				count++;
    				map.put(A[i], count);
    			} else {
    				map.put(A[i], 1);
    			}
    		} {
    			if (map.containsKey(A[i])) {
    				int count = map.get(A[i]);
    				count++;
    				map.put(A[i], count);
    			} else {
    				map.put(A[i], 1);
    			}
    		} if (map.containsKey(A[i])) {
    				int count = map.get(A[i]);
    				count++;
    				map.put(A[i], count);
    			} else {
    				map.put(A[i], 1);
    			} map.containsKey(A[i]) map.containsKey map A[i] A i {
    				int count = map.get(A[i]);
    				count++;
    				map.put(A[i], count);
    			} int count = map.get(A[i]); count map.get(A[i]) map.get map A[i] A i count++ count map.put(A[i], count) map.put map A[i] A i count {
    				map.put(A[i], 1);
    			} map.put(A[i], 1) map.put map A[i] A i 1 int maxCount = 0; maxCount 0 ArrayList<String> list = new ArrayList<>(); list new ArrayList<>() Iterator<String> it = map.keySet().iterator(); it map.keySet().iterator() map.keySet().iterator map.keySet() map.keySet map while (it.hasNext()) {
    			String s = it.next();
    			int count = map.get(s);
    			if (maxCount < count) {
    				list.clear();
    				list.add(s);
    				maxCount = count;
    			} else if (maxCount == count) {
    				list.add(s);
    			}
    		} it.hasNext() it.hasNext it {
    			String s = it.next();
    			int count = map.get(s);
    			if (maxCount < count) {
    				list.clear();
    				list.add(s);
    				maxCount = count;
    			} else if (maxCount == count) {
    				list.add(s);
    			}
    		} String s = it.next(); s it.next() it.next it int count = map.get(s); count map.get(s) map.get map s if (maxCount < count) {
    				list.clear();
    				list.add(s);
    				maxCount = count;
    			} else if (maxCount == count) {
    				list.add(s);
    			} maxCount < count maxCount count {
    				list.clear();
    				list.add(s);
    				maxCount = count;
    			} list.clear() list.clear list list.add(s) list.add list s maxCount = count maxCount count if (maxCount == count) {
    				list.add(s);
    			} maxCount == count maxCount count {
    				list.add(s);
    			} list.add(s) list.add list s 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);
    	try {
    		final int N = sc.nextInt();
    		String [] A = new String[N];
    		for (int i=0; i<N; i++) {
    			A[i] = sc.next();
    		}

    		HashMap<String, Integer> map = new HashMap<>();

    		for (int i=0; i<N; i++) {
    			if (map.containsKey(A[i])) {
    				int count = map.get(A[i]);
    				count++;
    				map.put(A[i], count);
    			} else {
    				map.put(A[i], 1);
    			}
    		}

    		int maxCount = 0;
    		ArrayList<String> list = new ArrayList<>();
    		Iterator<String> it = map.keySet().iterator();
    		while (it.hasNext()) {
    			String s = it.next();
    			int count = map.get(s);
    			if (maxCount < count) {
    				list.clear();
    				list.add(s);
    				maxCount = count;
    			} else if (maxCount == count) {
    				list.add(s);
    			}
    		}

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

    	} finally {
    		sc.close();
    	}
    }
} public class Main {
    public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
    	try {
    		final int N = sc.nextInt();
    		String [] A = new String[N];
    		for (int i=0; i<N; i++) {
    			A[i] = sc.next();
    		}

    		HashMap<String, Integer> map = new HashMap<>();

    		for (int i=0; i<N; i++) {
    			if (map.containsKey(A[i])) {
    				int count = map.get(A[i]);
    				count++;
    				map.put(A[i], count);
    			} else {
    				map.put(A[i], 1);
    			}
    		}

    		int maxCount = 0;
    		ArrayList<String> list = new ArrayList<>();
    		Iterator<String> it = map.keySet().iterator();
    		while (it.hasNext()) {
    			String s = it.next();
    			int count = map.get(s);
    			if (maxCount < count) {
    				list.clear();
    				list.add(s);
    				maxCount = count;
    			} else if (maxCount == count) {
    				list.add(s);
    			}
    		}

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

    	} finally {
    		sc.close();
    	}
    }
} Main
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
    	try {
    		final int N = sc.nextInt();
    		String [] A = new String[N];
    		for (int i=0; i<N; i++) {
    			A[i] = sc.next();
    		}

    		HashMap<String, Integer> map = new HashMap<>();

    		for (int i=0; i<N; i++) {
    			if (map.containsKey(A[i])) {
    				int count = map.get(A[i]);
    				count++;
    				map.put(A[i], count);
    			} else {
    				map.put(A[i], 1);
    			}
    		}

    		int maxCount = 0;
    		ArrayList<String> list = new ArrayList<>();
    		Iterator<String> it = map.keySet().iterator();
    		while (it.hasNext()) {
    			String s = it.next();
    			int count = map.get(s);
    			if (maxCount < count) {
    				list.clear();
    				list.add(s);
    				maxCount = count;
    			} else if (maxCount == count) {
    				list.add(s);
    			}
    		}

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

    	} finally {
    		sc.close();
    	}
    }
}
