import java.util.*;
public class Main {
	    public static void main(String[] args){
	        Scanner sc = new Scanner(System.in);
	        int n = sc.nextInt();
	        String[] a = new String[n];
	        for (int i = 0;i<n;i++) {
	            a[i] = sc.next();
	        }
	        int max = 0;
	        Map<String, Integer> map = new HashMap<>();
	        for (String s : a) {
	            int count = map.getOrDefault(s, 0);
	            ++count;
	            map.put(s,count);
	            max = Math.max(max, count);
	        }
	        List<String> l = new ArrayList<>();
	        for (Map.Entry<String, Integer> e : map.entrySet()) {
	            if (max == e.getValue()) l.add(e.getKey());
	        }
	        Collections.sort(l);
	        for (String s : l) System.out.println(s);
	        sc.close();
	    }
} import java.util.*; util.* java public class Main {
	    public static void main(String[] args){
	        Scanner sc = new Scanner(System.in);
	        int n = sc.nextInt();
	        String[] a = new String[n];
	        for (int i = 0;i<n;i++) {
	            a[i] = sc.next();
	        }
	        int max = 0;
	        Map<String, Integer> map = new HashMap<>();
	        for (String s : a) {
	            int count = map.getOrDefault(s, 0);
	            ++count;
	            map.put(s,count);
	            max = Math.max(max, count);
	        }
	        List<String> l = new ArrayList<>();
	        for (Map.Entry<String, Integer> e : map.entrySet()) {
	            if (max == e.getValue()) l.add(e.getKey());
	        }
	        Collections.sort(l);
	        for (String s : l) System.out.println(s);
	        sc.close();
	    }
} Main public static void main(String[] args){
	        Scanner sc = new Scanner(System.in);
	        int n = sc.nextInt();
	        String[] a = new String[n];
	        for (int i = 0;i<n;i++) {
	            a[i] = sc.next();
	        }
	        int max = 0;
	        Map<String, Integer> map = new HashMap<>();
	        for (String s : a) {
	            int count = map.getOrDefault(s, 0);
	            ++count;
	            map.put(s,count);
	            max = Math.max(max, count);
	        }
	        List<String> l = new ArrayList<>();
	        for (Map.Entry<String, Integer> e : map.entrySet()) {
	            if (max == e.getValue()) l.add(e.getKey());
	        }
	        Collections.sort(l);
	        for (String s : l) System.out.println(s);
	        sc.close();
	    } main {
	        Scanner sc = new Scanner(System.in);
	        int n = sc.nextInt();
	        String[] a = new String[n];
	        for (int i = 0;i<n;i++) {
	            a[i] = sc.next();
	        }
	        int max = 0;
	        Map<String, Integer> map = new HashMap<>();
	        for (String s : a) {
	            int count = map.getOrDefault(s, 0);
	            ++count;
	            map.put(s,count);
	            max = Math.max(max, count);
	        }
	        List<String> l = new ArrayList<>();
	        for (Map.Entry<String, Integer> e : map.entrySet()) {
	            if (max == e.getValue()) l.add(e.getKey());
	        }
	        Collections.sort(l);
	        for (String s : l) System.out.println(s);
	        sc.close();
	    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc String[] a = new String[n]; a new String[n] n for (int i = 0;i<n;i++) {
	            a[i] = sc.next();
	        } int i = 0; int i = 0; i 0 i<n i n i++ i++ i {
	            a[i] = sc.next();
	        } {
	            a[i] = sc.next();
	        } a[i] = sc.next() a[i] a i sc.next() sc.next sc int max = 0; max 0 Map<String, Integer> map = new HashMap<>(); map new HashMap<>() for (String s : a) {
	            int count = map.getOrDefault(s, 0);
	            ++count;
	            map.put(s,count);
	            max = Math.max(max, count);
	        } String s a {
	            int count = map.getOrDefault(s, 0);
	            ++count;
	            map.put(s,count);
	            max = Math.max(max, count);
	        } {
	            int count = map.getOrDefault(s, 0);
	            ++count;
	            map.put(s,count);
	            max = Math.max(max, count);
	        } int count = map.getOrDefault(s, 0); count map.getOrDefault(s, 0) map.getOrDefault map s 0 ++count count map.put(s,count) map.put map s count max = Math.max(max, count) max Math.max(max, count) Math.max Math max count List<String> l = new ArrayList<>(); l new ArrayList<>() for (Map.Entry<String, Integer> e : map.entrySet()) {
	            if (max == e.getValue()) l.add(e.getKey());
	        } Map.Entry<String, Integer> e map.entrySet() map.entrySet map {
	            if (max == e.getValue()) l.add(e.getKey());
	        } {
	            if (max == e.getValue()) l.add(e.getKey());
	        } if (max == e.getValue()) l.add(e.getKey()); max == e.getValue() max e.getValue() e.getValue e l.add(e.getKey()) l.add l e.getKey() e.getKey e Collections.sort(l) Collections.sort Collections l for (String s : l) System.out.println(s); String s l System.out.println(s); System.out.println(s) System.out.println System.out System System.out s sc.close() sc.close sc String[] args args public class Main {
	    public static void main(String[] args){
	        Scanner sc = new Scanner(System.in);
	        int n = sc.nextInt();
	        String[] a = new String[n];
	        for (int i = 0;i<n;i++) {
	            a[i] = sc.next();
	        }
	        int max = 0;
	        Map<String, Integer> map = new HashMap<>();
	        for (String s : a) {
	            int count = map.getOrDefault(s, 0);
	            ++count;
	            map.put(s,count);
	            max = Math.max(max, count);
	        }
	        List<String> l = new ArrayList<>();
	        for (Map.Entry<String, Integer> e : map.entrySet()) {
	            if (max == e.getValue()) l.add(e.getKey());
	        }
	        Collections.sort(l);
	        for (String s : l) System.out.println(s);
	        sc.close();
	    }
} public class Main {
	    public static void main(String[] args){
	        Scanner sc = new Scanner(System.in);
	        int n = sc.nextInt();
	        String[] a = new String[n];
	        for (int i = 0;i<n;i++) {
	            a[i] = sc.next();
	        }
	        int max = 0;
	        Map<String, Integer> map = new HashMap<>();
	        for (String s : a) {
	            int count = map.getOrDefault(s, 0);
	            ++count;
	            map.put(s,count);
	            max = Math.max(max, count);
	        }
	        List<String> l = new ArrayList<>();
	        for (Map.Entry<String, Integer> e : map.entrySet()) {
	            if (max == e.getValue()) l.add(e.getKey());
	        }
	        Collections.sort(l);
	        for (String s : l) System.out.println(s);
	        sc.close();
	    }
} Main
import java.util.*;
public class Main {
	    public static void main(String[] args){
	        Scanner sc = new Scanner(System.in);
	        int n = sc.nextInt();
	        String[] a = new String[n];
	        for (int i = 0;i<n;i++) {
	            a[i] = sc.next();
	        }
	        int max = 0;
	        Map<String, Integer> map = new HashMap<>();
	        for (String s : a) {
	            int count = map.getOrDefault(s, 0);
	            ++count;
	            map.put(s,count);
	            max = Math.max(max, count);
	        }
	        List<String> l = new ArrayList<>();
	        for (Map.Entry<String, Integer> e : map.entrySet()) {
	            if (max == e.getValue()) l.add(e.getKey());
	        }
	        Collections.sort(l);
	        for (String s : l) System.out.println(s);
	        sc.close();
	    }
}
