// Slower C++ solution:
#include <iostream>

#include <cstdio>

#include <cmath>

#include <cstring>

#include <algorithm>



using namespace std;



const int N = 200010;



void QuickSort(char s[][11], int l, int h)

{

    int i = l;

    int j = h;

    char t[11],d[11];

    strcpy(t,s[(l+h)/2]);

        while (i <= j)

        {

            while(strcmp(s[j],t)>0)     

            j--;

            while(strcmp(s[i],t)<0)      

            i++;

            if(i<=j)

            {

                strcpy(d,s[i]);

                strcpy(s[i],s[j]);

                strcpy(s[j],d);

                i++;

                j--;

            }

        }    

        if(l<j) QuickSort(s, l, j);     

        if(i<h) QuickSort(s, i, h);    

    

}

int main()

{

	int i,j,n,a[N]={0},b=0,q=0;

	char s[N][11],t[11];

	scanf("%d",&n);

	for(i=0;i<n;i++)

	scanf("%s",s[i]);

	QuickSort(s,0, n-1);

	

    for(j=0;j<n;j++)

	{

		if(strcmp(s[j],s[j+1])==0)

		{

			a[j-b]++;

			b=a[j-b];

		}

		else

		{

			if(a[j-b]>q)

			q=a[j-b];

			b=0;

		}

	}

	

	for(i=0;i<n;i++)

	{

		if(a[i]==q)

		printf("%s\n",s[i]);

	}



return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.7480568859102732x):
//                                 Alisher_2211

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        # include <bits/stdc++.h>

# define  long          long long

# define  all(vc)       vc.begin(),vc.end()

# define  allr(vc)      vc.rbegin(),vc.rend()

# define  pb            push_back

# define  fi            first 

# define  se            second

# define  pi            pair <long, long>    

# define  lcm(a, b)     (a * b) / __gcd(a, b)

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        using namespace std;

const long N = 100100;

void read(){freopen("input.txt" , "r" , stdin );freopen("output.txt", "w" , stdout );}

void solve(){

    long n;

    cin >> n;

    string s[n + 1];

    map <string, long> mp, us;

    for (int i = 0; i < n; ++i){

        cin >> s[i];

        mp[ s[i] ] ++;

    }

    long mx = 0;

    for (int i = 0; i < n; ++i){

        mx = max(mx, mp[ s[i] ]);

    }

    vector <string > v;

    for (int i = 0; i < n; ++i){

        if( mp[ s[i] ] == mx && us[ s[i] ] == 0 )

        v.pb(s[i]), us[ s[i] ] ++;

    }

    sort( all(v) );

    for (int i = 0; i < v.size(); ++i){

        cout << v[i] << '\n';

    }

}

int32_t main(){

ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); 

        long T = 1;

        //cin >> T;

        while( T-- ){

            solve();

            cout<<'\n';

        }

cerr << "\nTime elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";

}