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: Accepted)

#pragma GCC optimize ("O3")
#pragma GCC target ("avx")
//#include<bits/stdc++.h>
#include<cstdio>
#include<algorithm>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define Would
#define you
#define please

char C[2200010];
char *ci = C, ct;
void pakuri_sort(int N, ll A[], int ichi[]) {
	const int b = 8;
	ll tmp[200001];
	int tmp2[200001];
	rep(k, 6) {
		int kazu[1 << b] = {}, kazu2[1 << b] = {};
		rep(i, N) kazu[A[i] >> k * b & ((1 << b) - 1)]++;
		rep(i, (1 << b) - 1) kazu[i + 1] += kazu[i];
		for (int i = N - 1; i >= 0; i--) {
			tmp[--kazu[A[i] >> k * b & ((1 << b) - 1)]] = A[i];
			tmp2[kazu[A[i] >> k * b & ((1 << b) - 1)]] = ichi[i];
		}
		k++;
		rep(i, N) kazu2[tmp[i] >> k * b & ((1 << b) - 1)]++;
		rep(i, (1 << b) - 1) kazu2[i + 1] += kazu2[i];
		for (int i = N - 1; i >= 0; i--) {
			A[--kazu2[tmp[i] >> k * b & ((1 << b) - 1)]] = tmp[i];
			ichi[kazu2[tmp[i] >> k * b & ((1 << b) - 1)]] = tmp2[i];
		}
	}
}

int main() {
	//cin.tie(0);
	//ios::sync_with_stdio(false);

	fread(C, 1, 2200010, stdin);
	int N = 0;
	while ((ct = *ci++) >= '0') N = N * 10 + ct - '0';

	ll S[200000];
	int ichi[200001];
	rep(i, N) {
		ll s = 0;
		ichi[i] = ci - C;
		int k = 10;
		while ((ct = *ci++) >= 'a') {
			s = s * 27 + ct - '`';
			k--;
		}
		rep(i, k) s *= 27;
		S[i] = s;
	}
	pakuri_sort(N, S, ichi);
	int kazu = 0;
	int saidai = 0;
	ll mae = 0;
	rep(i, N) {
		if (S[i] != mae) {
			chmax(saidai, kazu);
			kazu = 1;
			mae = S[i];
		}
		else kazu++;
	}
	chmax(saidai, kazu);
	kazu = 0;
	mae = 0;
	
	rep(i, N) {
		if (S[i] != mae) {
			if (saidai == kazu) {
				char *tmp = C + ichi[i - 1];
				while (*tmp >= 'a') putchar_unlocked(*tmp++);
				putchar_unlocked('\n');
			}
			kazu = 1;
			mae = S[i];
		}
		else kazu++;
	}
	if (saidai == kazu) {
		char* tmp = C + ichi[N - 1];
		while (*tmp >= 'a') putchar_unlocked(*tmp++);
		putchar_unlocked('\n');
	}

	Would you please return 0;
}