import java.util.Scanner;
import java.util.Arrays;
import java.util.ArrayList;

public class Main {
  public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
    int N = scan.nextInt();
    String[] S = new String[N];
    for(int i=0; i<N; i++) {
      S[i] = scan.next();
    }
    scan.close();

    Arrays.sort(S);

    String before = S[0];
    ArrayList<String> maxString = new ArrayList<String>();
    int count = 0;
    int max = 0;
    for(int i=0; i<N; i++) {
      if(!before.equals(S[i])) {
        if(max == count) {
          maxString.add(before);
        }
        else if(max < count) {
          maxString.clear();
          maxString.add(before);
          max = count;
        }
        count = 1;
        before = S[i];
      }
      else {
        count++;
      }
    }
    if(max == count) {
      maxString.add(before);
    }
    else if(max < count) {
      maxString.clear();
      maxString.add(before);
    }

    for(int i=0; i<maxString.size(); i++) {
      System.out.println(maxString.get(i));
    }
  }
} import java.util.Scanner; Scanner java.util import java.util.Arrays; Arrays java.util import java.util.ArrayList; ArrayList java.util public class Main {
  public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
    int N = scan.nextInt();
    String[] S = new String[N];
    for(int i=0; i<N; i++) {
      S[i] = scan.next();
    }
    scan.close();

    Arrays.sort(S);

    String before = S[0];
    ArrayList<String> maxString = new ArrayList<String>();
    int count = 0;
    int max = 0;
    for(int i=0; i<N; i++) {
      if(!before.equals(S[i])) {
        if(max == count) {
          maxString.add(before);
        }
        else if(max < count) {
          maxString.clear();
          maxString.add(before);
          max = count;
        }
        count = 1;
        before = S[i];
      }
      else {
        count++;
      }
    }
    if(max == count) {
      maxString.add(before);
    }
    else if(max < count) {
      maxString.clear();
      maxString.add(before);
    }

    for(int i=0; i<maxString.size(); i++) {
      System.out.println(maxString.get(i));
    }
  }
} Main public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
    int N = scan.nextInt();
    String[] S = new String[N];
    for(int i=0; i<N; i++) {
      S[i] = scan.next();
    }
    scan.close();

    Arrays.sort(S);

    String before = S[0];
    ArrayList<String> maxString = new ArrayList<String>();
    int count = 0;
    int max = 0;
    for(int i=0; i<N; i++) {
      if(!before.equals(S[i])) {
        if(max == count) {
          maxString.add(before);
        }
        else if(max < count) {
          maxString.clear();
          maxString.add(before);
          max = count;
        }
        count = 1;
        before = S[i];
      }
      else {
        count++;
      }
    }
    if(max == count) {
      maxString.add(before);
    }
    else if(max < count) {
      maxString.clear();
      maxString.add(before);
    }

    for(int i=0; i<maxString.size(); i++) {
      System.out.println(maxString.get(i));
    }
  } main {
    Scanner scan = new Scanner(System.in);
    int N = scan.nextInt();
    String[] S = new String[N];
    for(int i=0; i<N; i++) {
      S[i] = scan.next();
    }
    scan.close();

    Arrays.sort(S);

    String before = S[0];
    ArrayList<String> maxString = new ArrayList<String>();
    int count = 0;
    int max = 0;
    for(int i=0; i<N; i++) {
      if(!before.equals(S[i])) {
        if(max == count) {
          maxString.add(before);
        }
        else if(max < count) {
          maxString.clear();
          maxString.add(before);
          max = count;
        }
        count = 1;
        before = S[i];
      }
      else {
        count++;
      }
    }
    if(max == count) {
      maxString.add(before);
    }
    else if(max < count) {
      maxString.clear();
      maxString.add(before);
    }

    for(int i=0; i<maxString.size(); i++) {
      System.out.println(maxString.get(i));
    }
  } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int N = scan.nextInt(); N scan.nextInt() scan.nextInt scan String[] S = new String[N]; S new String[N] N for(int i=0; i<N; i++) {
      S[i] = scan.next();
    } int i=0; int i=0; i 0 i<N i N i++ i++ i {
      S[i] = scan.next();
    } {
      S[i] = scan.next();
    } S[i] = scan.next() S[i] S i scan.next() scan.next scan scan.close() scan.close scan Arrays.sort(S) Arrays.sort Arrays S String before = S[0]; before S[0] S 0 ArrayList<String> maxString = new ArrayList<String>(); maxString new ArrayList<String>() int count = 0; count 0 int max = 0; max 0 for(int i=0; i<N; i++) {
      if(!before.equals(S[i])) {
        if(max == count) {
          maxString.add(before);
        }
        else if(max < count) {
          maxString.clear();
          maxString.add(before);
          max = count;
        }
        count = 1;
        before = S[i];
      }
      else {
        count++;
      }
    } int i=0; int i=0; i 0 i<N i N i++ i++ i {
      if(!before.equals(S[i])) {
        if(max == count) {
          maxString.add(before);
        }
        else if(max < count) {
          maxString.clear();
          maxString.add(before);
          max = count;
        }
        count = 1;
        before = S[i];
      }
      else {
        count++;
      }
    } {
      if(!before.equals(S[i])) {
        if(max == count) {
          maxString.add(before);
        }
        else if(max < count) {
          maxString.clear();
          maxString.add(before);
          max = count;
        }
        count = 1;
        before = S[i];
      }
      else {
        count++;
      }
    } if(!before.equals(S[i])) {
        if(max == count) {
          maxString.add(before);
        }
        else if(max < count) {
          maxString.clear();
          maxString.add(before);
          max = count;
        }
        count = 1;
        before = S[i];
      }
      else {
        count++;
      } !before.equals(S[i]) before.equals(S[i]) before.equals before S[i] S i {
        if(max == count) {
          maxString.add(before);
        }
        else if(max < count) {
          maxString.clear();
          maxString.add(before);
          max = count;
        }
        count = 1;
        before = S[i];
      } if(max == count) {
          maxString.add(before);
        }
        else if(max < count) {
          maxString.clear();
          maxString.add(before);
          max = count;
        } max == count max count {
          maxString.add(before);
        } maxString.add(before) maxString.add maxString before if(max < count) {
          maxString.clear();
          maxString.add(before);
          max = count;
        } max < count max count {
          maxString.clear();
          maxString.add(before);
          max = count;
        } maxString.clear() maxString.clear maxString maxString.add(before) maxString.add maxString before max = count max count count = 1 count 1 before = S[i] before S[i] S i {
        count++;
      } count++ count if(max == count) {
      maxString.add(before);
    }
    else if(max < count) {
      maxString.clear();
      maxString.add(before);
    } max == count max count {
      maxString.add(before);
    } maxString.add(before) maxString.add maxString before if(max < count) {
      maxString.clear();
      maxString.add(before);
    } max < count max count {
      maxString.clear();
      maxString.add(before);
    } maxString.clear() maxString.clear maxString maxString.add(before) maxString.add maxString before for(int i=0; i<maxString.size(); i++) {
      System.out.println(maxString.get(i));
    } int i=0; int i=0; i 0 i<maxString.size() i maxString.size() maxString.size maxString i++ i++ i {
      System.out.println(maxString.get(i));
    } {
      System.out.println(maxString.get(i));
    } System.out.println(maxString.get(i)) System.out.println System.out System System.out maxString.get(i) maxString.get maxString i String[] args args public class Main {
  public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
    int N = scan.nextInt();
    String[] S = new String[N];
    for(int i=0; i<N; i++) {
      S[i] = scan.next();
    }
    scan.close();

    Arrays.sort(S);

    String before = S[0];
    ArrayList<String> maxString = new ArrayList<String>();
    int count = 0;
    int max = 0;
    for(int i=0; i<N; i++) {
      if(!before.equals(S[i])) {
        if(max == count) {
          maxString.add(before);
        }
        else if(max < count) {
          maxString.clear();
          maxString.add(before);
          max = count;
        }
        count = 1;
        before = S[i];
      }
      else {
        count++;
      }
    }
    if(max == count) {
      maxString.add(before);
    }
    else if(max < count) {
      maxString.clear();
      maxString.add(before);
    }

    for(int i=0; i<maxString.size(); i++) {
      System.out.println(maxString.get(i));
    }
  }
} public class Main {
  public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
    int N = scan.nextInt();
    String[] S = new String[N];
    for(int i=0; i<N; i++) {
      S[i] = scan.next();
    }
    scan.close();

    Arrays.sort(S);

    String before = S[0];
    ArrayList<String> maxString = new ArrayList<String>();
    int count = 0;
    int max = 0;
    for(int i=0; i<N; i++) {
      if(!before.equals(S[i])) {
        if(max == count) {
          maxString.add(before);
        }
        else if(max < count) {
          maxString.clear();
          maxString.add(before);
          max = count;
        }
        count = 1;
        before = S[i];
      }
      else {
        count++;
      }
    }
    if(max == count) {
      maxString.add(before);
    }
    else if(max < count) {
      maxString.clear();
      maxString.add(before);
    }

    for(int i=0; i<maxString.size(); i++) {
      System.out.println(maxString.get(i));
    }
  }
} Main
import java.util.Scanner;
import java.util.Arrays;
import java.util.ArrayList;

public class Main {
  public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
    int N = scan.nextInt();
    String[] S = new String[N];
    for(int i=0; i<N; i++) {
      S[i] = scan.next();
    }
    scan.close();

    Arrays.sort(S);

    String before = S[0];
    ArrayList<String> maxString = new ArrayList<String>();
    int count = 0;
    int max = 0;
    for(int i=0; i<N; i++) {
      if(!before.equals(S[i])) {
        if(max == count) {
          maxString.add(before);
        }
        else if(max < count) {
          maxString.clear();
          maxString.add(before);
          max = count;
        }
        count = 1;
        before = S[i];
      }
      else {
        count++;
      }
    }
    if(max == count) {
      maxString.add(before);
    }
    else if(max < count) {
      maxString.clear();
      maxString.add(before);
    }

    for(int i=0; i<maxString.size(); i++) {
      System.out.println(maxString.get(i));
    }
  }
}