import java.util.*;
public class Main {
public static void main(String[] args){
	Scanner sc = new Scanner(System.in);
	int N;
  	N = sc.nextInt();
  	if(N==0) System.exit(0);

  	String[] s = new String[N];
  	int[] t = new int[N];
  
  	for (int i=0;i<N;i++){
		s[i] = sc.next();
	}
  	Arrays.sort(s);
  	int tmp = 1;
  	for(int k=0;k<N-1;k++){
      	if(s[k].compareTo(s[k+1])==0){
          tmp++;
          if(k==N-2) t[k+1] =tmp;
        }else{
          t[k] = tmp;
          tmp=1;
          if(k==N-2) t[k+1] =tmp;
        }
      
    } 	
  //	System.out.println("s: " + Arrays.toString(s));
  //	System.out.println("t: " + Arrays.toString(t));
	int max=0;
  	for(int l=0;l<N;l++){
      	if(max < t[l]) max = t[l];
    }
  	
  	for(int p=0;p<N;p++){
      	if(t[p]==max){
          System.out.println(s[p]);
        }
    }
  
	}
} import java.util.*; util.* java public class Main {
public static void main(String[] args){
	Scanner sc = new Scanner(System.in);
	int N;
  	N = sc.nextInt();
  	if(N==0) System.exit(0);

  	String[] s = new String[N];
  	int[] t = new int[N];
  
  	for (int i=0;i<N;i++){
		s[i] = sc.next();
	}
  	Arrays.sort(s);
  	int tmp = 1;
  	for(int k=0;k<N-1;k++){
      	if(s[k].compareTo(s[k+1])==0){
          tmp++;
          if(k==N-2) t[k+1] =tmp;
        }else{
          t[k] = tmp;
          tmp=1;
          if(k==N-2) t[k+1] =tmp;
        }
      
    } 	
  //	System.out.println("s: " + Arrays.toString(s));
  //	System.out.println("t: " + Arrays.toString(t));
	int max=0;
  	for(int l=0;l<N;l++){
      	if(max < t[l]) max = t[l];
    }
  	
  	for(int p=0;p<N;p++){
      	if(t[p]==max){
          System.out.println(s[p]);
        }
    }
  
	}
} Main public static void main(String[] args){
	Scanner sc = new Scanner(System.in);
	int N;
  	N = sc.nextInt();
  	if(N==0) System.exit(0);

  	String[] s = new String[N];
  	int[] t = new int[N];
  
  	for (int i=0;i<N;i++){
		s[i] = sc.next();
	}
  	Arrays.sort(s);
  	int tmp = 1;
  	for(int k=0;k<N-1;k++){
      	if(s[k].compareTo(s[k+1])==0){
          tmp++;
          if(k==N-2) t[k+1] =tmp;
        }else{
          t[k] = tmp;
          tmp=1;
          if(k==N-2) t[k+1] =tmp;
        }
      
    } 	
  //	System.out.println("s: " + Arrays.toString(s));
  //	System.out.println("t: " + Arrays.toString(t));
	int max=0;
  	for(int l=0;l<N;l++){
      	if(max < t[l]) max = t[l];
    }
  	
  	for(int p=0;p<N;p++){
      	if(t[p]==max){
          System.out.println(s[p]);
        }
    }
  
	} main {
	Scanner sc = new Scanner(System.in);
	int N;
  	N = sc.nextInt();
  	if(N==0) System.exit(0);

  	String[] s = new String[N];
  	int[] t = new int[N];
  
  	for (int i=0;i<N;i++){
		s[i] = sc.next();
	}
  	Arrays.sort(s);
  	int tmp = 1;
  	for(int k=0;k<N-1;k++){
      	if(s[k].compareTo(s[k+1])==0){
          tmp++;
          if(k==N-2) t[k+1] =tmp;
        }else{
          t[k] = tmp;
          tmp=1;
          if(k==N-2) t[k+1] =tmp;
        }
      
    } 	
  //	System.out.println("s: " + Arrays.toString(s));
  //	System.out.println("t: " + Arrays.toString(t));
	int max=0;
  	for(int l=0;l<N;l++){
      	if(max < t[l]) max = t[l];
    }
  	
  	for(int p=0;p<N;p++){
      	if(t[p]==max){
          System.out.println(s[p]);
        }
    }
  
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N; N N = sc.nextInt() N sc.nextInt() sc.nextInt sc if(N==0) System.exit(0); N==0 N 0 System.exit(0) System.exit System 0 String[] s = new String[N]; s new String[N] N int[] t = new int[N]; t new int[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 Arrays.sort(s) Arrays.sort Arrays s int tmp = 1; tmp 1 for(int k=0;k<N-1;k++){
      	if(s[k].compareTo(s[k+1])==0){
          tmp++;
          if(k==N-2) t[k+1] =tmp;
        }else{
          t[k] = tmp;
          tmp=1;
          if(k==N-2) t[k+1] =tmp;
        }
      
    } int k=0; int k=0; k 0 k<N-1 k N-1 N 1 k++ k++ k {
      	if(s[k].compareTo(s[k+1])==0){
          tmp++;
          if(k==N-2) t[k+1] =tmp;
        }else{
          t[k] = tmp;
          tmp=1;
          if(k==N-2) t[k+1] =tmp;
        }
      
    } {
      	if(s[k].compareTo(s[k+1])==0){
          tmp++;
          if(k==N-2) t[k+1] =tmp;
        }else{
          t[k] = tmp;
          tmp=1;
          if(k==N-2) t[k+1] =tmp;
        }
      
    } if(s[k].compareTo(s[k+1])==0){
          tmp++;
          if(k==N-2) t[k+1] =tmp;
        }else{
          t[k] = tmp;
          tmp=1;
          if(k==N-2) t[k+1] =tmp;
        } s[k].compareTo(s[k+1])==0 s[k].compareTo(s[k+1]) s[k].compareTo s[k] s k s[k+1] s k+1 k 1 0 {
          tmp++;
          if(k==N-2) t[k+1] =tmp;
        } tmp++ tmp if(k==N-2) t[k+1] =tmp; k==N-2 k N-2 N 2 t[k+1] =tmp t[k+1] t k+1 k 1 tmp {
          t[k] = tmp;
          tmp=1;
          if(k==N-2) t[k+1] =tmp;
        } t[k] = tmp t[k] t k tmp tmp=1 tmp 1 if(k==N-2) t[k+1] =tmp; k==N-2 k N-2 N 2 t[k+1] =tmp t[k+1] t k+1 k 1 tmp int max=0; max 0 for(int l=0;l<N;l++){
      	if(max < t[l]) max = t[l];
    } int l=0; int l=0; l 0 l<N l N l++ l++ l {
      	if(max < t[l]) max = t[l];
    } {
      	if(max < t[l]) max = t[l];
    } if(max < t[l]) max = t[l]; max < t[l] max t[l] t l max = t[l] max t[l] t l for(int p=0;p<N;p++){
      	if(t[p]==max){
          System.out.println(s[p]);
        }
    } int p=0; int p=0; p 0 p<N p N p++ p++ p {
      	if(t[p]==max){
          System.out.println(s[p]);
        }
    } {
      	if(t[p]==max){
          System.out.println(s[p]);
        }
    } if(t[p]==max){
          System.out.println(s[p]);
        } t[p]==max t[p] t p max {
          System.out.println(s[p]);
        } System.out.println(s[p]) System.out.println System.out System System.out s[p] s p String[] args args public class Main {
public static void main(String[] args){
	Scanner sc = new Scanner(System.in);
	int N;
  	N = sc.nextInt();
  	if(N==0) System.exit(0);

  	String[] s = new String[N];
  	int[] t = new int[N];
  
  	for (int i=0;i<N;i++){
		s[i] = sc.next();
	}
  	Arrays.sort(s);
  	int tmp = 1;
  	for(int k=0;k<N-1;k++){
      	if(s[k].compareTo(s[k+1])==0){
          tmp++;
          if(k==N-2) t[k+1] =tmp;
        }else{
          t[k] = tmp;
          tmp=1;
          if(k==N-2) t[k+1] =tmp;
        }
      
    } 	
  //	System.out.println("s: " + Arrays.toString(s));
  //	System.out.println("t: " + Arrays.toString(t));
	int max=0;
  	for(int l=0;l<N;l++){
      	if(max < t[l]) max = t[l];
    }
  	
  	for(int p=0;p<N;p++){
      	if(t[p]==max){
          System.out.println(s[p]);
        }
    }
  
	}
} public class Main {
public static void main(String[] args){
	Scanner sc = new Scanner(System.in);
	int N;
  	N = sc.nextInt();
  	if(N==0) System.exit(0);

  	String[] s = new String[N];
  	int[] t = new int[N];
  
  	for (int i=0;i<N;i++){
		s[i] = sc.next();
	}
  	Arrays.sort(s);
  	int tmp = 1;
  	for(int k=0;k<N-1;k++){
      	if(s[k].compareTo(s[k+1])==0){
          tmp++;
          if(k==N-2) t[k+1] =tmp;
        }else{
          t[k] = tmp;
          tmp=1;
          if(k==N-2) t[k+1] =tmp;
        }
      
    } 	
  //	System.out.println("s: " + Arrays.toString(s));
  //	System.out.println("t: " + Arrays.toString(t));
	int max=0;
  	for(int l=0;l<N;l++){
      	if(max < t[l]) max = t[l];
    }
  	
  	for(int p=0;p<N;p++){
      	if(t[p]==max){
          System.out.println(s[p]);
        }
    }
  
	}
} Main
import java.util.*;
public class Main {
public static void main(String[] args){
	Scanner sc = new Scanner(System.in);
	int N;
  	N = sc.nextInt();
  	if(N==0) System.exit(0);

  	String[] s = new String[N];
  	int[] t = new int[N];
  
  	for (int i=0;i<N;i++){
		s[i] = sc.next();
	}
  	Arrays.sort(s);
  	int tmp = 1;
  	for(int k=0;k<N-1;k++){
      	if(s[k].compareTo(s[k+1])==0){
          tmp++;
          if(k==N-2) t[k+1] =tmp;
        }else{
          t[k] = tmp;
          tmp=1;
          if(k==N-2) t[k+1] =tmp;
        }
      
    } 	
  //	System.out.println("s: " + Arrays.toString(s));
  //	System.out.println("t: " + Arrays.toString(t));
	int max=0;
  	for(int l=0;l<N;l++){
      	if(max < t[l]) max = t[l];
    }
  	
  	for(int p=0;p<N;p++){
      	if(t[p]==max){
          System.out.println(s[p]);
        }
    }
  
	}
}