stablegradients/pie-gem5-bysrc huggingface dataset:
// Original C++ solution (slower):
#include <iostream>

#include<cstdlib>

#include<queue>

#include<set>

#include<vector>

#include<string>

#include<cmath>

#include<algorithm>

#include<stack>

#include<map>

#include<deque>

#include<cstdio>

#include<cstdio>

#include<time.h>

using namespace std;

#define rep(i,a) for(int i=0;i<a;i++)

#define pd(a,n) for(int i=0;i<n;i++)cout<<a[i]<<((i==n-1)?"\n":" ")

#define pdd(a,n,m)for(int i=0;i<m;i++)pd(a,m)

#define mp make_pair

#define pb push_back

#define ll __int64

#define __int64 long long

#define P pair<int,int>

#define PP pair<P,int>



int n;

string t[222222];

map<string,int>ta;



int main(){

  cin>>n;

  rep(i,n)cin>>t[i];

  rep(i,n)ta[t[i]]++;

  int ma=-1;

  rep(i,n)ma=max(ma,ta[t[i]]);

  for(map<string,int>::iterator it=ta.begin();it!=ta.end();it++){

    string key=(*it).first;

    int value=(*it).second;

    if(value==ma)cout<<key<<endl;

  }



  return 0;

}


// Optimized solution to the same problem (faster):
#include<algorithm>//sort,二分探索,など

#include<bitset>//固定長bit集合

#include<cmath>//pow,logなど

#include<complex>//複素数

#include<deque>//両端アクセスのキュー

#include<functional>//sortのgreater

#include<iomanip>//setprecision(浮動小数点の出力の誤差)

#include<iostream>//入出力

#include<map>//map(辞書)

#include<numeric>//iota(整数列の生成),gcdとlcm(c++17)

#include<queue>//キュー

#include<set>//集合

#include<stack>//スタック

#include<string>//文字列

#include<utility>//pair

#include<list>

#include<vector>//可変長配列

using namespace std;

#define rep(i,a) for(int i=0;i<a;i++)

#define mp make_pair

#define pb push_back

#define ll __int64

#define __int64 long long

#define P pair<int,int>

#define PP pair<P,int>

#define F first

#define S second

int dx[8] = { 1,0,-1,0,1,-1,-1,1 };

int dy[8] = { 0,1,0,-1,1,1,-1,-1 };





int n;

map<string, int>ta;



int main() {

    cin >> n;

    rep(i, n) {

        string s;

        cin >> s;

        ta[s]++;

    }



    int cnt = -1;

    for (auto it = ta.begin(); it != ta.end(); it++) {

        cnt = max(cnt, (*it).second);

    }

    for (auto it = ta.begin(); it != ta.end(); it++) {



        if(cnt==(*it).second)

        cout << (*it).first << endl;



    }



    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#define first f

#define second s

#define ll long long

#define mp make_pair

#define pb push_back

#define pf push_front

#define lb lower_bound

#define ub upper_bound

#include <bits/stdc++.h>

#define pii pair<int,int>

#define mem(a,b) memset(a,b,sizeof(a))

using namespace std;

const int maxn=2e5+5;

const double PI=acos(-1);

const double e=2.718281828459;



map<string,int>MP;

string s[maxn];

map<string,bool>p;

int main()

{

    int n,mx=-1;

    scanf("%d",&n);

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

        cin>>s[i];

        MP[s[i]]++;

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

    }

    sort(s+1,s+n+1);

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

        if(MP[s[i]]==mx&&p[s[i]]==false){

            cout<<s[i]<<endl;p[s[i]]=true;

        }

    }

    return 0;

}


// Optimized solution to the same problem (faster):
#define first f

#define second s

#define ll long long

#define mp make_pair

#define pb push_back

#define pf push_front

#define lb lower_bound

#define ub upper_bound

#include <bits/stdc++.h>

#define pii pair<string,int>

#define mem(a,b) memset(a,b,sizeof(a))

using namespace std;

const int maxn=2e5+5;

const double PI=acos(-1);

const double e=2.718281828459;



