
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;



public class Main {

	private static BufferedReader br;
	
	public static void main(String[] args) throws IOException {
		br = new BufferedReader(new InputStreamReader(System.in));
		
		int n = Integer.parseInt(br.readLine());
		List<String> list = new ArrayList<String>();
		for(int i=0;i<n;i++) {
			list.add(br.readLine());
		}
		br.close();
		
		Map<String,Integer> counted = count(list);
		outMaxVal(counted);
	}
	
	private static Map<String,Integer> count(List<String> list){
		Map<String,Integer> map = new HashMap<String, Integer>();
		for(String str:list) {
			if(!map.containsKey(str)) {
				map.put(str, 1);
			}else {
				map.put(str,map.get(str)+1);
			}
		}
		return map;
	}
	
	public static void outMaxVal(Map<String, Integer> map) {
		ArrayList<String> max = null;
		Integer maxVal = 0;
		for(Entry<String, Integer> e: map.entrySet()) {
			if(e.getValue().compareTo(maxVal)>0) {
				max = new ArrayList<String>();
				max.add(e.getKey());
				maxVal = e.getValue();
			}else if(e.getValue().equals(maxVal)) {
				max.add(e.getKey());
			}
		}
		Collections.sort(max);
		
		for(String str: max) {
			System.out.println(str);
		}
	}

} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections java.util import java.util.Comparator; Comparator java.util import java.util.HashMap; HashMap java.util import java.util.List; List java.util import java.util.Map; Map java.util import java.util.Map.Entry; Entry java.util.Map public class Main {

	private static BufferedReader br;
	
	public static void main(String[] args) throws IOException {
		br = new BufferedReader(new InputStreamReader(System.in));
		
		int n = Integer.parseInt(br.readLine());
		List<String> list = new ArrayList<String>();
		for(int i=0;i<n;i++) {
			list.add(br.readLine());
		}
		br.close();
		
		Map<String,Integer> counted = count(list);
		outMaxVal(counted);
	}
	
	private static Map<String,Integer> count(List<String> list){
		Map<String,Integer> map = new HashMap<String, Integer>();
		for(String str:list) {
			if(!map.containsKey(str)) {
				map.put(str, 1);
			}else {
				map.put(str,map.get(str)+1);
			}
		}
		return map;
	}
	
	public static void outMaxVal(Map<String, Integer> map) {
		ArrayList<String> max = null;
		Integer maxVal = 0;
		for(Entry<String, Integer> e: map.entrySet()) {
			if(e.getValue().compareTo(maxVal)>0) {
				max = new ArrayList<String>();
				max.add(e.getKey());
				maxVal = e.getValue();
			}else if(e.getValue().equals(maxVal)) {
				max.add(e.getKey());
			}
		}
		Collections.sort(max);
		
		for(String str: max) {
			System.out.println(str);
		}
	}

} Main private static BufferedReader br; br public static void main(String[] args) throws IOException {
		br = new BufferedReader(new InputStreamReader(System.in));
		
		int n = Integer.parseInt(br.readLine());
		List<String> list = new ArrayList<String>();
		for(int i=0;i<n;i++) {
			list.add(br.readLine());
		}
		br.close();
		
		Map<String,Integer> counted = count(list);
		outMaxVal(counted);
	} main {
		br = new BufferedReader(new InputStreamReader(System.in));
		
		int n = Integer.parseInt(br.readLine());
		List<String> list = new ArrayList<String>();
		for(int i=0;i<n;i++) {
			list.add(br.readLine());
		}
		br.close();
		
		Map<String,Integer> counted = count(list);
		outMaxVal(counted);
	} br = new BufferedReader(new InputStreamReader(System.in)) br new BufferedReader(new InputStreamReader(System.in)) int n = Integer.parseInt(br.readLine()); n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br List<String> list = new ArrayList<String>(); list new ArrayList<String>() for(int i=0;i<n;i++) {
			list.add(br.readLine());
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			list.add(br.readLine());
		} {
			list.add(br.readLine());
		} list.add(br.readLine()) list.add list br.readLine() br.readLine br br.close() br.close br Map<String,Integer> counted = count(list); counted count(list) count list outMaxVal(counted) outMaxVal counted String[] args args private static Map<String,Integer> count(List<String> list){
		Map<String,Integer> map = new HashMap<String, Integer>();
		for(String str:list) {
			if(!map.containsKey(str)) {
				map.put(str, 1);
			}else {
				map.put(str,map.get(str)+1);
			}
		}
		return map;
	} count {
		Map<String,Integer> map = new HashMap<String, Integer>();
		for(String str:list) {
			if(!map.containsKey(str)) {
				map.put(str, 1);
			}else {
				map.put(str,map.get(str)+1);
			}
		}
		return map;
	} Map<String,Integer> map = new HashMap<String, Integer>(); map new HashMap<String, Integer>() for(String str:list) {
			if(!map.containsKey(str)) {
				map.put(str, 1);
			}else {
				map.put(str,map.get(str)+1);
			}
		} String str list {
			if(!map.containsKey(str)) {
				map.put(str, 1);
			}else {
				map.put(str,map.get(str)+1);
			}
		} {
			if(!map.containsKey(str)) {
				map.put(str, 1);
			}else {
				map.put(str,map.get(str)+1);
			}
		} if(!map.containsKey(str)) {
				map.put(str, 1);
			}else {
				map.put(str,map.get(str)+1);
			} !map.containsKey(str) map.containsKey(str) map.containsKey map str {
				map.put(str, 1);
			} map.put(str, 1) map.put map str 1 {
				map.put(str,map.get(str)+1);
			} map.put(str,map.get(str)+1) map.put map str map.get(str)+1 map.get(str) map.get map str 1 return map; map List<String> list list public static void outMaxVal(Map<String, Integer> map) {
		ArrayList<String> max = null;
		Integer maxVal = 0;
		for(Entry<String, Integer> e: map.entrySet()) {
			if(e.getValue().compareTo(maxVal)>0) {
				max = new ArrayList<String>();
				max.add(e.getKey());
				maxVal = e.getValue();
			}else if(e.getValue().equals(maxVal)) {
				max.add(e.getKey());
			}
		}
		Collections.sort(max);
		
		for(String str: max) {
			System.out.println(str);
		}
	} outMaxVal {
		ArrayList<String> max = null;
		Integer maxVal = 0;
		for(Entry<String, Integer> e: map.entrySet()) {
			if(e.getValue().compareTo(maxVal)>0) {
				max = new ArrayList<String>();
				max.add(e.getKey());
				maxVal = e.getValue();
			}else if(e.getValue().equals(maxVal)) {
				max.add(e.getKey());
			}
		}
		Collections.sort(max);
		
		for(String str: max) {
			System.out.println(str);
		}
	} ArrayList<String> max = null; max null Integer maxVal = 0; maxVal 0 for(Entry<String, Integer> e: map.entrySet()) {
			if(e.getValue().compareTo(maxVal)>0) {
				max = new ArrayList<String>();
				max.add(e.getKey());
				maxVal = e.getValue();
			}else if(e.getValue().equals(maxVal)) {
				max.add(e.getKey());
			}
		} Entry<String, Integer> e map.entrySet() map.entrySet map {
			if(e.getValue().compareTo(maxVal)>0) {
				max = new ArrayList<String>();
				max.add(e.getKey());
				maxVal = e.getValue();
			}else if(e.getValue().equals(maxVal)) {
				max.add(e.getKey());
			}
		} {
			if(e.getValue().compareTo(maxVal)>0) {
				max = new ArrayList<String>();
				max.add(e.getKey());
				maxVal = e.getValue();
			}else if(e.getValue().equals(maxVal)) {
				max.add(e.getKey());
			}
		} if(e.getValue().compareTo(maxVal)>0) {
				max = new ArrayList<String>();
				max.add(e.getKey());
				maxVal = e.getValue();
			}else if(e.getValue().equals(maxVal)) {
				max.add(e.getKey());
			} e.getValue().compareTo(maxVal)>0 e.getValue().compareTo(maxVal) e.getValue().compareTo e.getValue() e.getValue e maxVal 0 {
				max = new ArrayList<String>();
				max.add(e.getKey());
				maxVal = e.getValue();
			} max = new ArrayList<String>() max new ArrayList<String>() max.add(e.getKey()) max.add max e.getKey() e.getKey e maxVal = e.getValue() maxVal e.getValue() e.getValue e if(e.getValue().equals(maxVal)) {
				max.add(e.getKey());
			} e.getValue().equals(maxVal) e.getValue().equals e.getValue() e.getValue e maxVal {
				max.add(e.getKey());
			} max.add(e.getKey()) max.add max e.getKey() e.getKey e Collections.sort(max) Collections.sort Collections max for(String str: max) {
			System.out.println(str);
		} String str max {
			System.out.println(str);
		} {
			System.out.println(str);
		} System.out.println(str) System.out.println System.out System System.out str Map<String, Integer> map map public class Main {

	private static BufferedReader br;
	
	public static void main(String[] args) throws IOException {
		br = new BufferedReader(new InputStreamReader(System.in));
		
		int n = Integer.parseInt(br.readLine());
		List<String> list = new ArrayList<String>();
		for(int i=0;i<n;i++) {
			list.add(br.readLine());
		}
		br.close();
		
		Map<String,Integer> counted = count(list);
		outMaxVal(counted);
	}
	
	private static Map<String,Integer> count(List<String> list){
		Map<String,Integer> map = new HashMap<String, Integer>();
		for(String str:list) {
			if(!map.containsKey(str)) {
				map.put(str, 1);
			}else {
				map.put(str,map.get(str)+1);
			}
		}
		return map;
	}
	
	public static void outMaxVal(Map<String, Integer> map) {
		ArrayList<String> max = null;
		Integer maxVal = 0;
		for(Entry<String, Integer> e: map.entrySet()) {
			if(e.getValue().compareTo(maxVal)>0) {
				max = new ArrayList<String>();
				max.add(e.getKey());
				maxVal = e.getValue();
			}else if(e.getValue().equals(maxVal)) {
				max.add(e.getKey());
			}
		}
		Collections.sort(max);
		
		for(String str: max) {
			System.out.println(str);
		}
	}

} public class Main {

	private static BufferedReader br;
	
	public static void main(String[] args) throws IOException {
		br = new BufferedReader(new InputStreamReader(System.in));
		
		int n = Integer.parseInt(br.readLine());
		List<String> list = new ArrayList<String>();
		for(int i=0;i<n;i++) {
			list.add(br.readLine());
		}
		br.close();
		
		Map<String,Integer> counted = count(list);
		outMaxVal(counted);
	}
	
	private static Map<String,Integer> count(List<String> list){
		Map<String,Integer> map = new HashMap<String, Integer>();
		for(String str:list) {
			if(!map.containsKey(str)) {
				map.put(str, 1);
			}else {
				map.put(str,map.get(str)+1);
			}
		}
		return map;
	}
	
	public static void outMaxVal(Map<String, Integer> map) {
		ArrayList<String> max = null;
		Integer maxVal = 0;
		for(Entry<String, Integer> e: map.entrySet()) {
			if(e.getValue().compareTo(maxVal)>0) {
				max = new ArrayList<String>();
				max.add(e.getKey());
				maxVal = e.getValue();
			}else if(e.getValue().equals(maxVal)) {
				max.add(e.getKey());
			}
		}
		Collections.sort(max);
		
		for(String str: max) {
			System.out.println(str);
		}
	}

} Main

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;



