import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Map;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Set;

public class Main{
  public static void main(String[] args)throws IOException {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    
    int numVote = Integer.parseInt(br.readLine());
    String data;
    Map<String, Integer> voteNumList = new HashMap<>();
    Set<String> nameSet = new HashSet<>();
    
    
    for(int i=0; i<numVote; i++){
      String name = br.readLine();
      if(voteNumList.containsKey(name)){
        voteNumList.put(name, voteNumList.get(name) + 1);
      } else {
        voteNumList.put(name, 1);
        nameSet.add(name);
      }
    }
    
    Set<String> result = new HashSet<>();
    int max = 0;
    
    for(String s: nameSet){
      int n = voteNumList.get(s);
      if(n > max){
        result = new HashSet<>();
        max = n;
        result.add(s);
      } else if (n == max){
        result.add(s);
      }
    }
  
    Object[] resultList = result.stream()
        .sorted()
        .toArray();
    
    StringBuilder str = new StringBuilder();
    for(Object s: resultList){
      str.append(s);
      str.append("\n");
    }
    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.Map; Map java.util import java.util.ArrayList; ArrayList java.util import java.util.HashMap; HashMap java.util import java.util.HashSet; HashSet java.util import java.util.Set; Set java.util public class Main{
  public static void main(String[] args)throws IOException {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    
    int numVote = Integer.parseInt(br.readLine());
    String data;
    Map<String, Integer> voteNumList = new HashMap<>();
    Set<String> nameSet = new HashSet<>();
    
    
    for(int i=0; i<numVote; i++){
      String name = br.readLine();
      if(voteNumList.containsKey(name)){
        voteNumList.put(name, voteNumList.get(name) + 1);
      } else {
        voteNumList.put(name, 1);
        nameSet.add(name);
      }
    }
    
    Set<String> result = new HashSet<>();
    int max = 0;
    
    for(String s: nameSet){
      int n = voteNumList.get(s);
      if(n > max){
        result = new HashSet<>();
        max = n;
        result.add(s);
      } else if (n == max){
        result.add(s);
      }
    }
  
    Object[] resultList = result.stream()
        .sorted()
        .toArray();
    
    StringBuilder str = new StringBuilder();
    for(Object s: resultList){
      str.append(s);
      str.append("\n");
    }
    System.out.println(str);
  }
} Main public static void main(String[] args)throws IOException {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    
    int numVote = Integer.parseInt(br.readLine());
    String data;
    Map<String, Integer> voteNumList = new HashMap<>();
    Set<String> nameSet = new HashSet<>();
    
    
    for(int i=0; i<numVote; i++){
      String name = br.readLine();
      if(voteNumList.containsKey(name)){
        voteNumList.put(name, voteNumList.get(name) + 1);
      } else {
        voteNumList.put(name, 1);
        nameSet.add(name);
      }
    }
    
    Set<String> result = new HashSet<>();
    int max = 0;
    
    for(String s: nameSet){
      int n = voteNumList.get(s);
      if(n > max){
        result = new HashSet<>();
        max = n;
        result.add(s);
      } else if (n == max){
        result.add(s);
      }
    }
  
    Object[] resultList = result.stream()
        .sorted()
        .toArray();
    
    StringBuilder str = new StringBuilder();
    for(Object s: resultList){
      str.append(s);
      str.append("\n");
    }
    System.out.println(str);
  } main {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    
    int numVote = Integer.parseInt(br.readLine());
    String data;
    Map<String, Integer> voteNumList = new HashMap<>();
    Set<String> nameSet = new HashSet<>();
    
    
    for(int i=0; i<numVote; i++){
      String name = br.readLine();
      if(voteNumList.containsKey(name)){
        voteNumList.put(name, voteNumList.get(name) + 1);
      } else {
        voteNumList.put(name, 1);
        nameSet.add(name);
      }
    }
    
    Set<String> result = new HashSet<>();
    int max = 0;
    
    for(String s: nameSet){
      int n = voteNumList.get(s);
      if(n > max){
        result = new HashSet<>();
        max = n;
        result.add(s);
      } else if (n == max){
        result.add(s);
      }
    }
  
    Object[] resultList = result.stream()
        .sorted()
        .toArray();
    
    StringBuilder str = new StringBuilder();
    for(Object s: resultList){
      str.append(s);
      str.append("\n");
    }
    System.out.println(str);
  } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int numVote = Integer.parseInt(br.readLine()); numVote Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br String data; data Map<String, Integer> voteNumList = new HashMap<>(); voteNumList new HashMap<>() Set<String> nameSet = new HashSet<>(); nameSet new HashSet<>() for(int i=0; i<numVote; i++){
      String name = br.readLine();
      if(voteNumList.containsKey(name)){
        voteNumList.put(name, voteNumList.get(name) + 1);
      } else {
        voteNumList.put(name, 1);
        nameSet.add(name);
      }
    } int i=0; int i=0; i 0 i<numVote i numVote i++ i++ i {
      String name = br.readLine();
      if(voteNumList.containsKey(name)){
        voteNumList.put(name, voteNumList.get(name) + 1);
      } else {
        voteNumList.put(name, 1);
        nameSet.add(name);
      }
    } {
      String name = br.readLine();
      if(voteNumList.containsKey(name)){
        voteNumList.put(name, voteNumList.get(name) + 1);
      } else {
        voteNumList.put(name, 1);
        nameSet.add(name);
      }
    } String name = br.readLine(); name br.readLine() br.readLine br if(voteNumList.containsKey(name)){
        voteNumList.put(name, voteNumList.get(name) + 1);
      } else {
        voteNumList.put(name, 1);
        nameSet.add(name);
      } voteNumList.containsKey(name) voteNumList.containsKey voteNumList name {
        voteNumList.put(name, voteNumList.get(name) + 1);
      } voteNumList.put(name, voteNumList.get(name) + 1) voteNumList.put voteNumList name voteNumList.get(name) + 1 voteNumList.get(name) voteNumList.get voteNumList name 1 {
        voteNumList.put(name, 1);
        nameSet.add(name);
      } voteNumList.put(name, 1) voteNumList.put voteNumList name 1 nameSet.add(name) nameSet.add nameSet name Set<String> result = new HashSet<>(); result new HashSet<>() int max = 0; max 0 for(String s: nameSet){
      int n = voteNumList.get(s);
      if(n > max){
        result = new HashSet<>();
        max = n;
        result.add(s);
      } else if (n == max){
        result.add(s);
      }
    } String s nameSet {
      int n = voteNumList.get(s);
      if(n > max){
        result = new HashSet<>();
        max = n;
        result.add(s);
      } else if (n == max){
        result.add(s);
      }
    } {
      int n = voteNumList.get(s);
      if(n > max){
        result = new HashSet<>();
        max = n;
        result.add(s);
      } else if (n == max){
        result.add(s);
      }
    } int n = voteNumList.get(s); n voteNumList.get(s) voteNumList.get voteNumList s if(n > max){
        result = new HashSet<>();
        max = n;
        result.add(s);
      } else if (n == max){
        result.add(s);
      } n > max n max {
        result = new HashSet<>();
        max = n;
        result.add(s);
      } result = new HashSet<>() result new HashSet<>() max = n max n result.add(s) result.add result s if (n == max){
        result.add(s);
      } n == max n max {
        result.add(s);
      } result.add(s) result.add result s Object[] resultList = result.stream()
        .sorted()
        .toArray(); resultList result.stream()
        .sorted()
        .toArray() result.stream()
        .sorted()
        .toArray result.stream()
        .sorted() result.stream()
        .sorted result.stream() result.stream result StringBuilder str = new StringBuilder(); str new StringBuilder() for(Object s: resultList){
      str.append(s);
      str.append("\n");
    } Object s resultList {
      str.append(s);
      str.append("\n");
    } {
      str.append(s);
      str.append("\n");
    } str.append(s) str.append str s str.append("\n") str.append str "\n" System.out.println(str) System.out.println System.out System System.out str String[] args args public class Main{
  public static void main(String[] args)throws IOException {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    
    int numVote = Integer.parseInt(br.readLine());
    String data;
    Map<String, Integer> voteNumList = new HashMap<>();
    Set<String> nameSet = new HashSet<>();
    
    
    for(int i=0; i<numVote; i++){
      String name = br.readLine();
      if(voteNumList.containsKey(name)){
        voteNumList.put(name, voteNumList.get(name) + 1);
      } else {
        voteNumList.put(name, 1);
        nameSet.add(name);
      }
    }
    
    Set<String> result = new HashSet<>();
    int max = 0;
    
    for(String s: nameSet){
      int n = voteNumList.get(s);
      if(n > max){
        result = new HashSet<>();
        max = n;
        result.add(s);
      } else if (n == max){
        result.add(s);
      }
    }
  
    Object[] resultList = result.stream()
        .sorted()
        .toArray();
    
    StringBuilder str = new StringBuilder();
    for(Object s: resultList){
      str.append(s);
      str.append("\n");
    }
    System.out.println(str);
  }
} public class Main{
  public static void main(String[] args)throws IOException {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    
    int numVote = Integer.parseInt(br.readLine());
    String data;
    Map<String, Integer> voteNumList = new HashMap<>();
    Set<String> nameSet = new HashSet<>();
    
    
    for(int i=0; i<numVote; i++){
      String name = br.readLine();
      if(voteNumList.containsKey(name)){
        voteNumList.put(name, voteNumList.get(name) + 1);
      } else {
        voteNumList.put(name, 1);
        nameSet.add(name);
      }
    }
    
    Set<String> result = new HashSet<>();
    int max = 0;
    
    for(String s: nameSet){
      int n = voteNumList.get(s);
      if(n > max){
        result = new HashSet<>();
        max = n;
        result.add(s);
      } else if (n == max){
        result.add(s);
      }
    }
  
    Object[] resultList = result.stream()
        .sorted()
        .toArray();
    
    StringBuilder str = new StringBuilder();
    for(Object s: resultList){
      str.append(s);
      str.append("\n");
    }
    System.out.println(str);
  }
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Map;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Set;

public class Main{
  public static void main(String[] args)throws IOException {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    
    int numVote = Integer.parseInt(br.readLine());
    String data;
    Map<String, Integer> voteNumList = new HashMap<>();
    Set<String> nameSet = new HashSet<>();
    
    
    for(int i=0; i<numVote; i++){
      String name = br.readLine();
      if(voteNumList.containsKey(name)){
        voteNumList.put(name, voteNumList.get(name) + 1);
      } else {
        voteNumList.put(name, 1);
        nameSet.add(name);
      }
    }
    
    Set<String> result = new HashSet<>();
    int max = 0;
    
    for(String s: nameSet){
      int n = voteNumList.get(s);
      if(n > max){
        result = new HashSet<>();
        max = n;
        result.add(s);
      } else if (n == max){
        result.add(s);
      }
    }
  
    Object[] resultList = result.stream()
        .sorted()
        .toArray();
    
    StringBuilder str = new StringBuilder();
    for(Object s: resultList){
      str.append(s);
      str.append("\n");
    }
    System.out.println(str);
  }
}
