import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Scanner;
import java.util.Set;

public class Main {

    public static void main(String[] args) throws Exception {

//    	File file = new File("test.txt");
//    	Scanner sc = new Scanner(file);
    	Scanner sc = new Scanner(System.in);
    	int n = sc.nextInt();
    	String[] ary = new String[n];
    	List<String> ans = new ArrayList<String>();
    	for(int i = 0; i < n; i++){
    		String s = sc.next();
    		ary[i] = s;
    	}
    	sc.close();
    	Arrays.sort(ary);
    	Set<String> set = new HashSet<String>(Arrays.asList(ary));
    	if(ary.length == set.size()){
    		for(int i = 0; i < ary.length; i++){
        		System.out.println(ary[i]);
        	}
    		return;
    	}
    	int maxcnt = 0;
    	int cnt = 0;
    	ans.add(ary[0]);
    	for(int i = 0; i < n-1; i++){
    		if(ary[i].equals(ary[i+1])){
    			cnt++;
    		}else{
    			cnt = 0;
    		}
    		if(maxcnt == cnt){
    			ans.add(ary[i]);
    		}else if(maxcnt < cnt){
    			maxcnt = cnt;
    			ans.clear();
    			ans.add(ary[i]);
    		}
    	}
    	for(int i = 0; i < ans.size(); i++){
    		System.out.println(ans.get(i));
    	}
    }
} import java.util.ArrayList; ArrayList java.util import java.util.Arrays; Arrays java.util import java.util.HashSet; HashSet java.util import java.util.List; List java.util import java.util.Scanner; Scanner java.util import java.util.Set; Set java.util public class Main {

    public static void main(String[] args) throws Exception {

//    	File file = new File("test.txt");
//    	Scanner sc = new Scanner(file);
    	Scanner sc = new Scanner(System.in);
    	int n = sc.nextInt();
    	String[] ary = new String[n];
    	List<String> ans = new ArrayList<String>();
    	for(int i = 0; i < n; i++){
    		String s = sc.next();
    		ary[i] = s;
    	}
    	sc.close();
    	Arrays.sort(ary);
    	Set<String> set = new HashSet<String>(Arrays.asList(ary));
    	if(ary.length == set.size()){
    		for(int i = 0; i < ary.length; i++){
        		System.out.println(ary[i]);
        	}
    		return;
    	}
    	int maxcnt = 0;
    	int cnt = 0;
    	ans.add(ary[0]);
    	for(int i = 0; i < n-1; i++){
    		if(ary[i].equals(ary[i+1])){
    			cnt++;
    		}else{
    			cnt = 0;
    		}
    		if(maxcnt == cnt){
    			ans.add(ary[i]);
    		}else if(maxcnt < cnt){
    			maxcnt = cnt;
    			ans.clear();
    			ans.add(ary[i]);
    		}
    	}
    	for(int i = 0; i < ans.size(); i++){
    		System.out.println(ans.get(i));
    	}
    }
} Main public static void main(String[] args) throws Exception {

//    	File file = new File("test.txt");
//    	Scanner sc = new Scanner(file);
    	Scanner sc = new Scanner(System.in);
    	int n = sc.nextInt();
    	String[] ary = new String[n];
    	List<String> ans = new ArrayList<String>();
    	for(int i = 0; i < n; i++){
    		String s = sc.next();
    		ary[i] = s;
    	}
    	sc.close();
    	Arrays.sort(ary);
    	Set<String> set = new HashSet<String>(Arrays.asList(ary));
    	if(ary.length == set.size()){
    		for(int i = 0; i < ary.length; i++){
        		System.out.println(ary[i]);
        	}
    		return;
    	}
    	int maxcnt = 0;
    	int cnt = 0;
    	ans.add(ary[0]);
    	for(int i = 0; i < n-1; i++){
    		if(ary[i].equals(ary[i+1])){
    			cnt++;
    		}else{
    			cnt = 0;
    		}
    		if(maxcnt == cnt){
    			ans.add(ary[i]);
    		}else if(maxcnt < cnt){
    			maxcnt = cnt;
    			ans.clear();
    			ans.add(ary[i]);
    		}
    	}
    	for(int i = 0; i < ans.size(); i++){
    		System.out.println(ans.get(i));
    	}
    } main {

//    	File file = new File("test.txt");
//    	Scanner sc = new Scanner(file);
    	Scanner sc = new Scanner(System.in);
    	int n = sc.nextInt();
    	String[] ary = new String[n];
    	List<String> ans = new ArrayList<String>();
    	for(int i = 0; i < n; i++){
    		String s = sc.next();
    		ary[i] = s;
    	}
    	sc.close();
    	Arrays.sort(ary);
    	Set<String> set = new HashSet<String>(Arrays.asList(ary));
    	if(ary.length == set.size()){
    		for(int i = 0; i < ary.length; i++){
        		System.out.println(ary[i]);
        	}
    		return;
    	}
    	int maxcnt = 0;
    	int cnt = 0;
    	ans.add(ary[0]);
    	for(int i = 0; i < n-1; i++){
    		if(ary[i].equals(ary[i+1])){
    			cnt++;
    		}else{
    			cnt = 0;
    		}
    		if(maxcnt == cnt){
    			ans.add(ary[i]);
    		}else if(maxcnt < cnt){
    			maxcnt = cnt;
    			ans.clear();
    			ans.add(ary[i]);
    		}
    	}
    	for(int i = 0; i < ans.size(); i++){
    		System.out.println(ans.get(i));
    	}
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc String[] ary = new String[n]; ary new String[n] n List<String> ans = new ArrayList<String>(); ans new ArrayList<String>() for(int i = 0; i < n; i++){
    		String s = sc.next();
    		ary[i] = s;
    	} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
    		String s = sc.next();
    		ary[i] = s;
    	} {
    		String s = sc.next();
    		ary[i] = s;
    	} String s = sc.next(); s sc.next() sc.next sc ary[i] = s ary[i] ary i s sc.close() sc.close sc Arrays.sort(ary) Arrays.sort Arrays ary Set<String> set = new HashSet<String>(Arrays.asList(ary)); set new HashSet<String>(Arrays.asList(ary)) if(ary.length == set.size()){
    		for(int i = 0; i < ary.length; i++){
        		System.out.println(ary[i]);
        	}
    		return;
    	} ary.length == set.size() ary.length ary ary.length set.size() set.size set {
    		for(int i = 0; i < ary.length; i++){
        		System.out.println(ary[i]);
        	}
    		return;
    	} for(int i = 0; i < ary.length; i++){
        		System.out.println(ary[i]);
        	} int i = 0; int i = 0; i 0 i < ary.length i ary.length ary ary.length i++ i++ i {
        		System.out.println(ary[i]);
        	} {
        		System.out.println(ary[i]);
        	} System.out.println(ary[i]) System.out.println System.out System System.out ary[i] ary i return; int maxcnt = 0; maxcnt 0 int cnt = 0; cnt 0 ans.add(ary[0]) ans.add ans ary[0] ary 0 for(int i = 0; i < n-1; i++){
    		if(ary[i].equals(ary[i+1])){
    			cnt++;
    		}else{
    			cnt = 0;
    		}
    		if(maxcnt == cnt){
    			ans.add(ary[i]);
    		}else if(maxcnt < cnt){
    			maxcnt = cnt;
    			ans.clear();
    			ans.add(ary[i]);
    		}
    	} int i = 0; int i = 0; i 0 i < n-1 i n-1 n 1 i++ i++ i {
    		if(ary[i].equals(ary[i+1])){
    			cnt++;
    		}else{
    			cnt = 0;
    		}
    		if(maxcnt == cnt){
    			ans.add(ary[i]);
    		}else if(maxcnt < cnt){
    			maxcnt = cnt;
    			ans.clear();
    			ans.add(ary[i]);
    		}
    	} {
    		if(ary[i].equals(ary[i+1])){
    			cnt++;
    		}else{
    			cnt = 0;
    		}
    		if(maxcnt == cnt){
    			ans.add(ary[i]);
    		}else if(maxcnt < cnt){
    			maxcnt = cnt;
    			ans.clear();
    			ans.add(ary[i]);
    		}
    	} if(ary[i].equals(ary[i+1])){
    			cnt++;
    		}else{
    			cnt = 0;
    		} ary[i].equals(ary[i+1]) ary[i].equals ary[i] ary i ary[i+1] ary i+1 i 1 {
    			cnt++;
    		} cnt++ cnt {
    			cnt = 0;
    		} cnt = 0 cnt 0 if(maxcnt == cnt){
    			ans.add(ary[i]);
    		}else if(maxcnt < cnt){
    			maxcnt = cnt;
    			ans.clear();
    			ans.add(ary[i]);
    		} maxcnt == cnt maxcnt cnt {
    			ans.add(ary[i]);
    		} ans.add(ary[i]) ans.add ans ary[i] ary i if(maxcnt < cnt){
    			maxcnt = cnt;
    			ans.clear();
    			ans.add(ary[i]);
    		} maxcnt < cnt maxcnt cnt {
    			maxcnt = cnt;
    			ans.clear();
    			ans.add(ary[i]);
    		} maxcnt = cnt maxcnt cnt ans.clear() ans.clear ans ans.add(ary[i]) ans.add ans ary[i] ary i for(int i = 0; i < ans.size(); i++){
    		System.out.println(ans.get(i));
    	} int i = 0; int i = 0; i 0 i < ans.size() i ans.size() ans.size ans i++ i++ i {
    		System.out.println(ans.get(i));
    	} {
    		System.out.println(ans.get(i));
    	} System.out.println(ans.get(i)) System.out.println System.out System System.out ans.get(i) ans.get ans i String[] args args public class Main {

    public static void main(String[] args) throws Exception {

//    	File file = new File("test.txt");
//    	Scanner sc = new Scanner(file);
    	Scanner sc = new Scanner(System.in);
    	int n = sc.nextInt();
    	String[] ary = new String[n];
    	List<String> ans = new ArrayList<String>();
    	for(int i = 0; i < n; i++){
    		String s = sc.next();
    		ary[i] = s;
    	}
    	sc.close();
    	Arrays.sort(ary);
    	Set<String> set = new HashSet<String>(Arrays.asList(ary));
    	if(ary.length == set.size()){
    		for(int i = 0; i < ary.length; i++){
        		System.out.println(ary[i]);
        	}
    		return;
    	}
    	int maxcnt = 0;
    	int cnt = 0;
    	ans.add(ary[0]);
    	for(int i = 0; i < n-1; i++){
    		if(ary[i].equals(ary[i+1])){
    			cnt++;
    		}else{
    			cnt = 0;
    		}
    		if(maxcnt == cnt){
    			ans.add(ary[i]);
    		}else if(maxcnt < cnt){
    			maxcnt = cnt;
    			ans.clear();
    			ans.add(ary[i]);
    		}
    	}
    	for(int i = 0; i < ans.size(); i++){
    		System.out.println(ans.get(i));
    	}
    }
} public class Main {

    public static void main(String[] args) throws Exception {

//    	File file = new File("test.txt");
//    	Scanner sc = new Scanner(file);
    	Scanner sc = new Scanner(System.in);
    	int n = sc.nextInt();
    	String[] ary = new String[n];
    	List<String> ans = new ArrayList<String>();
    	for(int i = 0; i < n; i++){
    		String s = sc.next();
    		ary[i] = s;
    	}
    	sc.close();
    	Arrays.sort(ary);
    	Set<String> set = new HashSet<String>(Arrays.asList(ary));
    	if(ary.length == set.size()){
    		for(int i = 0; i < ary.length; i++){
        		System.out.println(ary[i]);
        	}
    		return;
    	}
    	int maxcnt = 0;
    	int cnt = 0;
    	ans.add(ary[0]);
    	for(int i = 0; i < n-1; i++){
    		if(ary[i].equals(ary[i+1])){
    			cnt++;
    		}else{
    			cnt = 0;
    		}
    		if(maxcnt == cnt){
    			ans.add(ary[i]);
    		}else if(maxcnt < cnt){
    			maxcnt = cnt;
    			ans.clear();
    			ans.add(ary[i]);
    		}
    	}
    	for(int i = 0; i < ans.size(); i++){
    		System.out.println(ans.get(i));
    	}
    }
} Main
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Scanner;
import java.util.Set;