public class Main {

	private static BufferedReader br;
	
	public static void main(String[] args) throws IOException {
		br = new BufferedReader(new InputStreamReader(System.in));
		
		int n = Integer.parseInt(br.readLine());
		List<String> list = new ArrayList<String>();
		for(int i=0;i<n;i++) {
			list.add(br.readLine());
		}
		br.close();
		
		Map<String,Integer> counted = count(list);
		outMaxVal(counted);
	}
	
	private static Map<String,Integer> count(List<String> list){
		Map<String,Integer> map = new HashMap<String, Integer>();
		for(String str:list) {
			if(!map.containsKey(str)) {
				map.put(str, 1);
			}else {
				map.put(str,map.get(str)+1);
			}
		}
		return map;
	}
	
	public static void outMaxVal(Map<String, Integer> map) {
		ArrayList<String> max = null;
		Integer maxVal = 0;
		for(Entry<String, Integer> e: map.entrySet()) {
			if(e.getValue().compareTo(maxVal)>0) {
				max = new ArrayList<String>();
				max.add(e.getKey());
				maxVal = e.getValue();
			}else if(e.getValue().equals(maxVal)) {
				max.add(e.getKey());
			}
		}
		Collections.sort(max);
		
		for(String str: max) {
			System.out.println(str);
		}
	}

}
