Problem:
Score: 300 points

Problem Statement

We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i written on it.

Print all strings that are written on the most number of votes, in lexicographical order.

Constraints

1 \leq N \leq 2 \times 10^5

S_i (1 \leq i \leq N) are strings consisting of lowercase English letters.

The length of S_i (1 \leq i \leq N) is between 1 and 10 (inclusive).

Input

Input is given from Standard Input in the following format:

N
S_1
:
S_N

Output

Print all strings in question in lexicographical order.

Sample Input 1

7
beat
vet
beet
bed
vet
bet
beet

Sample Output 1

beet
vet

beet and vet are written on two sheets each, while beat, bed, and bet are written on one vote each. Thus, we should print the strings beet and vet.

Sample Input 2

8
buffalo
buffalo
buffalo
buffalo
buffalo
buffalo
buffalo
buffalo

Sample Output 2

buffalo

Sample Input 3

7
bass
bass
kick
kick
bass
kick
kick

Sample Output 3

kick

Sample Input 4

4
ushi
tapu
nichia
kun

Sample Output 4

kun
nichia
tapu
ushi

Solution in C++14 (GCC 5.4.1) (judge verdict: Runtime Error)

#pragma once
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>

typedef long long ll;
#define all(x) (x).begin(), (x).end()  // sortなどの引数を省略
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define max3(x, y, z) max(x, max(y, z))

#ifdef _MSC_FULL_VER  //デバッグ出力
#define dout cout
#define debug() if (true)
#define check(x) std::cout << "★" << #x << "の値:" << (x) << endl
#define pass(x) std::cout << "☆" << x << endl
#else
#define dout \
  if (false) cout
#define debug() if (false)
#define check(x) \
  if (false) cout << "★" << #x << "の値:" << (x) << endl
#define pass(x) \
  if (false) cout << "☆" << x << endl
#endif
using namespace std;
int main() {
  int N;
  string tmp;
  int ans = 0;
  cin >> N;
  int flag = 0;
  int used = 0;
  int max = 0;
  int answerused = 0;
  int ax = 0;
  vector<string> list(N);
  vector<int> count(N);

  for (int i = 0; i < N; i++) {
    cin >> tmp;
    flag = 0;  //過去に入力があったか？
    for (int j = 0; j < N; j++) {
      dout << "☆え(" << j << ":" << list[j] << ")" << endl;
      if (list[j] == tmp) {
        count[j]++;
        if (count[j] > max) {
          pass("あ");
          max = count[j];
          ax = 0;
        } else if (count[j] == max) {
          pass("い");
          ax++;
        }
        pass("う");
        flag = 1;
      }
    }
    if (flag == 0) {
      pass("お");
      if (max == 0) {
        pass("か");
        max = 1;
        ax = 1;
      }
    }
    list[used] = tmp;
    count[used] = 1;
    used++;
  }
  check(ax);
  dout << "-------集計結果--------\n";
  rep(i, used) dout << count[i] << "\t" << list[i] << "\n";
  dout << "-------end debug-------\n";

  check(ax);
  vector<string> answer(ax + 1);

  string qwe;
  for (int i = 0; i < N; i++) {
    dout << i << endl;
    if (count[i] == max) {
      dout << i << "-" << answerused << endl;
      qwe = list[i];
      pass("=");
      answer[answerused] = qwe;
      answerused++;
    }
  }
  dout << "-------answerの現状----------\n";
  check(answerused);
  rep(i, answerused) dout << answer[i] << "\n";
  dout << "-------end debug-------\n";
  sort(all(answer));
  dout << "-------answerの現状----------\n";
  check(answerused);
  rep(i, answerused) dout << answer[i] << "\n";
  dout << "-------end debug-------\n";
  for (int i = 0; i < answerused; i++) {
    cout << answer[i] << endl;
  }
  return 0;
}
/*
//よく使うやつ
int N;
cin >> N;
vector<int> list(N);
for (int i = 0; i < N; i++) {
  cin >> list[i];
}
// for文
for (int i = 0; i < N; i++) {
}
//配列
vector<int> vec;
vec.at(i)
vector<vector<int>> vec(10, vector<int>(10));
sort(all(vec));
sort(all(vec), greater<int>());
    //配列の内容表示
dout << "====vecの内容====\n";
for (int i = 0; i < N; i++) dout << vec[i] << endl;
dout << "====ここまで====\n";
*/