public class Main {

    public static void main(String[] args) throws Exception {

//    	File file = new File("test.txt");
//    	Scanner sc = new Scanner(file);
    	Scanner sc = new Scanner(System.in);
    	int n = sc.nextInt();
    	String[] ary = new String[n];
    	List<String> ans = new ArrayList<String>();
    	for(int i = 0; i < n; i++){
    		String s = sc.next();
    		ary[i] = s;
    	}
    	sc.close();
    	Arrays.sort(ary);
    	Set<String> set = new HashSet<String>(Arrays.asList(ary));
    	if(ary.length == set.size()){
    		for(int i = 0; i < ary.length; i++){
        		System.out.println(ary[i]);
        	}
    		return;
    	}
    	int maxcnt = 0;
    	int cnt = 0;
    	ans.add(ary[0]);
    	for(int i = 0; i < n-1; i++){
    		if(ary[i].equals(ary[i+1])){
    			cnt++;
    		}else{
    			cnt = 0;
    		}
    		if(maxcnt == cnt){
    			ans.add(ary[i]);
    		}else if(maxcnt < cnt){
    			maxcnt = cnt;
    			ans.clear();
    			ans.add(ary[i]);
    		}
    	}
    	for(int i = 0; i < ans.size(); i++){
    		System.out.println(ans.get(i));
    	}
    }
}