// 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.8046133208363735x):
//#pragma GCC         optimize("O3")

#include            <bits/stdc++.h>

#include            <ext/pb_ds/assoc_container.hpp>

#include            <ext/pb_ds/tree_policy.hpp>

#define FastIO      ios_base::sync_with_stdio(0);cin.tie(0),cout.tie(0)

#define pb          push_back

#define mp          make_pair

#define mem(x,i)    memset(x,i,sizeof(x))

#define ff          first

#define ss          second

#define popcount(x) __builtin_popcount(x)

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

#define Case(t)     for(int ks=1;ks<=t;ks++)

#define fileout     freopen("output.txt","w",stdout)

#define filein      freopen("input.txt","r",stdin)

#define D(x)        cerr<< __LINE__ <<": "<< #x << " = "<<(x) <<'\n';

#define endl        '\n'



using namespace std;

using namespace __gnu_pbds;



using ll  = long long;

using ld  = long double;

using ull = unsigned long long;

using pii = pair<int,int>;

using pll = pair<ll,ll>;

using pil = pair<int,ll>;



const int INF    = 0x3f3f3f3f;

const ll LL_INF  = 0x3f3f3f3f3f3f3f3f;

const double PI  = acos(-1);

const double eps = 1e-4;

const int mod    = 1e9+7;

const int mx     = 5e5+5;

template <typename T>  using orderedSet =

    tree<T, null_type, less_equal<T>,

    rb_tree_tag, tree_order_statistics_node_update>;//find_by_order,order_of_key*/



/*------------------------------Graph Moves----------------------------*/

//const int fx[]= {+1,-1,+0,+0};

//const int fy[]= {+0,+0,+1,-1};

//const int fx[]={+0,+0,+1,-1,-1,+1,-1,+1};   // Kings Move

//const int fy[]={-1,+1,+0,+0,+1,+1,-1,-1};  // Kings Move

//const int fx[]={-2, -2, -1, -1,  1,  1,  2,  2};  // Knights Move

//const int fy[]={-1,  1, -2,  2, -2,  2, -1,  1}; // Knights Move

/*---------------------------------------------------------------------*/



//ll powmod(ll a,ll b){ll res=1;a%=mod;assert(b>=0);for(; b; b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}

/*----------------------BitMask-----------------------------------------*/

//inline int setBit(int N,int pos){return N=N | (1<<pos);}

//inline int resetBit(int N,int pos){return N= N & ~(1<<pos);}

//inline bool checkBit(int N,int pos){return (bool) (N& (1<<pos));}

int arr[mx];

int main()

{

    int n;

    cin>>n;

    map<string,int>mm;

    map<int,string>m2;

    int cur=1;

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

    {

        string str;

        cin>>str;

        if(mm[str]==0) {mm[str]=cur;m2[cur]=str;cur++;}

        arr[mm[str]]++;

    }

    int val=0;

    for(int i=1;i<cur;i++) val=max(val,arr[i]);

    vector<string>ans;

    for(int i=1;i<cur;i++) if(arr[i]==val) ans.pb(m2[i]);

    sort(all(ans));

    for(string s:ans) cout<<s<<endl;



}