import java.awt.geom.Point2D;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Scanner;
import java.util.Map.Entry;
import java.util.function.BiFunction;
import java.util.function.Function;
import java.util.function.Supplier;

public class Main {
    Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        new Main().run();
    }

    void run() {
        int inp_num = Integer.parseInt(sc.next());
        HashMap<String, Integer> m = new HashMap<String, Integer>();
        for (int i = 0; i < inp_num; i++) {
            String s = sc.next();
            if (m.containsKey(s)) {
                m.put(s, m.get(s) + 1);
            } else {
                m.put(s, 1);
            }
        }
        int ma = -1;
        ArrayList<String> candidates = new ArrayList<>();
        for (Entry<String, Integer> ent : m.entrySet()) {
            if(ma == ent.getValue()){
                candidates.add(ent.getKey());
            }else if(ma < ent.getValue()){
                candidates.clear();
                ma = ent.getValue();
                candidates.add(ent.getKey());
            }
      }
      Collections.sort(candidates);
      for(String can : candidates){
        System.out.println(can);
      }
  }
} import java.awt.geom.Point2D; Point2D java.awt.geom import java.io.IOException; IOException java.io import java.io.InputStream; InputStream java.io import java.util.ArrayList; ArrayList java.util import java.util.Arrays; Arrays java.util import java.util.Collection; Collection 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.Map; Map java.util import java.util.NoSuchElementException; NoSuchElementException java.util import java.util.Scanner; Scanner java.util import java.util.Map.Entry; Entry java.util.Map import java.util.function.BiFunction; BiFunction java.util.function import java.util.function.Function; Function java.util.function import java.util.function.Supplier; Supplier java.util.function public class Main {
    Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        new Main().run();
    }

    void run() {
        int inp_num = Integer.parseInt(sc.next());
        HashMap<String, Integer> m = new HashMap<String, Integer>();
        for (int i = 0; i < inp_num; i++) {
            String s = sc.next();
            if (m.containsKey(s)) {
                m.put(s, m.get(s) + 1);
            } else {
                m.put(s, 1);
            }
        }
        int ma = -1;
        ArrayList<String> candidates = new ArrayList<>();
        for (Entry<String, Integer> ent : m.entrySet()) {
            if(ma == ent.getValue()){
                candidates.add(ent.getKey());
            }else if(ma < ent.getValue()){
                candidates.clear();
                ma = ent.getValue();
                candidates.add(ent.getKey());
            }
      }
      Collections.sort(candidates);
      for(String can : candidates){
        System.out.println(can);
      }
  }
} Main Scanner sc = new Scanner(System.in); sc new Scanner(System.in) public static void main(String[] args) {
        new Main().run();
    } main {
        new Main().run();
    } new Main().run() new Main().run new Main() String[] args args void run() {
        int inp_num = Integer.parseInt(sc.next());
        HashMap<String, Integer> m = new HashMap<String, Integer>();
        for (int i = 0; i < inp_num; i++) {
            String s = sc.next();
            if (m.containsKey(s)) {
                m.put(s, m.get(s) + 1);
            } else {
                m.put(s, 1);
            }
        }
        int ma = -1;
        ArrayList<String> candidates = new ArrayList<>();
        for (Entry<String, Integer> ent : m.entrySet()) {
            if(ma == ent.getValue()){
                candidates.add(ent.getKey());
            }else if(ma < ent.getValue()){
                candidates.clear();
                ma = ent.getValue();
                candidates.add(ent.getKey());
            }
      }
      Collections.sort(candidates);
      for(String can : candidates){
        System.out.println(can);
      }
  } run {
        int inp_num = Integer.parseInt(sc.next());
        HashMap<String, Integer> m = new HashMap<String, Integer>();
        for (int i = 0; i < inp_num; i++) {
            String s = sc.next();
            if (m.containsKey(s)) {
                m.put(s, m.get(s) + 1);
            } else {
                m.put(s, 1);
            }
        }
        int ma = -1;
        ArrayList<String> candidates = new ArrayList<>();
        for (Entry<String, Integer> ent : m.entrySet()) {
            if(ma == ent.getValue()){
                candidates.add(ent.getKey());
            }else if(ma < ent.getValue()){
                candidates.clear();
                ma = ent.getValue();
                candidates.add(ent.getKey());
            }
      }
      Collections.sort(candidates);
      for(String can : candidates){
        System.out.println(can);
      }
  } int inp_num = Integer.parseInt(sc.next()); inp_num Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc HashMap<String, Integer> m = new HashMap<String, Integer>(); m new HashMap<String, Integer>() for (int i = 0; i < inp_num; i++) {
            String s = sc.next();
            if (m.containsKey(s)) {
                m.put(s, m.get(s) + 1);
            } else {
                m.put(s, 1);
            }
        } int i = 0; int i = 0; i 0 i < inp_num i inp_num i++ i++ i {
            String s = sc.next();
            if (m.containsKey(s)) {
                m.put(s, m.get(s) + 1);
            } else {
                m.put(s, 1);
            }
        } {
            String s = sc.next();
            if (m.containsKey(s)) {
                m.put(s, m.get(s) + 1);
            } else {
                m.put(s, 1);
            }
        } String s = sc.next(); s sc.next() sc.next sc if (m.containsKey(s)) {
                m.put(s, m.get(s) + 1);
            } else {
                m.put(s, 1);
            } m.containsKey(s) m.containsKey m s {
                m.put(s, m.get(s) + 1);
            } m.put(s, m.get(s) + 1) m.put m s m.get(s) + 1 m.get(s) m.get m s 1 {
                m.put(s, 1);
            } m.put(s, 1) m.put m s 1 int ma = -1; ma -1 1 ArrayList<String> candidates = new ArrayList<>(); candidates new ArrayList<>() for (Entry<String, Integer> ent : m.entrySet()) {
            if(ma == ent.getValue()){
                candidates.add(ent.getKey());
            }else if(ma < ent.getValue()){
                candidates.clear();
                ma = ent.getValue();
                candidates.add(ent.getKey());
            }
      } Entry<String, Integer> ent m.entrySet() m.entrySet m {
            if(ma == ent.getValue()){
                candidates.add(ent.getKey());
            }else if(ma < ent.getValue()){
                candidates.clear();
                ma = ent.getValue();
                candidates.add(ent.getKey());
            }
      } {
            if(ma == ent.getValue()){
                candidates.add(ent.getKey());
            }else if(ma < ent.getValue()){
                candidates.clear();
                ma = ent.getValue();
                candidates.add(ent.getKey());
            }
      } if(ma == ent.getValue()){
                candidates.add(ent.getKey());
            }else if(ma < ent.getValue()){
                candidates.clear();
                ma = ent.getValue();
                candidates.add(ent.getKey());
            } ma == ent.getValue() ma ent.getValue() ent.getValue ent {
                candidates.add(ent.getKey());
            } candidates.add(ent.getKey()) candidates.add candidates ent.getKey() ent.getKey ent if(ma < ent.getValue()){
                candidates.clear();
                ma = ent.getValue();
                candidates.add(ent.getKey());
            } ma < ent.getValue() ma ent.getValue() ent.getValue ent {
                candidates.clear();
                ma = ent.getValue();
                candidates.add(ent.getKey());
            } candidates.clear() candidates.clear candidates ma = ent.getValue() ma ent.getValue() ent.getValue ent candidates.add(ent.getKey()) candidates.add candidates ent.getKey() ent.getKey ent Collections.sort(candidates) Collections.sort Collections candidates for(String can : candidates){
        System.out.println(can);
      } String can candidates {
        System.out.println(can);
      } {
        System.out.println(can);
      } System.out.println(can) System.out.println System.out System System.out can public class Main {
    Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        new Main().run();
    }

    void run() {
        int inp_num = Integer.parseInt(sc.next());
        HashMap<String, Integer> m = new HashMap<String, Integer>();
        for (int i = 0; i < inp_num; i++) {
            String s = sc.next();
            if (m.containsKey(s)) {
                m.put(s, m.get(s) + 1);
            } else {
                m.put(s, 1);
            }
        }
        int ma = -1;
        ArrayList<String> candidates = new ArrayList<>();
        for (Entry<String, Integer> ent : m.entrySet()) {
            if(ma == ent.getValue()){
                candidates.add(ent.getKey());
            }else if(ma < ent.getValue()){
                candidates.clear();
                ma = ent.getValue();
                candidates.add(ent.getKey());
            }
      }
      Collections.sort(candidates);
      for(String can : candidates){
        System.out.println(can);
      }
  }
} public class Main {
    Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        new Main().run();
    }

    void run() {
        int inp_num = Integer.parseInt(sc.next());
        HashMap<String, Integer> m = new HashMap<String, Integer>();
        for (int i = 0; i < inp_num; i++) {
            String s = sc.next();
            if (m.containsKey(s)) {
                m.put(s, m.get(s) + 1);
            } else {
                m.put(s, 1);
            }
        }
        int ma = -1;
        ArrayList<String> candidates = new ArrayList<>();
        for (Entry<String, Integer> ent : m.entrySet()) {
            if(ma == ent.getValue()){
                candidates.add(ent.getKey());
            }else if(ma < ent.getValue()){
                candidates.clear();
                ma = ent.getValue();
                candidates.add(ent.getKey());
            }
      }
      Collections.sort(candidates);
      for(String can : candidates){
        System.out.println(can);
      }
  }
} Main
import java.awt.geom.Point2D;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Scanner;
import java.util.Map.Entry;
import java.util.function.BiFunction;
import java.util.function.Function;
import java.util.function.Supplier;

public class Main {
    Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        new Main().run();
    }

    void run() {
        int inp_num = Integer.parseInt(sc.next());
        HashMap<String, Integer> m = new HashMap<String, Integer>();
        for (int i = 0; i < inp_num; i++) {
            String s = sc.next();
            if (m.containsKey(s)) {
                m.put(s, m.get(s) + 1);
            } else {
                m.put(s, 1);
            }
        }
        int ma = -1;
        ArrayList<String> candidates = new ArrayList<>();
        for (Entry<String, Integer> ent : m.entrySet()) {
            if(ma == ent.getValue()){
                candidates.add(ent.getKey());
            }else if(ma < ent.getValue()){
                candidates.clear();
                ma = ent.getValue();
                candidates.add(ent.getKey());
            }
      }
      Collections.sort(candidates);
      for(String can : candidates){
        System.out.println(can);
      }
  }
}