import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import java.util.TreeMap;
import java.util.Map;
 
public class Main {
 
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int ballot = sc.nextInt();  //投票用紙の枚数
		TreeMap<String, Integer> voteMap = new TreeMap<>();
      int voteMax = 0;
 
		for(int i=1 ; i<=ballot ; i++) {
			int count;
			String voteName = sc.next();
 
			if(! voteMap.containsKey(voteName)) {
				count = 1;
				voteMap.put(voteName, count);
			}
			else {
				count = voteMap.get(voteName) + 1;
				voteMap.put(voteName, count);
			}
          
          voteMax = Math.max(voteMax, count);
		}
      
      for (Map.Entry<String, Integer> e : voteMap.entrySet()) {
        if (e.getValue() == voteMax) {
          System.out.println(e.getKey());
        }
      }
	}
} import java.util.ArrayList; ArrayList java.util import java.util.List; List java.util import java.util.Scanner; Scanner java.util import java.util.TreeMap; TreeMap java.util import java.util.Map; Map java.util public class Main {
 
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int ballot = sc.nextInt();  //投票用紙の枚数
		TreeMap<String, Integer> voteMap = new TreeMap<>();
      int voteMax = 0;
 
		for(int i=1 ; i<=ballot ; i++) {
			int count;
			String voteName = sc.next();
 
			if(! voteMap.containsKey(voteName)) {
				count = 1;
				voteMap.put(voteName, count);
			}
			else {
				count = voteMap.get(voteName) + 1;
				voteMap.put(voteName, count);
			}
          
          voteMax = Math.max(voteMax, count);
		}
      
      for (Map.Entry<String, Integer> e : voteMap.entrySet()) {
        if (e.getValue() == voteMax) {
          System.out.println(e.getKey());
        }
      }
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int ballot = sc.nextInt();  //投票用紙の枚数
		TreeMap<String, Integer> voteMap = new TreeMap<>();
      int voteMax = 0;
 
		for(int i=1 ; i<=ballot ; i++) {
			int count;
			String voteName = sc.next();
 
			if(! voteMap.containsKey(voteName)) {
				count = 1;
				voteMap.put(voteName, count);
			}
			else {
				count = voteMap.get(voteName) + 1;
				voteMap.put(voteName, count);
			}
          
          voteMax = Math.max(voteMax, count);
		}
      
      for (Map.Entry<String, Integer> e : voteMap.entrySet()) {
        if (e.getValue() == voteMax) {
          System.out.println(e.getKey());
        }
      }
	} main {
		Scanner sc = new Scanner(System.in);
		int ballot = sc.nextInt();  //投票用紙の枚数
		TreeMap<String, Integer> voteMap = new TreeMap<>();
      int voteMax = 0;
 
		for(int i=1 ; i<=ballot ; i++) {
			int count;
			String voteName = sc.next();
 
			if(! voteMap.containsKey(voteName)) {
				count = 1;
				voteMap.put(voteName, count);
			}
			else {
				count = voteMap.get(voteName) + 1;
				voteMap.put(voteName, count);
			}
          
          voteMax = Math.max(voteMax, count);
		}
      
      for (Map.Entry<String, Integer> e : voteMap.entrySet()) {
        if (e.getValue() == voteMax) {
          System.out.println(e.getKey());
        }
      }
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int ballot = sc.nextInt(); ballot sc.nextInt() sc.nextInt sc TreeMap<String, Integer> voteMap = new TreeMap<>(); voteMap new TreeMap<>() int voteMax = 0; voteMax 0 for(int i=1 ; i<=ballot ; i++) {
			int count;
			String voteName = sc.next();
 
			if(! voteMap.containsKey(voteName)) {
				count = 1;
				voteMap.put(voteName, count);
			}
			else {
				count = voteMap.get(voteName) + 1;
				voteMap.put(voteName, count);
			}
          
          voteMax = Math.max(voteMax, count);
		} int i=1 ; int i=1 ; i 1 i<=ballot i ballot i++ i++ i {
			int count;
			String voteName = sc.next();
 
			if(! voteMap.containsKey(voteName)) {
				count = 1;
				voteMap.put(voteName, count);
			}
			else {
				count = voteMap.get(voteName) + 1;
				voteMap.put(voteName, count);
			}
          
          voteMax = Math.max(voteMax, count);
		} {
			int count;
			String voteName = sc.next();
 
			if(! voteMap.containsKey(voteName)) {
				count = 1;
				voteMap.put(voteName, count);
			}
			else {
				count = voteMap.get(voteName) + 1;
				voteMap.put(voteName, count);
			}
          
          voteMax = Math.max(voteMax, count);
		} int count; count String voteName = sc.next(); voteName sc.next() sc.next sc if(! voteMap.containsKey(voteName)) {
				count = 1;
				voteMap.put(voteName, count);
			}
			else {
				count = voteMap.get(voteName) + 1;
				voteMap.put(voteName, count);
			} ! voteMap.containsKey(voteName) voteMap.containsKey(voteName) voteMap.containsKey voteMap voteName {
				count = 1;
				voteMap.put(voteName, count);
			} count = 1 count 1 voteMap.put(voteName, count) voteMap.put voteMap voteName count {
				count = voteMap.get(voteName) + 1;
				voteMap.put(voteName, count);
			} count = voteMap.get(voteName) + 1 count voteMap.get(voteName) + 1 voteMap.get(voteName) voteMap.get voteMap voteName 1 voteMap.put(voteName, count) voteMap.put voteMap voteName count voteMax = Math.max(voteMax, count) voteMax Math.max(voteMax, count) Math.max Math voteMax count for (Map.Entry<String, Integer> e : voteMap.entrySet()) {
        if (e.getValue() == voteMax) {
          System.out.println(e.getKey());
        }
      } Map.Entry<String, Integer> e voteMap.entrySet() voteMap.entrySet voteMap {
        if (e.getValue() == voteMax) {
          System.out.println(e.getKey());
        }
      } {
        if (e.getValue() == voteMax) {
          System.out.println(e.getKey());
        }
      } if (e.getValue() == voteMax) {
          System.out.println(e.getKey());
        } e.getValue() == voteMax e.getValue() e.getValue e voteMax {
          System.out.println(e.getKey());
        } System.out.println(e.getKey()) System.out.println System.out System System.out e.getKey() e.getKey e String[] args args public class Main {
 
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int ballot = sc.nextInt();  //投票用紙の枚数
		TreeMap<String, Integer> voteMap = new TreeMap<>();
      int voteMax = 0;
 
		for(int i=1 ; i<=ballot ; i++) {
			int count;
			String voteName = sc.next();
 
			if(! voteMap.containsKey(voteName)) {
				count = 1;
				voteMap.put(voteName, count);
			}
			else {
				count = voteMap.get(voteName) + 1;
				voteMap.put(voteName, count);
			}
          
          voteMax = Math.max(voteMax, count);
		}
      
      for (Map.Entry<String, Integer> e : voteMap.entrySet()) {
        if (e.getValue() == voteMax) {
          System.out.println(e.getKey());
        }
      }
	}
} public class Main {
 
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int ballot = sc.nextInt();  //投票用紙の枚数
		TreeMap<String, Integer> voteMap = new TreeMap<>();
      int voteMax = 0;
 
		for(int i=1 ; i<=ballot ; i++) {
			int count;
			String voteName = sc.next();
 
			if(! voteMap.containsKey(voteName)) {
				count = 1;
				voteMap.put(voteName, count);
			}
			else {
				count = voteMap.get(voteName) + 1;
				voteMap.put(voteName, count);
			}
          
          voteMax = Math.max(voteMax, count);
		}
      
      for (Map.Entry<String, Integer> e : voteMap.entrySet()) {
        if (e.getValue() == voteMax) {
          System.out.println(e.getKey());
        }
      }
	}
} Main
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import java.util.TreeMap;
import java.util.Map;
 
public class Main {
 
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int ballot = sc.nextInt();  //投票用紙の枚数
		TreeMap<String, Integer> voteMap = new TreeMap<>();
      int voteMax = 0;
 
		for(int i=1 ; i<=ballot ; i++) {
			int count;
			String voteName = sc.next();
 
			if(! voteMap.containsKey(voteName)) {
				count = 1;
				voteMap.put(voteName, count);
			}
			else {
				count = voteMap.get(voteName) + 1;
				voteMap.put(voteName, count);
			}
          
          voteMax = Math.max(voteMax, count);
		}
      
      for (Map.Entry<String, Integer> e : voteMap.entrySet()) {
        if (e.getValue() == voteMax) {
          System.out.println(e.getKey());
        }
      }
	}
}