

import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
import java.util.Set;
import java.util.TreeMap;

public class Main {
	public static Scanner sc = new Scanner(System.in);
	public static PrintWriter p = new PrintWriter(System.out, true);

	public static void main(String[] args) throws Exception {
		
		try {
			int n = Integer.parseInt(sc.nextLine());
			Map<String, Integer> map = new HashMap<>();
			int ma = Integer.MIN_VALUE;
			for(int i=0;i<n;i++)
			{
				String s = sc.nextLine();
				map.put(s, map.getOrDefault(s, 0)+1);
				ma = Math.max(ma,map.get(s));
			}
			TreeMap<String, Integer> sorted = new TreeMap<>(); 
			sorted.putAll(map); 
			for(Map.Entry<String, Integer> m:sorted.entrySet()) {
				if(ma==m.getValue()) {
					System.out.println(m.getKey());
				}
			}
						
		}catch(Exception i) {}
	}

	private static StringBuilder reverse(StringBuilder sb) {
		// TODO Auto-generated method stub
		return null;
	}
} import java.io.IOException; IOException java.io import java.io.PrintWriter; PrintWriter java.io import java.util.ArrayList; ArrayList java.util import java.util.HashMap; HashMap java.util import java.util.HashSet; HashSet java.util import java.util.List; List java.util import java.util.Map; Map java.util import java.util.Scanner; Scanner java.util import java.util.Set; Set java.util import java.util.TreeMap; TreeMap java.util public class Main {
	public static Scanner sc = new Scanner(System.in);
	public static PrintWriter p = new PrintWriter(System.out, true);

	public static void main(String[] args) throws Exception {
		
		try {
			int n = Integer.parseInt(sc.nextLine());
			Map<String, Integer> map = new HashMap<>();
			int ma = Integer.MIN_VALUE;
			for(int i=0;i<n;i++)
			{
				String s = sc.nextLine();
				map.put(s, map.getOrDefault(s, 0)+1);
				ma = Math.max(ma,map.get(s));
			}
			TreeMap<String, Integer> sorted = new TreeMap<>(); 
			sorted.putAll(map); 
			for(Map.Entry<String, Integer> m:sorted.entrySet()) {
				if(ma==m.getValue()) {
					System.out.println(m.getKey());
				}
			}
						
		}catch(Exception i) {}
	}

	private static StringBuilder reverse(StringBuilder sb) {
		// TODO Auto-generated method stub
		return null;
	}
} Main public static Scanner sc = new Scanner(System.in); sc new Scanner(System.in) public static PrintWriter p = new PrintWriter(System.out, true); p new PrintWriter(System.out, true) public static void main(String[] args) throws Exception {
		
		try {
			int n = Integer.parseInt(sc.nextLine());
			Map<String, Integer> map = new HashMap<>();
			int ma = Integer.MIN_VALUE;
			for(int i=0;i<n;i++)
			{
				String s = sc.nextLine();
				map.put(s, map.getOrDefault(s, 0)+1);
				ma = Math.max(ma,map.get(s));
			}
			TreeMap<String, Integer> sorted = new TreeMap<>(); 
			sorted.putAll(map); 
			for(Map.Entry<String, Integer> m:sorted.entrySet()) {
				if(ma==m.getValue()) {
					System.out.println(m.getKey());
				}
			}
						
		}catch(Exception i) {}
	} main {
		
		try {
			int n = Integer.parseInt(sc.nextLine());
			Map<String, Integer> map = new HashMap<>();
			int ma = Integer.MIN_VALUE;
			for(int i=0;i<n;i++)
			{
				String s = sc.nextLine();
				map.put(s, map.getOrDefault(s, 0)+1);
				ma = Math.max(ma,map.get(s));
			}
			TreeMap<String, Integer> sorted = new TreeMap<>(); 
			sorted.putAll(map); 
			for(Map.Entry<String, Integer> m:sorted.entrySet()) {
				if(ma==m.getValue()) {
					System.out.println(m.getKey());
				}
			}
						
		}catch(Exception i) {}
	} try {
			int n = Integer.parseInt(sc.nextLine());
			Map<String, Integer> map = new HashMap<>();
			int ma = Integer.MIN_VALUE;
			for(int i=0;i<n;i++)
			{
				String s = sc.nextLine();
				map.put(s, map.getOrDefault(s, 0)+1);
				ma = Math.max(ma,map.get(s));
			}
			TreeMap<String, Integer> sorted = new TreeMap<>(); 
			sorted.putAll(map); 
			for(Map.Entry<String, Integer> m:sorted.entrySet()) {
				if(ma==m.getValue()) {
					System.out.println(m.getKey());
				}
			}
						
		}catch(Exception i) {} catch(Exception i) {} Exception i {} {
			int n = Integer.parseInt(sc.nextLine());
			Map<String, Integer> map = new HashMap<>();
			int ma = Integer.MIN_VALUE;
			for(int i=0;i<n;i++)
			{
				String s = sc.nextLine();
				map.put(s, map.getOrDefault(s, 0)+1);
				ma = Math.max(ma,map.get(s));
			}
			TreeMap<String, Integer> sorted = new TreeMap<>(); 
			sorted.putAll(map); 
			for(Map.Entry<String, Integer> m:sorted.entrySet()) {
				if(ma==m.getValue()) {
					System.out.println(m.getKey());
				}
			}
						
		} int n = Integer.parseInt(sc.nextLine()); n Integer.parseInt(sc.nextLine()) Integer.parseInt Integer sc.nextLine() sc.nextLine sc Map<String, Integer> map = new HashMap<>(); map new HashMap<>() int ma = Integer.MIN_VALUE; ma Integer.MIN_VALUE Integer Integer.MIN_VALUE for(int i=0;i<n;i++)
			{
				String s = sc.nextLine();
				map.put(s, map.getOrDefault(s, 0)+1);
				ma = Math.max(ma,map.get(s));
			} int i=0; int i=0; i 0 i<n i n i++ i++ i {
				String s = sc.nextLine();
				map.put(s, map.getOrDefault(s, 0)+1);
				ma = Math.max(ma,map.get(s));
			} {
				String s = sc.nextLine();
				map.put(s, map.getOrDefault(s, 0)+1);
				ma = Math.max(ma,map.get(s));
			} String s = sc.nextLine(); s sc.nextLine() sc.nextLine sc map.put(s, map.getOrDefault(s, 0)+1) map.put map s map.getOrDefault(s, 0)+1 map.getOrDefault(s, 0) map.getOrDefault map s 0 1 ma = Math.max(ma,map.get(s)) ma Math.max(ma,map.get(s)) Math.max Math ma map.get(s) map.get map s TreeMap<String, Integer> sorted = new TreeMap<>(); sorted new TreeMap<>() sorted.putAll(map) sorted.putAll sorted map for(Map.Entry<String, Integer> m:sorted.entrySet()) {
				if(ma==m.getValue()) {
					System.out.println(m.getKey());
				}
			} Map.Entry<String, Integer> m sorted.entrySet() sorted.entrySet sorted {
				if(ma==m.getValue()) {
					System.out.println(m.getKey());
				}
			} {
				if(ma==m.getValue()) {
					System.out.println(m.getKey());
				}
			} if(ma==m.getValue()) {
					System.out.println(m.getKey());
				} ma==m.getValue() ma m.getValue() m.getValue m {
					System.out.println(m.getKey());
				} System.out.println(m.getKey()) System.out.println System.out System System.out m.getKey() m.getKey m String[] args args private static StringBuilder reverse(StringBuilder sb) {
		// TODO Auto-generated method stub
		return null;
	} reverse {
		// TODO Auto-generated method stub
		return null;
	} return null; null StringBuilder sb sb public class Main {
	public static Scanner sc = new Scanner(System.in);
	public static PrintWriter p = new PrintWriter(System.out, true);

	public static void main(String[] args) throws Exception {
		
		try {
			int n = Integer.parseInt(sc.nextLine());
			Map<String, Integer> map = new HashMap<>();
			int ma = Integer.MIN_VALUE;
			for(int i=0;i<n;i++)
			{
				String s = sc.nextLine();
				map.put(s, map.getOrDefault(s, 0)+1);
				ma = Math.max(ma,map.get(s));
			}
			TreeMap<String, Integer> sorted = new TreeMap<>(); 
			sorted.putAll(map); 
			for(Map.Entry<String, Integer> m:sorted.entrySet()) {
				if(ma==m.getValue()) {
					System.out.println(m.getKey());
				}
			}
						
		}catch(Exception i) {}
	}

	private static StringBuilder reverse(StringBuilder sb) {
		// TODO Auto-generated method stub
		return null;
	}
} public class Main {
	public static Scanner sc = new Scanner(System.in);
	public static PrintWriter p = new PrintWriter(System.out, true);

	public static void main(String[] args) throws Exception {
		
		try {
			int n = Integer.parseInt(sc.nextLine());
			Map<String, Integer> map = new HashMap<>();
			int ma = Integer.MIN_VALUE;
			for(int i=0;i<n;i++)
			{
				String s = sc.nextLine();
				map.put(s, map.getOrDefault(s, 0)+1);
				ma = Math.max(ma,map.get(s));
			}
			TreeMap<String, Integer> sorted = new TreeMap<>(); 
			sorted.putAll(map); 
			for(Map.Entry<String, Integer> m:sorted.entrySet()) {
				if(ma==m.getValue()) {
					System.out.println(m.getKey());
				}
			}
						
		}catch(Exception i) {}
	}

	private static StringBuilder reverse(StringBuilder sb) {
		// TODO Auto-generated method stub
		return null;
	}
} Main


import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
import java.util.Set;
import java.util.TreeMap;

public class Main {
	public static Scanner sc = new Scanner(System.in);
	public static PrintWriter p = new PrintWriter(System.out, true);

	public static void main(String[] args) throws Exception {
		
		try {
			int n = Integer.parseInt(sc.nextLine());
			Map<String, Integer> map = new HashMap<>();
			int ma = Integer.MIN_VALUE;
			for(int i=0;i<n;i++)
			{
				String s = sc.nextLine();
				map.put(s, map.getOrDefault(s, 0)+1);
				ma = Math.max(ma,map.get(s));
			}
			TreeMap<String, Integer> sorted = new TreeMap<>(); 
			sorted.putAll(map); 
			for(Map.Entry<String, Integer> m:sorted.entrySet()) {
				if(ma==m.getValue()) {
					System.out.println(m.getKey());
				}
			}
						
		}catch(Exception i) {}
	}

	private static StringBuilder reverse(StringBuilder sb) {
		// TODO Auto-generated method stub
		return null;
	}
}