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

public class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    ArrayList<String> list = new ArrayList<>();
    ArrayList<String> anslist = new ArrayList<>();    
    int n = sc.nextInt();
    String[] a = new String[n];
    int max = 1;
    int count = 1;
    for(int i = 0;i < n;i++){
      a[i] = sc.next();
      list.add(a[i]);
    }
    Collections.sort(list);
    for(int j = 1;j < n;j++){
      if(list.get(j - 1).equals(list.get(j))){
        count++;
        if(j == n - 1) max = Math.max(max,count);
      }else{
        max = Math.max(max,count);
        count = 1;  
      }
    }
    for(int x = 0;x < n - max + 1;x++){
      if(list.get(x + max - 1).equals(list.get(x))){
        anslist.add(list.get(x));
      }
    }
    Iterator<String> it = anslist.iterator();
    while(it.hasNext()){
      System.out.println(it.next());
    }
  }
}

/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz