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

class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
	int n =  sc.nextInt();
	String[] s = new String[n];
	int max = 0;
	int count=0;
	Map<String,Integer> Hash = new HashMap<>();
	ArrayList<String> list = new ArrayList<String>();
	for(int i=0;i<n;i++) {
		s[i] = sc.next();
	}

	 for(String a:s) {
         if(Hash.containsKey(a)) {
        	 count = Hash.get(a)+1;
        	 Hash.replace(a, count);
         }
         else {
        	 Hash.put(a, 1);
         }
	 }

	 for(String b:Hash.keySet()) {
		 max = Math.max(Hash.get(b),max);
	 }

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

	 for(String a:s) {
         if(Hash.containsKey(a)) {
        	 count = Hash.get(a)+1;
        	 Hash.replace(a, count);
         }
         else {
        	 Hash.put(a, 1);
         }
	 }

	 for(String b:Hash.keySet()) {
		 max = Math.max(Hash.get(b),max);
	 }

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

	 for(String a:s) {
         if(Hash.containsKey(a)) {
        	 count = Hash.get(a)+1;
        	 Hash.replace(a, count);
         }
         else {
        	 Hash.put(a, 1);
         }
	 }

	 for(String b:Hash.keySet()) {
		 max = Math.max(Hash.get(b),max);
	 }

	 for(String c:Hash.keySet()) {
		 if(Hash.get(c)==max) {
			 list.add(c);
		 }
	 }
	 Collections.sort(list);
	 for(int i=0;i<list.size();i++) {
	 System.out.println(list.get(i));
	 }
  } main {
    Scanner sc = new Scanner(System.in);
	int n =  sc.nextInt();
	String[] s = new String[n];
	int max = 0;
	int count=0;
	Map<String,Integer> Hash = new HashMap<>();
	ArrayList<String> list = new ArrayList<String>();
	for(int i=0;i<n;i++) {
		s[i] = sc.next();
	}

	 for(String a:s) {
         if(Hash.containsKey(a)) {
        	 count = Hash.get(a)+1;
        	 Hash.replace(a, count);
         }
         else {
        	 Hash.put(a, 1);
         }
	 }

	 for(String b:Hash.keySet()) {
		 max = Math.max(Hash.get(b),max);
	 }

	 for(String c:Hash.keySet()) {
		 if(Hash.get(c)==max) {
			 list.add(c);
		 }
	 }
	 Collections.sort(list);
	 for(int i=0;i<list.size();i++) {
	 System.out.println(list.get(i));
	 }
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n =  sc.nextInt(); n sc.nextInt() sc.nextInt sc String[] s = new String[n]; s new String[n] n int max = 0; max 0 int count=0; count 0 Map<String,Integer> Hash = new HashMap<>(); Hash new HashMap<>() ArrayList<String> list = new ArrayList<String>(); list new ArrayList<String>() 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 for(String a:s) {
         if(Hash.containsKey(a)) {
        	 count = Hash.get(a)+1;
        	 Hash.replace(a, count);
         }
         else {
        	 Hash.put(a, 1);
         }
	 } String a s {
         if(Hash.containsKey(a)) {
        	 count = Hash.get(a)+1;
        	 Hash.replace(a, count);
         }
         else {
        	 Hash.put(a, 1);
         }
	 } {
         if(Hash.containsKey(a)) {
        	 count = Hash.get(a)+1;
        	 Hash.replace(a, count);
         }
         else {
        	 Hash.put(a, 1);
         }
	 } if(Hash.containsKey(a)) {
        	 count = Hash.get(a)+1;
        	 Hash.replace(a, count);
         }
         else {
        	 Hash.put(a, 1);
         } Hash.containsKey(a) Hash.containsKey Hash a {
        	 count = Hash.get(a)+1;
        	 Hash.replace(a, count);
         } count = Hash.get(a)+1 count Hash.get(a)+1 Hash.get(a) Hash.get Hash a 1 Hash.replace(a, count) Hash.replace Hash a count {
        	 Hash.put(a, 1);
         } Hash.put(a, 1) Hash.put Hash a 1 for(String b:Hash.keySet()) {
		 max = Math.max(Hash.get(b),max);
	 } String b Hash.keySet() Hash.keySet Hash {
		 max = Math.max(Hash.get(b),max);
	 } {
		 max = Math.max(Hash.get(b),max);
	 } max = Math.max(Hash.get(b),max) max Math.max(Hash.get(b),max) Math.max Math Hash.get(b) Hash.get Hash b max for(String c:Hash.keySet()) {
		 if(Hash.get(c)==max) {
			 list.add(c);
		 }
	 } String c Hash.keySet() Hash.keySet Hash {
		 if(Hash.get(c)==max) {
			 list.add(c);
		 }
	 } {
		 if(Hash.get(c)==max) {
			 list.add(c);
		 }
	 } if(Hash.get(c)==max) {
			 list.add(c);
		 } Hash.get(c)==max Hash.get(c) Hash.get Hash c max {
			 list.add(c);
		 } list.add(c) list.add list c Collections.sort(list) Collections.sort Collections list for(int i=0;i<list.size();i++) {
	 System.out.println(list.get(i));
	 } int i=0; int i=0; i 0 i<list.size() i list.size() list.size list i++ i++ i {
	 System.out.println(list.get(i));
	 } {
	 System.out.println(list.get(i));
	 } System.out.println(list.get(i)) System.out.println System.out System System.out list.get(i) list.get list i String[] args args
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
	int n =  sc.nextInt();
	String[] s = new String[n];
	int max = 0;
	int count=0;
	Map<String,Integer> Hash = new HashMap<>();
	ArrayList<String> list = new ArrayList<String>();
	for(int i=0;i<n;i++) {
		s[i] = sc.next();
	}

	 for(String a:s) {
         if(Hash.containsKey(a)) {
        	 count = Hash.get(a)+1;
        	 Hash.replace(a, count);
         }
         else {
        	 Hash.put(a, 1);
         }
	 }

	 for(String b:Hash.keySet()) {
		 max = Math.max(Hash.get(b),max);
	 }

	 for(String c:Hash.keySet()) {
		 if(Hash.get(c)==max) {
			 list.add(c);
		 }
	 }
	 Collections.sort(list);
	 for(int i=0;i<list.size();i++) {
	 System.out.println(list.get(i));
	 }
  }
}