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 (GCC 5.4.1) (judge verdict: Accepted)

// ABC 155-C
// 2020.2.16 bal4u

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define gc() getchar_unlocked()

int in() {   // 非負整数の入力
	int n = 0; int c;
	c = gc();
	do n = 10 * n + (c & 0xf); while ((c = gc()) >= '0');
	return n;
}

int ins(char *s) { // 文字列の入力　スペース以下の文字で入力終了
	char *p = s--;
	do *++s = gc();
	while (*s > ' ');
	*s = 0;
	return s - p;
}

// 文字列のハッシュ関数
#define HASHSIZ 2000081
typedef struct { char *s; int id; } HASH;
HASH hash[HASHSIZ+2], *hashend = hash + HASHSIZ;

int insert(char *s, int id) {
	unsigned long long i;
	int j;
	char *p;
	HASH *tp;

	i = 0, p = s;
	for (j = 0; *p && j < 10; j++) i = (i << 5) + (*p++ +1-'a');
	tp = hash + (int)(i % HASHSIZ);
	while (tp->s != NULL) {
		if (!strcmp(tp->s, s)) return tp->id;
		if (++tp == hashend) tp = hash;
	}
	tp->s = s, tp->id = id;
	return -1;
}

#define MAX 200005
typedef struct { char *p; int n; } T;
T tbl[MAX];
char S[MAX][12];
int K;

int cmp(const void *u, const void *v) {
	int r;
	if (r = ((T *)v)->n - ((T *)u)->n) return r;
	return strcmp(((T *)u)->p, ((T *)v)->p);
}

int main()
{
	int i, N;

	N = in();
	while (N--) {
		ins(tbl[K].p = S[K]);
		if ((i = insert(S[K], K)) < 0) tbl[K++].n = 1;
		else tbl[i].n++;
	}
	qsort(tbl, K, sizeof(T), cmp);
	puts(tbl[0].p);
	for (i = 1; i < K; ++i) {
		if (tbl[i].n != tbl[i-1].n) break;
		puts(tbl[i].p);
	}
	return 0;
}