import java.util.*;
import java.lang.Math;

public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
  		
      	int n = sc.nextInt();
      	long count = 0;
      	long max = 1;
      	String sstack1;
      	String sstack2;
      	boolean fst = true;
        List wList = new ArrayList<String>();
      	List aList = new ArrayList<String>();
      	Map<String,Integer> wMap = new HashMap<String,Integer>();
      
      	for(int i = 0;i < n;i++){
          wList.add(sc.next());
        }
      	Collections.sort(wList);
      	wList.add("AC祈願");
      	sstack1 = (String)wList.get(0);
      	count = 1;
      	max = 1;
      	for(int i = 1;i < wList.size();i++){
          	sstack2 = (String)wList.get(i);
        	if(sstack1.equals(sstack2)) count++;
          	else{
              if(fst){
              	max = count;
              	aList.add(sstack1);
              	count = 1;
                fst = false;
              } else if(count == max){
              	aList.add(sstack1);
                count = 1;
              } else if(count > max){
                aList.clear();
                aList.add(sstack1);
                max = count;
                count = 1;
              } else count = 1;
            }
          	sstack1 = sstack2;
          	
        }
   
      	for(int i = 0;i < aList.size();i++){
          	System.out.println(aList.get(i));
        }      	
        
	}
} import java.util.*; util.* java import java.lang.Math; Math java.lang public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
  		
      	int n = sc.nextInt();
      	long count = 0;
      	long max = 1;
      	String sstack1;
      	String sstack2;
      	boolean fst = true;
        List wList = new ArrayList<String>();
      	List aList = new ArrayList<String>();
      	Map<String,Integer> wMap = new HashMap<String,Integer>();
      
      	for(int i = 0;i < n;i++){
          wList.add(sc.next());
        }
      	Collections.sort(wList);
      	wList.add("AC祈願");
      	sstack1 = (String)wList.get(0);
      	count = 1;
      	max = 1;
      	for(int i = 1;i < wList.size();i++){
          	sstack2 = (String)wList.get(i);
        	if(sstack1.equals(sstack2)) count++;
          	else{
              if(fst){
              	max = count;
              	aList.add(sstack1);
              	count = 1;
                fst = false;
              } else if(count == max){
              	aList.add(sstack1);
                count = 1;
              } else if(count > max){
                aList.clear();
                aList.add(sstack1);
                max = count;
                count = 1;
              } else count = 1;
            }
          	sstack1 = sstack2;
          	
        }
   
      	for(int i = 0;i < aList.size();i++){
          	System.out.println(aList.get(i));
        }      	
        
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
  		
      	int n = sc.nextInt();
      	long count = 0;
      	long max = 1;
      	String sstack1;
      	String sstack2;
      	boolean fst = true;
        List wList = new ArrayList<String>();
      	List aList = new ArrayList<String>();
      	Map<String,Integer> wMap = new HashMap<String,Integer>();
      
      	for(int i = 0;i < n;i++){
          wList.add(sc.next());
        }
      	Collections.sort(wList);
      	wList.add("AC祈願");
      	sstack1 = (String)wList.get(0);
      	count = 1;
      	max = 1;
      	for(int i = 1;i < wList.size();i++){
          	sstack2 = (String)wList.get(i);
        	if(sstack1.equals(sstack2)) count++;
          	else{
              if(fst){
              	max = count;
              	aList.add(sstack1);
              	count = 1;
                fst = false;
              } else if(count == max){
              	aList.add(sstack1);
                count = 1;
              } else if(count > max){
                aList.clear();
                aList.add(sstack1);
                max = count;
                count = 1;
              } else count = 1;
            }
          	sstack1 = sstack2;
          	
        }
   
      	for(int i = 0;i < aList.size();i++){
          	System.out.println(aList.get(i));
        }      	
        
	} main {
		Scanner sc = new Scanner(System.in);
  		
      	int n = sc.nextInt();
      	long count = 0;
      	long max = 1;
      	String sstack1;
      	String sstack2;
      	boolean fst = true;
        List wList = new ArrayList<String>();
      	List aList = new ArrayList<String>();
      	Map<String,Integer> wMap = new HashMap<String,Integer>();
      
      	for(int i = 0;i < n;i++){
          wList.add(sc.next());
        }
      	Collections.sort(wList);
      	wList.add("AC祈願");
      	sstack1 = (String)wList.get(0);
      	count = 1;
      	max = 1;
      	for(int i = 1;i < wList.size();i++){
          	sstack2 = (String)wList.get(i);
        	if(sstack1.equals(sstack2)) count++;
          	else{
              if(fst){
              	max = count;
              	aList.add(sstack1);
              	count = 1;
                fst = false;
              } else if(count == max){
              	aList.add(sstack1);
                count = 1;
              } else if(count > max){
                aList.clear();
                aList.add(sstack1);
                max = count;
                count = 1;
              } else count = 1;
            }
          	sstack1 = sstack2;
          	
        }
   
      	for(int i = 0;i < aList.size();i++){
          	System.out.println(aList.get(i));
        }      	
        
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc long count = 0; count 0 long max = 1; max 1 String sstack1; sstack1 String sstack2; sstack2 boolean fst = true; fst true List wList = new ArrayList<String>(); wList new ArrayList<String>() List aList = new ArrayList<String>(); aList new ArrayList<String>() Map<String,Integer> wMap = new HashMap<String,Integer>(); wMap new HashMap<String,Integer>() for(int i = 0;i < n;i++){
          wList.add(sc.next());
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
          wList.add(sc.next());
        } {
          wList.add(sc.next());
        } wList.add(sc.next()) wList.add wList sc.next() sc.next sc Collections.sort(wList) Collections.sort Collections wList wList.add("AC祈願") wList.add wList "AC祈願" sstack1 = (String)wList.get(0) sstack1 (String)wList.get(0) wList.get wList 0 count = 1 count 1 max = 1 max 1 for(int i = 1;i < wList.size();i++){
          	sstack2 = (String)wList.get(i);
        	if(sstack1.equals(sstack2)) count++;
          	else{
              if(fst){
              	max = count;
              	aList.add(sstack1);
              	count = 1;
                fst = false;
              } else if(count == max){
              	aList.add(sstack1);
                count = 1;
              } else if(count > max){
                aList.clear();
                aList.add(sstack1);
                max = count;
                count = 1;
              } else count = 1;
            }
          	sstack1 = sstack2;
          	
        } int i = 1; int i = 1; i 1 i < wList.size() i wList.size() wList.size wList i++ i++ i {
          	sstack2 = (String)wList.get(i);
        	if(sstack1.equals(sstack2)) count++;
          	else{
              if(fst){
              	max = count;
              	aList.add(sstack1);
              	count = 1;
                fst = false;
              } else if(count == max){
              	aList.add(sstack1);
                count = 1;
              } else if(count > max){
                aList.clear();
                aList.add(sstack1);
                max = count;
                count = 1;
              } else count = 1;
            }
          	sstack1 = sstack2;
          	
        } {
          	sstack2 = (String)wList.get(i);
        	if(sstack1.equals(sstack2)) count++;
          	else{
              if(fst){
              	max = count;
              	aList.add(sstack1);
              	count = 1;
                fst = false;
              } else if(count == max){
              	aList.add(sstack1);
                count = 1;
              } else if(count > max){
                aList.clear();
                aList.add(sstack1);
                max = count;
                count = 1;
              } else count = 1;
            }
          	sstack1 = sstack2;
          	
        } sstack2 = (String)wList.get(i) sstack2 (String)wList.get(i) wList.get wList i if(sstack1.equals(sstack2)) count++;
          	else{
              if(fst){
              	max = count;
              	aList.add(sstack1);
              	count = 1;
                fst = false;
              } else if(count == max){
              	aList.add(sstack1);
                count = 1;
              } else if(count > max){
                aList.clear();
                aList.add(sstack1);
                max = count;
                count = 1;
              } else count = 1;
            } sstack1.equals(sstack2) sstack1.equals sstack1 sstack2 count++ count {
              if(fst){
              	max = count;
              	aList.add(sstack1);
              	count = 1;
                fst = false;
              } else if(count == max){
              	aList.add(sstack1);
                count = 1;
              } else if(count > max){
                aList.clear();
                aList.add(sstack1);
                max = count;
                count = 1;
              } else count = 1;
            } if(fst){
              	max = count;
              	aList.add(sstack1);
              	count = 1;
                fst = false;
              } else if(count == max){
              	aList.add(sstack1);
                count = 1;
              } else if(count > max){
                aList.clear();
                aList.add(sstack1);
                max = count;
                count = 1;
              } else count = 1; fst {
              	max = count;
              	aList.add(sstack1);
              	count = 1;
                fst = false;
              } max = count max count aList.add(sstack1) aList.add aList sstack1 count = 1 count 1 fst = false fst false if(count == max){
              	aList.add(sstack1);
                count = 1;
              } else if(count > max){
                aList.clear();
                aList.add(sstack1);
                max = count;
                count = 1;
              } else count = 1; count == max count max {
              	aList.add(sstack1);
                count = 1;
              } aList.add(sstack1) aList.add aList sstack1 count = 1 count 1 if(count > max){
                aList.clear();
                aList.add(sstack1);
                max = count;
                count = 1;
              } else count = 1; count > max count max {
                aList.clear();
                aList.add(sstack1);
                max = count;
                count = 1;
              } aList.clear() aList.clear aList aList.add(sstack1) aList.add aList sstack1 max = count max count count = 1 count 1 count = 1 count 1 sstack1 = sstack2 sstack1 sstack2 for(int i = 0;i < aList.size();i++){
          	System.out.println(aList.get(i));
        } int i = 0; int i = 0; i 0 i < aList.size() i aList.size() aList.size aList i++ i++ i {
          	System.out.println(aList.get(i));
        } {
          	System.out.println(aList.get(i));
        } System.out.println(aList.get(i)) System.out.println System.out System System.out aList.get(i) aList.get aList i String[] args args public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
  		
      	int n = sc.nextInt();
      	long count = 0;
      	long max = 1;
      	String sstack1;
      	String sstack2;
      	boolean fst = true;
        List wList = new ArrayList<String>();
      	List aList = new ArrayList<String>();
      	Map<String,Integer> wMap = new HashMap<String,Integer>();
      
      	for(int i = 0;i < n;i++){
          wList.add(sc.next());
        }
      	Collections.sort(wList);
      	wList.add("AC祈願");
      	sstack1 = (String)wList.get(0);
      	count = 1;
      	max = 1;
      	for(int i = 1;i < wList.size();i++){
          	sstack2 = (String)wList.get(i);
        	if(sstack1.equals(sstack2)) count++;
          	else{
              if(fst){
              	max = count;
              	aList.add(sstack1);
              	count = 1;
                fst = false;
              } else if(count == max){
              	aList.add(sstack1);
                count = 1;
              } else if(count > max){
                aList.clear();
                aList.add(sstack1);
                max = count;
                count = 1;
              } else count = 1;
            }
          	sstack1 = sstack2;
          	
        }
   
      	for(int i = 0;i < aList.size();i++){
          	System.out.println(aList.get(i));
        }      	
        
	}
} public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
  		
      	int n = sc.nextInt();
      	long count = 0;
      	long max = 1;
      	String sstack1;
      	String sstack2;
      	boolean fst = true;
        List wList = new ArrayList<String>();
      	List aList = new ArrayList<String>();
      	Map<String,Integer> wMap = new HashMap<String,Integer>();
      
      	for(int i = 0;i < n;i++){
          wList.add(sc.next());
        }
      	Collections.sort(wList);
      	wList.add("AC祈願");
      	sstack1 = (String)wList.get(0);
      	count = 1;
      	max = 1;
      	for(int i = 1;i < wList.size();i++){
          	sstack2 = (String)wList.get(i);
        	if(sstack1.equals(sstack2)) count++;
          	else{
              if(fst){
              	max = count;
              	aList.add(sstack1);
              	count = 1;
                fst = false;
              } else if(count == max){
              	aList.add(sstack1);
                count = 1;
              } else if(count > max){
                aList.clear();
                aList.add(sstack1);
                max = count;
                count = 1;
              } else count = 1;
            }
          	sstack1 = sstack2;
          	
        }
   
      	for(int i = 0;i < aList.size();i++){
          	System.out.println(aList.get(i));
        }      	
        
	}
} Main
import java.util.*;
import java.lang.Math;

public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
  		
      	int n = sc.nextInt();
      	long count = 0;
      	long max = 1;
      	String sstack1;
      	String sstack2;
      	boolean fst = true;
        List wList = new ArrayList<String>();
      	List aList = new ArrayList<String>();
      	Map<String,Integer> wMap = new HashMap<String,Integer>();
      
      	for(int i = 0;i < n;i++){
          wList.add(sc.next());
        }
      	Collections.sort(wList);
      	wList.add("AC祈願");
      	sstack1 = (String)wList.get(0);
      	count = 1;
      	max = 1;
      	for(int i = 1;i < wList.size();i++){
          	sstack2 = (String)wList.get(i);
        	if(sstack1.equals(sstack2)) count++;
          	else{
              if(fst){
              	max = count;
              	aList.add(sstack1);
              	count = 1;
                fst = false;
              } else if(count == max){
              	aList.add(sstack1);
                count = 1;
              } else if(count > max){
                aList.clear();
                aList.add(sstack1);
                max = count;
                count = 1;
              } else count = 1;
            }
          	sstack1 = sstack2;
          	
        }
   
      	for(int i = 0;i < aList.size();i++){
          	System.out.println(aList.get(i));
        }      	
        
	}
}
