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

public class Main {
    public static void main(String[] args) {
      Scanner sc = new Scanner(System.in);
      int n = sc.nextInt();
      HashMap<String, Integer> list = new HashMap<String, Integer>();
      int count;
      int max=0;
      for(int i=0;i<n;i++){
        String s = sc.next();
        if(list.containsKey(s)) {
          count=list.get(s)+1;
        }else{
          count=1;
        }
        max=Math.max(max,count);
        list.put(s,count); 
      }
      ArrayList<String> strlist = new ArrayList<>();
      for(String Key : list.keySet()){
        if(list.get(Key)==max){
           strlist.add(Key);
        }
      }
      Collections.sort(strlist);
      for(String i : strlist) {
            System.out.println(i);
      }
    }
} import java.util.Scanner; Scanner java.util import java.util.HashMap; HashMap java.util import java.util.Collections; Collections java.util import java.util.ArrayList; ArrayList java.util public class Main {
    public static void main(String[] args) {
      Scanner sc = new Scanner(System.in);
      int n = sc.nextInt();
      HashMap<String, Integer> list = new HashMap<String, Integer>();
      int count;
      int max=0;
      for(int i=0;i<n;i++){
        String s = sc.next();
        if(list.containsKey(s)) {
          count=list.get(s)+1;
        }else{
          count=1;
        }
        max=Math.max(max,count);
        list.put(s,count); 
      }
      ArrayList<String> strlist = new ArrayList<>();
      for(String Key : list.keySet()){
        if(list.get(Key)==max){
           strlist.add(Key);
        }
      }
      Collections.sort(strlist);
      for(String i : strlist) {
            System.out.println(i);
      }
    }
} Main public static void main(String[] args) {
      Scanner sc = new Scanner(System.in);
      int n = sc.nextInt();
      HashMap<String, Integer> list = new HashMap<String, Integer>();
      int count;
      int max=0;
      for(int i=0;i<n;i++){
        String s = sc.next();
        if(list.containsKey(s)) {
          count=list.get(s)+1;
        }else{
          count=1;
        }
        max=Math.max(max,count);
        list.put(s,count); 
      }
      ArrayList<String> strlist = new ArrayList<>();
      for(String Key : list.keySet()){
        if(list.get(Key)==max){
           strlist.add(Key);
        }
      }
      Collections.sort(strlist);
      for(String i : strlist) {
            System.out.println(i);
      }
    } main {
      Scanner sc = new Scanner(System.in);
      int n = sc.nextInt();
      HashMap<String, Integer> list = new HashMap<String, Integer>();
      int count;
      int max=0;
      for(int i=0;i<n;i++){
        String s = sc.next();
        if(list.containsKey(s)) {
          count=list.get(s)+1;
        }else{
          count=1;
        }
        max=Math.max(max,count);
        list.put(s,count); 
      }
      ArrayList<String> strlist = new ArrayList<>();
      for(String Key : list.keySet()){
        if(list.get(Key)==max){
           strlist.add(Key);
        }
      }
      Collections.sort(strlist);
      for(String i : strlist) {
            System.out.println(i);
      }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc HashMap<String, Integer> list = new HashMap<String, Integer>(); list new HashMap<String, Integer>() int count; count int max=0; max 0 for(int i=0;i<n;i++){
        String s = sc.next();
        if(list.containsKey(s)) {
          count=list.get(s)+1;
        }else{
          count=1;
        }
        max=Math.max(max,count);
        list.put(s,count); 
      } int i=0; int i=0; i 0 i<n i n i++ i++ i {
        String s = sc.next();
        if(list.containsKey(s)) {
          count=list.get(s)+1;
        }else{
          count=1;
        }
        max=Math.max(max,count);
        list.put(s,count); 
      } {
        String s = sc.next();
        if(list.containsKey(s)) {
          count=list.get(s)+1;
        }else{
          count=1;
        }
        max=Math.max(max,count);
        list.put(s,count); 
      } String s = sc.next(); s sc.next() sc.next sc if(list.containsKey(s)) {
          count=list.get(s)+1;
        }else{
          count=1;
        } list.containsKey(s) list.containsKey list s {
          count=list.get(s)+1;
        } count=list.get(s)+1 count list.get(s)+1 list.get(s) list.get list s 1 {
          count=1;
        } count=1 count 1 max=Math.max(max,count) max Math.max(max,count) Math.max Math max count list.put(s,count) list.put list s count ArrayList<String> strlist = new ArrayList<>(); strlist new ArrayList<>() for(String Key : list.keySet()){
        if(list.get(Key)==max){
           strlist.add(Key);
        }
      } String Key list.keySet() list.keySet list {
        if(list.get(Key)==max){
           strlist.add(Key);
        }
      } {
        if(list.get(Key)==max){
           strlist.add(Key);
        }
      } if(list.get(Key)==max){
           strlist.add(Key);
        } list.get(Key)==max list.get(Key) list.get list Key max {
           strlist.add(Key);
        } strlist.add(Key) strlist.add strlist Key Collections.sort(strlist) Collections.sort Collections strlist for(String i : strlist) {
            System.out.println(i);
      } String i strlist {
            System.out.println(i);
      } {
            System.out.println(i);
      } System.out.println(i) System.out.println System.out System System.out i String[] args args public class Main {
    public static void main(String[] args) {
      Scanner sc = new Scanner(System.in);
      int n = sc.nextInt();
      HashMap<String, Integer> list = new HashMap<String, Integer>();
      int count;
      int max=0;
      for(int i=0;i<n;i++){
        String s = sc.next();
        if(list.containsKey(s)) {
          count=list.get(s)+1;
        }else{
          count=1;
        }
        max=Math.max(max,count);
        list.put(s,count); 
      }
      ArrayList<String> strlist = new ArrayList<>();
      for(String Key : list.keySet()){
        if(list.get(Key)==max){
           strlist.add(Key);
        }
      }
      Collections.sort(strlist);
      for(String i : strlist) {
            System.out.println(i);
      }
    }
} public class Main {
    public static void main(String[] args) {
      Scanner sc = new Scanner(System.in);
      int n = sc.nextInt();
      HashMap<String, Integer> list = new HashMap<String, Integer>();
      int count;
      int max=0;
      for(int i=0;i<n;i++){
        String s = sc.next();
        if(list.containsKey(s)) {
          count=list.get(s)+1;
        }else{
          count=1;
        }
        max=Math.max(max,count);
        list.put(s,count); 
      }
      ArrayList<String> strlist = new ArrayList<>();
      for(String Key : list.keySet()){
        if(list.get(Key)==max){
           strlist.add(Key);
        }
      }
      Collections.sort(strlist);
      for(String i : strlist) {
            System.out.println(i);
      }
    }
} Main
import java.util.Scanner;
import java.util.HashMap;
import java.util.Collections;
import java.util.ArrayList;

public class Main {
    public static void main(String[] args) {
      Scanner sc = new Scanner(System.in);
      int n = sc.nextInt();
      HashMap<String, Integer> list = new HashMap<String, Integer>();
      int count;
      int max=0;
      for(int i=0;i<n;i++){
        String s = sc.next();
        if(list.containsKey(s)) {
          count=list.get(s)+1;
        }else{
          count=1;
        }
        max=Math.max(max,count);
        list.put(s,count); 
      }
      ArrayList<String> strlist = new ArrayList<>();
      for(String Key : list.keySet()){
        if(list.get(Key)==max){
           strlist.add(Key);
        }
      }
      Collections.sort(strlist);
      for(String i : strlist) {
            System.out.println(i);
      }
    }
}