map<string,int>MP;

string s;

vector<pii>v;



int main()

{

    int n,mx=-1,j;

    scanf("%d",&n);

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

        cin>>s;

        mx=max(mx,++MP[s]);

    }

    for(auto it=MP.begin();it!=MP.end();it++){

        j=it->second;

        if(j==mx){

            v.pb(mp(it->first,j));

        }

    }

    sort(v.begin(),v.end());

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

        cout<<v[i].f<<endl;

    }

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#define first f

#define second s

#define ll long long

#define mp make_pair

#define pb push_back

#define pf push_front

#define lb lower_bound

#define ub upper_bound

#include <bits/stdc++.h>

#define pii pair<int,int>

#define mem(a,b) memset(a,b,sizeof(a))

using namespace std;

const int maxn=2e5+5;

const double PI=acos(-1);

const double e=2.718281828459;



map<string,int>MP;

string s[maxn];

set<string>S;



int main()

{

    int n,mx=-1;

    scanf("%d",&n);

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

        cin>>s[i];

        MP[s[i]]++;

        S.insert(s[i]);

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

    }

    for(auto it=S.begin();it!=S.end();it++){

        if(MP[*it]==mx){

            cout<<*it<<endl;

        }

    }

    return 0;

}


// Optimized solution to the same problem (faster):
#define first f

#define second s

#define ll long long

#define mp make_pair

#define pb push_back

#define pf push_front

#define lb lower_bound

#define ub upper_bound

#include <bits/stdc++.h>

#define pii pair<string,int>

#define mem(a,b) memset(a,b,sizeof(a))

using namespace std;

const int maxn=2e5+5;

const double PI=acos(-1);

const double e=2.718281828459;



map<string,int>MP;

string s;

vector<pii>v;



int main()

{

    int n,mx=-1,j;

    scanf("%d",&n);

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

        cin>>s;

        mx=max(mx,++MP[s]);

    }

    for(auto it=MP.begin();it!=MP.end();it++){

        j=it->second;

        if(j==mx){

            v.pb(mp(it->first,j));

        }

    }

    sort(v.begin(),v.end());

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

        cout<<v[i].f<<endl;

    }

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include<algorithm>

#include<string>

#include<vector>

#include<cmath>

#include<map>

#include<limits>

//include<bits/stdc++.h>

using namespace std;

int main()

{

	int N;

	cin >> N;

	map<string, int>frequency;

	int max = 0;

	string tmp;

	vector<string>most_vote;

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

	{

		cin >> tmp;

		if (frequency.find(tmp) != frequency.end())

		{

			frequency[tmp]++;

		}

		else

			frequency[tmp] = 1;

		if (frequency[tmp] > max)

			max = frequency[tmp];

	}

	map<string, int>::iterator it;



	for (it = frequency.begin(); it != frequency.end(); it++)

	{

		if (it->second == max)

			most_vote.push_back(it->first);

	}

	sort(most_vote.begin(), most_vote.end());

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

		cout << most_vote[i] << endl;

}

// Optimized solution to the same problem (faster):
#include<cstdio>

#include<cstdlib>

#include<cstring>

#include<algorithm>

using namespace std;

int cmp(const void*a,const void*b)

{

    return strcmp((char*)a,(char*)b);

}

char s[200005][15];

int main()

{

    int n;

    int i;

    int cnt;

    int mmax;

    scanf("%d",&n);

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

    {

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

    }

    qsort(s,n,sizeof(s[0]),cmp);

    cnt=1;

    mmax=-1;

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

    {

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

        {

            cnt++;

        }

        else

        {

            mmax=max(cnt,mmax);

            cnt=1;

        }

    }

    mmax=max(cnt,mmax);

    cnt=1;

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

    {

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

        {

            cnt++;

        }

        else

        {

            if(cnt==mmax)puts(s[i]);

            cnt=1;

        }

    }

    if(cnt==mmax)puts(s[n-1]);

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

#define sz(x) ((int)x.size())

#define pb push_back

#define ii pair<int,int>

#define ppb pop_back

#define orta ((bas+son)>>1)

#define st first

#define nd second

#define ll long long

#define N 200005

#define inf 1000000000

#define MOD 1000000007

#define LOG 20

#define EPS 0.000000001

#define M 305

using namespace std;



map<string,int> mp;

int n;

int mx;



int main() {



	ios_base::sync_with_stdio(0);

	cin.tie(0);cout.tie(0);



	cin>>n;

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

		string s;

		cin>>s;

		mp[s]++;

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

	}

	vector<string> a;

	for(auto x:mp) {

		if(x.nd==mx) a.pb(x.st);

	}

	sort(a.begin(),a.end());

	for(auto x:a) 

		cout<<x<<"\n";



}

