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


public class Main{
  public static void main(String[] args){
	Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int  max = 1;
    HashMap<String, Integer> tm = new HashMap<String,Integer>();
    List<String>keyList =new ArrayList<String>();
     
	for(int i =0; i<N; i++){
      String s = sc.next();
        if(tm.containsKey(s) == true){
           int number = tm.get(s) + 1;  //該当キーの値を１増やす準備
           tm.replace(s, number);
           if(max < number) max = number;
        }else{
           tm.put(s, 1);
           keyList.add(s);
        }
    }
    
    Collections.sort(keyList);
    
    for(int i=0; i<keyList.size(); i++){
      String s = keyList.get(i);
      int number = tm.get(s);
      if(number == max)
        System.out.println(s);
    }
    
  }
} import java.util.Scanner; Scanner java.util import java.util.HashMap; HashMap java.util import java.util.List; List java.util import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections java.util public class Main{
  public static void main(String[] args){
	Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int  max = 1;
    HashMap<String, Integer> tm = new HashMap<String,Integer>();
    List<String>keyList =new ArrayList<String>();
     
	for(int i =0; i<N; i++){
      String s = sc.next();
        if(tm.containsKey(s) == true){
           int number = tm.get(s) + 1;  //該当キーの値を１増やす準備
           tm.replace(s, number);
           if(max < number) max = number;
        }else{
           tm.put(s, 1);
           keyList.add(s);
        }
    }
    
    Collections.sort(keyList);
    
    for(int i=0; i<keyList.size(); i++){
      String s = keyList.get(i);
      int number = tm.get(s);
      if(number == max)
        System.out.println(s);
    }
    
  }
} Main public static void main(String[] args){
	Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int  max = 1;
    HashMap<String, Integer> tm = new HashMap<String,Integer>();
    List<String>keyList =new ArrayList<String>();
     
	for(int i =0; i<N; i++){
      String s = sc.next();
        if(tm.containsKey(s) == true){
           int number = tm.get(s) + 1;  //該当キーの値を１増やす準備
           tm.replace(s, number);
           if(max < number) max = number;
        }else{
           tm.put(s, 1);
           keyList.add(s);
        }
    }
    
    Collections.sort(keyList);
    
    for(int i=0; i<keyList.size(); i++){
      String s = keyList.get(i);
      int number = tm.get(s);
      if(number == max)
        System.out.println(s);
    }
    
  } main {
	Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int  max = 1;
    HashMap<String, Integer> tm = new HashMap<String,Integer>();
    List<String>keyList =new ArrayList<String>();
     
	for(int i =0; i<N; i++){
      String s = sc.next();
        if(tm.containsKey(s) == true){
           int number = tm.get(s) + 1;  //該当キーの値を１増やす準備
           tm.replace(s, number);
           if(max < number) max = number;
        }else{
           tm.put(s, 1);
           keyList.add(s);
        }
    }
    
    Collections.sort(keyList);
    
    for(int i=0; i<keyList.size(); i++){
      String s = keyList.get(i);
      int number = tm.get(s);
      if(number == max)
        System.out.println(s);
    }
    
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int  max = 1; max 1 HashMap<String, Integer> tm = new HashMap<String,Integer>(); tm new HashMap<String,Integer>() List<String>keyList =new ArrayList<String>(); keyList new ArrayList<String>() for(int i =0; i<N; i++){
      String s = sc.next();
        if(tm.containsKey(s) == true){
           int number = tm.get(s) + 1;  //該当キーの値を１増やす準備
           tm.replace(s, number);
           if(max < number) max = number;
        }else{
           tm.put(s, 1);
           keyList.add(s);
        }
    } int i =0; int i =0; i 0 i<N i N i++ i++ i {
      String s = sc.next();
        if(tm.containsKey(s) == true){
           int number = tm.get(s) + 1;  //該当キーの値を１増やす準備
           tm.replace(s, number);
           if(max < number) max = number;
        }else{
           tm.put(s, 1);
           keyList.add(s);
        }
    } {
      String s = sc.next();
        if(tm.containsKey(s) == true){
           int number = tm.get(s) + 1;  //該当キーの値を１増やす準備
           tm.replace(s, number);
           if(max < number) max = number;
        }else{
           tm.put(s, 1);
           keyList.add(s);
        }
    } String s = sc.next(); s sc.next() sc.next sc if(tm.containsKey(s) == true){
           int number = tm.get(s) + 1;  //該当キーの値を１増やす準備
           tm.replace(s, number);
           if(max < number) max = number;
        }else{
           tm.put(s, 1);
           keyList.add(s);
        } tm.containsKey(s) == true tm.containsKey(s) tm.containsKey tm s true {
           int number = tm.get(s) + 1;  //該当キーの値を１増やす準備
           tm.replace(s, number);
           if(max < number) max = number;
        } int number = tm.get(s) + 1; number tm.get(s) + 1 tm.get(s) tm.get tm s 1 tm.replace(s, number) tm.replace tm s number if(max < number) max = number; max < number max number max = number max number {
           tm.put(s, 1);
           keyList.add(s);
        } tm.put(s, 1) tm.put tm s 1 keyList.add(s) keyList.add keyList s Collections.sort(keyList) Collections.sort Collections keyList for(int i=0; i<keyList.size(); i++){
      String s = keyList.get(i);
      int number = tm.get(s);
      if(number == max)
        System.out.println(s);
    } int i=0; int i=0; i 0 i<keyList.size() i keyList.size() keyList.size keyList i++ i++ i {
      String s = keyList.get(i);
      int number = tm.get(s);
      if(number == max)
        System.out.println(s);
    } {
      String s = keyList.get(i);
      int number = tm.get(s);
      if(number == max)
        System.out.println(s);
    } String s = keyList.get(i); s keyList.get(i) keyList.get keyList i int number = tm.get(s); number tm.get(s) tm.get tm s if(number == max)
        System.out.println(s); number == max number max 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);
    int N = sc.nextInt();
    int  max = 1;
    HashMap<String, Integer> tm = new HashMap<String,Integer>();
    List<String>keyList =new ArrayList<String>();
     
	for(int i =0; i<N; i++){
      String s = sc.next();
        if(tm.containsKey(s) == true){
           int number = tm.get(s) + 1;  //該当キーの値を１増やす準備
           tm.replace(s, number);
           if(max < number) max = number;
        }else{
           tm.put(s, 1);
           keyList.add(s);
        }
    }
    
    Collections.sort(keyList);
    
    for(int i=0; i<keyList.size(); i++){
      String s = keyList.get(i);
      int number = tm.get(s);
      if(number == max)
        System.out.println(s);
    }
    
  }
} public class Main{
  public static void main(String[] args){
	Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int  max = 1;
    HashMap<String, Integer> tm = new HashMap<String,Integer>();
    List<String>keyList =new ArrayList<String>();
     
	for(int i =0; i<N; i++){
      String s = sc.next();
        if(tm.containsKey(s) == true){
           int number = tm.get(s) + 1;  //該当キーの値を１増やす準備
           tm.replace(s, number);
           if(max < number) max = number;
        }else{
           tm.put(s, 1);
           keyList.add(s);
        }
    }
    
    Collections.sort(keyList);
    
    for(int i=0; i<keyList.size(); i++){
      String s = keyList.get(i);
      int number = tm.get(s);
      if(number == max)
        System.out.println(s);
    }
    
  }
} Main
import java.util.Scanner;
import java.util.HashMap;
import java.util.List;
import java.util.ArrayList;
import java.util.Collections;


public class Main{
  public static void main(String[] args){
	Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int  max = 1;
    HashMap<String, Integer> tm = new HashMap<String,Integer>();
    List<String>keyList =new ArrayList<String>();
     
	for(int i =0; i<N; i++){
      String s = sc.next();
        if(tm.containsKey(s) == true){
           int number = tm.get(s) + 1;  //該当キーの値を１増やす準備
           tm.replace(s, number);
           if(max < number) max = number;
        }else{
           tm.put(s, 1);
           keyList.add(s);
        }
    }
    
    Collections.sort(keyList);
    
    for(int i=0; i<keyList.size(); i++){
      String s = keyList.get(i);
      int number = tm.get(s);
      if(number == max)
        System.out.println(s);
    }
    
  }
}