// Optimized solution to the same problem (faster):
#include<cstdio>

#include<cstdlib>

#include<cstring>

#include<algorithm>

using namespace std;

int cmp(const void*a,const void*b)

{

    return strcmp((char*)a,(char*)b);

}

char s[200005][15];

int main()

{

    int n;

    int i;

    int cnt;

    int mmax;

    scanf("%d",&n);

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

    {

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

    }

    qsort(s,n,sizeof(s[0]),cmp);

    cnt=1;

    mmax=-1;

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

    {

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

        {

            cnt++;

        }

        else

        {

            mmax=max(cnt,mmax);

            cnt=1;

        }

    }

    mmax=max(cnt,mmax);

    cnt=1;

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

    {

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

        {

            cnt++;

        }

        else

        {

            if(cnt==mmax)puts(s[i]);

            cnt=1;

        }

    }

    if(cnt==mmax)puts(s[n-1]);

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;

#define endl              "\n"

#define pb              push_back

#define fir               first

#define sec               second

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

#define sz(v)            ((int)((v).size()))

#define ll              long long

#define ld              long double

#define lp(i, n)        for(int i = 0 ; (int)i<n ; i++)

#define loop(i, x, n)       for(int i=x ; (int)i<=n ; i++)

#define isPowerOfTwo(s) (!(s & (s-1)))

typedef vector<int> vi;

typedef deque<int> de;

void origi() {

    ios_base::sync_with_stdio(false);

    cin.tie(nullptr), cout.tie(nullptr);

}

map<string, int>m1;

map<int,string>m2;

void tiranga() {

    int n;

    string s;

    cin >> n;

    lp(i, n) {

        cin >> s;

        m1[s]++;

    }

    int Max = INT_MIN;

    for (auto mm:m1)

        Max = max(Max, mm.second);

    for(auto mm:m1){

        if (mm.second == Max)

            cout << mm.first << endl;

    }



}

int main() {

#ifndef ONLINE_JUDGE

    //freopen("input.txt", "r", stdin);

#else

#endif 

    origi();

    tiranga();

    //cout << sumOfDig(123654);

   // genLarge(10, 10);

   // genSmall(10);

   

}


// Optimized solution to the same problem (faster):
#include<cstdio>

#include<cstdlib>

#include<cstring>

#include<algorithm>

using namespace std;

int cmp(const void*a,const void*b)

{

    return strcmp((char*)a,(char*)b);

}

char s[200005][15];

int main()

{

    int n;

    int i;

    int cnt;

    int mmax;

    scanf("%d",&n);

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

    {

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

    }

    qsort(s,n,sizeof(s[0]),cmp);

    cnt=1;

    mmax=-1;

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

    {

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

        {

            cnt++;

        }

        else

        {

            mmax=max(cnt,mmax);

            cnt=1;

        }

    }

    mmax=max(cnt,mmax);

    cnt=1;

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

    {

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

        {

            cnt++;

        }

        else

        {

            if(cnt==mmax)puts(s[i]);

            cnt=1;

        }

    }

    if(cnt==mmax)puts(s[n-1]);

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;



bool fun( string word , string  word_1 )

{

    if( word < word_1 )

        return 1 ;

    else

        return 0 ;

}



int main()

{

    int num;

    cin>>num;

    map<string,int> map_1;

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

    {

        string word;

        cin>>word;

        map_1[word]++;

    }

    int max_1=0;

    for( auto it : map_1 )

    {

        max_1=max( max_1  , it.second );

    }

    vector<string> word_1;

    for( auto it : map_1)

    {

        if( it.second == max_1 )

            word_1.push_back( it.first );

    }

    sort( word_1.begin() , word_1.end() , fun );

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

    {

        cout<<word_1[i]<<endl;

    }

    return 0;

}


// Optimized solution to the same problem (faster):
#include<cstdio>

#include<cstdlib>

#include<cstring>

#include<algorithm>

using namespace std;

int cmp(const void*a,const void*b)

{

    return strcmp((char*)a,(char*)b);

}

char s[200005][15];

int main()

{

    int n;

    int i;

    int cnt;

    int mmax;

    scanf("%d",&n);

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

    {

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

    }

    qsort(s,n,sizeof(s[0]),cmp);

    cnt=1;

    mmax=-1;

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

    {

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

        {

            cnt++;

        }

        else

        {

            mmax=max(cnt,mmax);

            cnt=1;

        }

    }

    mmax=max(cnt,mmax);

    cnt=1;

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

    {

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

        {

            cnt++;

        }

        else

        {

            if(cnt==mmax)puts(s[i]);

            cnt=1;

        }

    }

    if(cnt==mmax)puts(s[n-1]);

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <bits/stdc++.h>

using namespace std;

multiset<string>vc;

map<string,int>mp;

int main()

{





    int n;

    cin>>n;

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



        string str;

        cin>>str;

        vc.insert(str);



    }

for(auto it=vc.begin(); it!=vc.end();it++ )



       {

           mp[*it]++;

       }

int maxi=0;



for(auto it=mp.begin();it!=mp.end();it++){



maxi=max(it->second,maxi);





}



for(auto it=mp.begin();it!=mp.end();it++){



if(it->second==maxi)cout<<it->first<<endl;}



















    return 0;

}

// Optimized solution to the same problem (faster):
#include<cstdio>

#include<cstdlib>

#include<cstring>

#include<algorithm>

using namespace std;

int cmp(const void*a,const void*b)

{

    return strcmp((char*)a,(char*)b);

}

char s[200005][15];

int main()

{

    int n;

    int i;

    int cnt;

    int mmax;

    scanf("%d",&n);

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

    {

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

    }

    qsort(s,n,sizeof(s[0]),cmp);

    cnt=1;

    mmax=-1;

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

    {

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

        {

            cnt++;

        }

        else

        {

            mmax=max(cnt,mmax);

            cnt=1;

        }

    }

    mmax=max(cnt,mmax);

    cnt=1;

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

    {

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

        {

            cnt++;

        }

        else

        {

            if(cnt==mmax)puts(s[i]);

            cnt=1;

        }

    }

    if(cnt==mmax)puts(s[n-1]);

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;

int main() {

    int n, mx = 0;

    cin >> n;

    map<string, int> freq;

    set<string> st;

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

        string s;

        cin >> s;

        if (++freq[s] > mx) {

            mx = freq[s];

            st.clear();

            st.insert(s);

        } else if (freq[s] == mx) {

            st.insert(s);

        }

    }

    for (auto s: st) 

        cout << s << endl;

    return 0;

}

// Optimized solution to the same problem (faster):
#include<cstdio>

#include<cstdlib>

#include<cstring>

#include<algorithm>

using namespace std;

int cmp(const void*a,const void*b)

{

    return strcmp((char*)a,(char*)b);

}

char s[200005][15];

int main()

{

    int n;

    int i;

    int cnt;

    int mmax;

    scanf("%d",&n);

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

    {

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

    }

    qsort(s,n,sizeof(s[0]),cmp);

    cnt=1;

    mmax=-1;

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

    {

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

        {

            cnt++;

        }

        else

        {

            mmax=max(cnt,mmax);

            cnt=1;

        }

    }

    mmax=max(cnt,mmax);

    cnt=1;

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

    {

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

        {

            cnt++;

        }

        else

        {

            if(cnt==mmax)puts(s[i]);

            cnt=1;

        }

    }

    if(cnt==mmax)puts(s[n-1]);

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#pragma GCC positionimize(3,"Otrst","inline")

//#include "emplace.hpp"

#include<bits/stdc++.h>



using namespace std;

typedef long long ll;

const int N=2e5+10;

const int INF=0x3f3f3f;

const double pi = 3.141592653;

const double E = 2.71828182846;

const ll mod=1e9+7;

const int M=1e4+5;

const double eps=1e-8;

#define ci(x) scanf("%d",&x)

#define co(x) printf("%d\n",x)

inline int read()

{

    int f=1,x=0;

    char c=getchar();

    while(c<'0' || c>'9')

    {

        if(c=='-')

            f=-1;

        c=getchar();

    }

    while(c>='0' && c<='9')

    {

        x=x*10+c-'0';

        c=getchar();

    }

    return f*x;

}

map<string,int>ma;

map<string ,int>::iterator it;

int main()

{

    ios::sync_with_stdio(false);

    int max_fre=0;

    string s;

    int n;

    cin>>n;

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

    {

        cin>>s;

        ma[s]++;

        max_fre=max(max_fre,ma[s]);

    }

    for(it=ma.begin();it!=ma.end();it++)

    {

        if(it->second == max_fre)

            cout<<it->first<<endl;

    }

    return 0;

}




// Optimized solution to the same problem (faster):
#include<cstdio>

#include<cstdlib>

#include<cstring>

#include<algorithm>

using namespace std;

int cmp(const void*a,const void*b)

{

    return strcmp((char*)a,(char*)b);

}

char s[200005][15];

int main()

{

    int n;

    int i;

    int cnt;

    int mmax;

    scanf("%d",&n);

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

    {

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

    }

    qsort(s,n,sizeof(s[0]),cmp);

    cnt=1;

    mmax=-1;

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

    {

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

        {

            cnt++;

        }

        else

        {

            mmax=max(cnt,mmax);

            cnt=1;

        }

    }

    mmax=max(cnt,mmax);

    cnt=1;

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

    {

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

        {

            cnt++;

        }

        else

        {

            if(cnt==mmax)puts(s[i]);

            cnt=1;

        }

    }

    if(cnt==mmax)puts(s[n-1]);

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

#include<map>



using namespace std;



map<string, int> cnt;



int main()

{

    int t;

    cin >> t;

    

    int d = 0;

    while(t --)

    {

        string s;

        cin >> s;

        cnt[s] ++;

        d = max(d, cnt[s]);

    }

    

    for(auto p : cnt)

        if(p.second == d)

            cout << p.first << endl;

    return 0;

}

// Optimized solution to the same problem (faster):
#include<cstdio>

#include<cstdlib>

#include<cstring>

#include<algorithm>

using namespace std;

int cmp(const void*a,const void*b)

{

    return strcmp((char*)a,(char*)b);

}

char s[200005][15];

int main()

{

    int n;

    int i;

    int cnt;

    int mmax;

    scanf("%d",&n);

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

    {

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

    }

    qsort(s,n,sizeof(s[0]),cmp);

    cnt=1;

    mmax=-1;

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

    {

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

        {

            cnt++;

        }

        else

        {

            mmax=max(cnt,mmax);

            cnt=1;

        }

    }

    mmax=max(cnt,mmax);

    cnt=1;

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

    {

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

        {

            cnt++;

        }

        else

        {

            if(cnt==mmax)puts(s[i]);

            cnt=1;

        }

    }

    if(cnt==mmax)puts(s[n-1]);

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <algorithm>

#include <string>

#include <math.h>

#include <cstdint>

#include <sstream>

#include <map>

#include <cstring>

#include <vector>

#include <queue>

#include <iomanip>



using namespace std;

typedef long long ll;



ll ans, mx, sum, mn = 1e8, cnt;



string c[200001];

ll idx;

int main(){

	ll n;

	cin>>n;

	map<string,ll> mp;

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

		string s;

		cin>>s;

		mp[s]++;

	}

	for(auto i : mp){

		mx = max(mx,i.second);

	}

	for(auto i : mp){

		if(i.second==mx) c[idx++]=i.first;

	}

	sort(c,c+idx);

	for(ll i=0; i<idx; i++){ 

		cout<<c[i]<<endl;

	}

	

}

// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>

using namespace std;



typedef long long ll;



int main(void)

{

    //freopen("input.txt", "r", stdin);



    int i, n;

    cin >> n;

    string a;

    map <string, int> m;

    vector <string> v;



    int cntt = 1;

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

    {

        cin >> a;



        auto it = m.find(a);

        if(it != m.end())

        {

            m[a]++;

            if(m[a] > cntt)

                cntt = m[a];

        }

        else

        {

            m.insert(make_pair(a, 1));

        }

    }



    for(auto it = m.begin(); it != m.end(); it++)

    {

        if(it->second == cntt)

            cout << it->first << "\n";

    }



    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>



using namespace std;



int c[200005];



string s[200005];



int main()

{

    string str;

    int n,a=0,b=1;

    cin>>n;

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

    {

        cin>>s[i];

    }



    sort(s,s+n);



    str=s[0];

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

    {

        if(s[i]!=str)

        {

            str=s[i];

            c[a]=b;

            a++;

            b=1;

        }

        else

        {

            b++;

        }

    }

    c[a]=b;

    sort(c,c+a+1);





    int y=c[a],k=1;



    if(y==1)

    {

        cout<<s[0]<<endl;

    }

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

    {

        if(s[i-1]==s[i])

        {

            k++;

        }

        else

        {

            k=1;

        }

        if(k==y)

        {

            cout<<s[i]<<endl;

        }

    }



    return 0;

}

// Optimized solution to the same problem (faster):


#include <bits/stdc++.h>

#include<algorithm>

#include<cstring>

#include<cmath>

#include<cstdlib>

#include<string.h>

using namespace std;

#define pb push_back

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

#define  rep(i,n,v) for(i=n;i<v;i++)

#define per(i,n,v) for(i=n;i>v;i--)

#define ff first 

#define ss second 

#define pp pair<ll,ll>

#define ll  long long

#define endl '\n'

void solve()

{

  ll n, a,m=1,b=1, c,k=0, i, j,l=1e9+7;

  string s, r, y;

  cin>>n;

  vector<string>v;

  map<string,int>hash;

  rep(i,0,n) {cin>>s;hash[s]++;}

  for(auto x:hash)

  {

    if(x.ss>k)k=x.ss;

  }

  for(auto it=hash.begin();it!=hash.end();it++)

  {

    if(it->ss==k) cout<<it->ff<<endl;

  }

  /*rep(i,0,v.size()) hash[v[i]]++;

  int max_count = 0, res = -1; 



    for (auto i : hash) { 



        if (max_count < i.second) { 



            //res = i.first; 



            max_count = i.second; 



        } 



    }

    vector<string>vec;

    for (auto i : hash) { 



        if (max_count == i.second) { */

/*r=i.first;

sort(r.begin(),r. end());

            cout<<r<<endl;*/

            /*  vec. pb(i.first);



            max_count = i.second; 



        } }

        rep(i,0,vec.size()) cout<<vec[i]<<endl;*/

    

  /*sort(all(v));

  rep(i,0,v.size())

  {

    if(v[i]==v[i+1] && i+1<v.size()) {k++;continue;}

    if(k>m) {m=k;k=0;}

  }

  k=0;

  rep(i,0,v.size())

  {

    if(v[i]==v[i+1] && i+1<v.size()) {k++;continue;}

    if(k==m) {sort(v[i].begin(),v[i].end());cout<<v[i]<<endl;}

    k=0;

  }*/

  

  /*sort(r.begin(),r. end());

  cout<<r;*/

}

int main()

{

 ios_base::sync_with_stdio(false);

  cin. tie(0);cout. tie(0);

    ll t=1;

   //cin>>t;

    while(t--)

    {

      solve();

    }

    return 0;

}

// Fastest known solution for this problem: