#include "bits/stdc++.h"

using namespace std;
////////////////////////////

int main(){
    map<string,int>scores;
    int n;
    cin>>n;
    while(n--){
        string name;
        cin>>name;
        scores[name]++;
    }
    map<string,int>::iterator it;
    string winner;int goals=0;
    for(it=scores.begin();it!=scores.end();it++){
        if(it->second>goals){
            winner=it->first;
            goals=it->second;
        }
    }
    cout<<winner<<endl;
    return 0;
}


#include <iostream>
#include <cstring>
#include <cmath>
using namespace std;

int main()
{
    int n;
    int a[26];
    while(cin>>n)
    {
        for(int i=0;i<26;i++)
            a[i]=0;
        for(int i=0;i<n;i++)
        {
            char s[100];
            cin>>s;
            int len=strlen(s);
           for(int j=0;j<len;j++)
           {
               a[s[j]-'A']++;
           }
        }
        int maxindex=a[0];
        for(int i=1;i<26;i++)
        {
            if(a[i]>a[maxindex])
                maxindex=a[i];
        }
       for(int i=0;i<26;i++)
       {
           if(a[i]==maxindex)
            cout<<char(i+'A');
       }
       cout<<endl;
    }
    return 0;
}


#include <iostream>
#include<cstring>
using namespace std;
int main()
{
    string s;
    string t[2],temp;
    int score[2];
    score[0]=0;
    score[1]=0;
    int n;
    cin>>n;
    for(int i=0;i<n;i++)
    {
        cin>>s;
        temp=s;
        if(score[0]==0)
        {
             t[0]=temp;
             score[0]++;
             continue;
        }
        else if(score[1]==0)
        {
            t[1]=temp;
            score[1]++;
            continue;
        }
        else{
            if(temp==t[0])score[0]++;
            else score[1]++;
        }
    }
    if(score[0]>score[1])cout<<t[0]<<endl;
    else cout<<t[1]<<endl;
    return 0;
}


#include <iostream>
#include <stdio.h>

using namespace std;

int main()
{
    int n,m=0,f=0;
    char c;
    scanf("%d%c",&n,&c);
    //string ss;
    if (n==1) {
        string ss;
        cin>>ss;
        cout<<ss<<endl;
        return 0;
    }
    string *s=new string[n];
    int *ma=new int[n];
    //char c;
    //cin>>c;
    for (int i=0;i<n;i++){
        getline(cin,s[i]);
        //cin>>c;
        ma[i]=0;
        //cout<<s[i]<<"#"<<endl;
    }
    for(int i=0;i<n;i++){
        for(int j=0;j<n;j++){
            if (s[j]==s[i]) ma[i]++;
        }
    }
    m=ma[0];
    for (int i=0;i<n;i++){
        if(ma[i]>m) m=ma[i];
    }
    //cout<<m<<endl;
    cout<<s[m]<<endl;
    return 0;
}


#include <iostream>
#include <string>
using namespace std;

class Table {
public:
	string name;
	int count;
	Table(string name = "") {
		this->name = name;
		count = 1;
	}
	void add() {
		count++;
	}
};

int main()
{
	int n, k = 0, find = 0;
	string name;
	Table t[1000];
	cin >> n;
	for (int i = 0; i < n; i++)
	{
		cin >> name;
		find = 0;
		for (int j = 0; j < k; j++)
			if (t[j].name == name)
			{
				t[j].add();
				find++;
			}
		if (!find)
			t[k] = Table(name);
	}
	int maxc = 0;
	for (int i = 0; i < k; i++)
		if (t[i].count > maxc)
		{
			maxc = t[i].count;
			name = t[i].name;
		}
	cout << name << endl;

	return 0;
}


#include <iostream>
#include <string>
#include <cmath>
using namespace std;

int main()
{
	int n;
	string team1,team2,str;
	int teamscore[2]={1,0};
	cin>>n;
	cin>>team1;
	for(int i=1;i<n;i++)
    {
        cin>>str;
        if(str!=team1)
        {
            team2=str;
            teamscore[1]++;
        }
        else{teamscore[0]++;}
    }
    str=(teamscore[0]>teamscore[1])?team1:team2;
    cout<<str<<endl;
}


#include<string>
#include<iostream>
using namespace std;
int main()
{
    string line[100],s1,s2;
    int N,k=0,i,m=0,n=0;
    cin>>N;
    while(N>0)
    {
        cin>>line[k];
        k++;
        N--;
    }
    s1=line[0];
    for(i=0;i<k;i++)
    {
     if(s1==line[i])
            m++;
     else
     {
         s2=line[i];
        n++;
     }
    }
    if(m>n)
        cout<<s1<<endl;
    else
        cout<<s2<<endl;

    return 0;
}


#include <iostream>
#include<cstring>
using namespace std;
int main()
{
    string t[2],temp;
    int score[2];
    score[0]=0;
    score[1]=0;
    int n;
    cin>>n;
    for(int i=0;i<n;i++)
    {
        cin>>temp;
        if(score[0]==0)
        {
             t[0]=temp;
             score[0]++;
             continue;
        }
        else if(score[1]==0)
        {
            t[1]=temp;
            score[1]++;
            continue;
        }
        else{
            if(temp==t[0])score[0]++;
            else score[1]++;
        }
    }
    if(score[0]>score[1])cout<<t[0]<<endl;
    else cout<<t[1]<<endl;
    return 0;
}


#include <iostream>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <map>

using namespace std;

map<string, int>mp;

int main()
{
    int n;
    cin >> n;
    string str;
    for(int i = 0; i < n; i++)
    {
        cin >> str;
        mp[str]++;
    }
     map<string,int>::iterator it;
     int max = 0;
     string temp;
     for(it = mp.begin(); it != mp.end(); it++)
     {
         if(it->second > max)
         {
             max = it->second;
             temp = it->first;
         }
     }
     cout << temp << endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
map<string,int>record;

int main()
{
    int n;
    string str;
    scanf("%d",&n);
    for(int i=0;i<n;i++)
    {
        cin>>str;
        record[str]++;
    }
    int result=0;
    string src;
    map<string,int>::iterator it;
    for(it=record.begin();it!=record.end();it++)
    {
        if(it->second>result)
          {
              src=it->first;
              result=it->second;
          }
    }
    cout<<src<<endl;
    return 0;
}


#include <iostream>
#include <cstring>

using namespace std;

int main()
{
    int n;
    char t[100];
    char t1[100] = " ";
    char t2[100] = " ";
    int flag = 0;
    int t1s = 0, t2s = 0;
    cin >> n;
    for (int i = 0; i < n; i++)
    {
        cin >> t;
        if (strcmp(t, t1) == 0)
        {
            t1s++;
        }
        else if (strcmp(t, t2) == 0)
        {
            t2s++;
        }
        else
        {
            if (flag == 0)
            {
                strcpy(t1, t);
            }
            else
            {
                strcpy(t2, t);
            }
        }
    }
    if (t1s > t2s)
    {
        cout << t1;
    }
    else
    {
        cout << t2;
    }
    cout << endl;
    return 0;
}


#include <iostream>
#include <string>

using namespace std;
/*class Team{
private:
    int num;
    string team1;
    string team2;
    int n1;
    int n2;
public:
    void readnum();
    bool retnum();
    void readcase():
};
void Team::readnum(){
    cin>> num;
}
bool Team::retnum(){
    num=num-1;
    if(num != -1){
        return true;
    }
    else{
        return false;
    }
}
void Team::readcase(){
    cin>> team1;

}*/
int main(){
    int num;
    string team1;
    string team2;
    string team3;
    int n1;
    int n2;
    n1=0;
    n2=0;
    cin>> num;
    cin>> team1;
    n1++;
    num--;
    while(num != 0){
        cin>> team3;
        if(team3!=team1){
            team2=team3;
            n2++;
        }
        else{
            n1++;
        }
        num--;
    }
    if(n1>n2){
        cout<< team1;
    }
    else{
        cout<< team2;
    }
    return 0;
}


#include<stdio.h>
#include<string.h>
int main()
{ int n,pp,i,k=0,k2=0;
char s[11],s2[11],s3[11];
freopen("input.in","r",stdin);
freopen("output.out","w",stdout);
scanf("%d%s",&n,&s);
pp=1;
for(i=2;i<=n;i++)
   scanf("%s",&s2);
   if(strcmp(s2,s)==0)
      k++;
   else
      if(pp==1)
	 {strcpy(s3,s2);
	 pp++;
	 }
      else
	 if(strcmp(s3,s2)==0)
	    k2++;
if(k==0&&k2==0)
   printf("%s",s);
else
if(k>k2)
  printf("%s",s);
else
  printf("%s",s3);
return 0;
}


#include<iostream.h>
#include<string.h>
int main()
{ int n,pp,i,k=0,k2=0;
char s[11],s2[11],s3[11];

cin>>n>>s;
pp=1;
for(i=2;i<=n;i++)
   {cin>>s2;
   if(strcmp(s2,s)==0)
      k++;
   else
      if(pp==1)
	 {strcpy(s3,s2);
	 pp++;
	 }
      else
	 if(strcmp(s3,s2)==0)
	    k2++;
   }
if(k==0&&k2==0)
   cout<<s;
else
if(k>k2)
  cout<<s;
else
  cout<<s3;
return 0;
}


# include <iostream.h>
# include <string.h>
int main()
{ int n,pp,i,k=0,k2=0;
char s[11],s2[11],s3[11];

cin>>n>>s;
pp=1;
for(i=2;i<=n;i++)
   {cin>>s2;
   if(strcmp(s2,s)==0)
      k++;
   else
      if(pp==1)
	 {strcpy(s3,s2);
	 pp++;
	 }
      else
	 if(strcmp(s3,s2)==0)
	    k2++;
   }
if(k==0&&k2==0)
   cout<<s;
else
if(k>k2)
  cout<<s;
else
  cout<<s3;
return 0;
}


#include<fstream.h>
#include<string.h>
int main()
{ int n,pp,i,k=0,k2=0;
char s[11],s2[11],s3[11];
ifstream f("input.in");
ofstream g("output.out");
f>>n>>s;
pp=1;
for(i=2;i<=n;i++)
   {f>>s2;
   if(strcmp(s2,s)==0)
      k++;
   else
      if(pp==1)
	 {strcpy(s3,s2);
	 pp++;
	 }
      else
	 if(strcmp(s3,s2)==0)
	    k2++;
   }
if(k==0&&k2==0)
   g<<s;
else
if(k>k2)
  g<<s;
else
  g<<s3;
return 0;
}


#include <stdio.h>
#include <string.h>
int main()
{ int n,pp,i,k=0,k2=0;
char s[11],s2[11],s3[11];
freopen("input.in","r",stdin);
freopen("output.out","w",stdout);
scanf("%d%s",&n,&s);
pp=1;
for(i=2;i<=n;i++)
   {scanf("%s",&s2);
   if(strcmp(s2,s)==0)
      k++;
   else
      if(pp==1)
	 {strcpy(s3,s2);
	 pp++;
	 }
      else
	 if(strcmp(s3,s2)==0)
	    k2++;
   }
if(k==0&&k2==0)
   printf("%s",s);
else
if(k>k2)
  printf("%s",s);
else
  printf("%s",s3);
return 0;
}


#include <stdio.h>
#include <string.h>
int main()
{ int n,pp,i,k=0,k2=0;
char s[11],s2[11],s3[11];
freopen("input.in","r",stdin);
freopen("output.out","w",stdout);
scanf("%d%s",&n,&s);
pp=1;
for(i=2;i<=n;i++)
   {scanf("%s",&s2);
   if(strcmp(s2,s)==0)
      k++;
   else
      if(pp==1)
	 {strcpy(s3,s2);
	 pp++;
	 }
      else
	 if(strcmp(s3,s2)==0)
	    k2++;
   }
if(k==0&&k2==0)
   printf("%s\n",s);
else
if(k>k2)
  printf("%s\n",s);
else
  printf("%s\n",s3);
return 0;
}


#include <iostream.h>
#include <string.h>
int main()
{ int n,pp,i,k=0,k2=0;
char s[11],s2[11],s3[11];

cin>>n>>s;
pp=1;
for(i=2;i<=n;i++)
   {cin>>s2;
   if(strcmp(s2,s)==0)
      k++;
   else
      if(pp==1)
	 {strcpy(s3,s2);
	 pp++;
	 }
      else
	 if(strcmp(s3,s2)==0)
	    k2++;
   }
if(k==0&&k2==0)
   cout<<s;
else
if(k>k2)
  cout<<s;
else
  cout<<s3;
return 0;
}


#include <iostream>
#include <string.h>
using namespace std;
int main()
{ int n,pp,i,k=0,k2=0;
char s[11],s2[11],s3[11];

cin>>n>>s;
pp=1;
for(i=2;i<=n;i++)
   {cin>>s2;
   if(strcmp(s2,s)==0)
      k++;
   else
      if(pp==1)
	 {strcpy(s3,s2);
	 pp++;
	 }
      else
	 if(strcmp(s3,s2)==0)
	    k2++;
   }
if(k==0&&k2==0)
   cout<<s;
else
if(k>k2)
  cout<<s;
else
  cout<<s3;
return 0;
}


#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main()
{
    int a,c=1;
    cin>>a;
    string b[a];
    for(int i=0;i<a;i++) {
    cin>>b[i];
    }
    if(a==1) cout<<b[0]<<endl;
    else
    {

    sort(b,b+a);
    for(int i=0;i<a;i++)
    {
        if(b[i]==b[i+1]) c++;
        else break;
    }
    if(c>(a-c)) cout<<b[0]<<endl;
    else cout<<b[a-1]<<endl;
}
    return 0;
}


#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main()
{
    int a,c=1;
    cin>>a;
    string b[a];
    for(int i=0;i<a;i++) {
    cin>>b[i];
    }
        sort(b,b+a);

    if(a==1||a==2) cout<<b[0]<<endl;
    else
    {

    for(int i=0;i<a;i++)
    {
        if(b[i]==b[i+1]) c++;
        else break;
    }
    if(c>(a-c)) cout<<b[0]<<endl;
    else cout<<b[a-1]<<endl;
}
    return 0;
}


#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main()
{
    int a,c=1,v=0;
    cin>>a;
    string b[a];
    for(int i=0;i<a;i++) {
    cin>>b[i];
    }
    sort(b,b+a);
    for(int i=1;i<a;i++)
    {
        if(b[i]==b[i-1]) v++;
    }
    if(v==a-1) cout<<b[0]<<endl;
    else
    {

    for(int i=0;i<a;i++)
    {
        if(b[i]==b[i+1]) c++;
        else break;
    }
    if(c>(a-c)) cout<<b[0]<<endl;
    else cout<<b[a-1]<<endl;
}
    return 0;
}


#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main()
{
    int a,c=1;
    cin>>a;
    string b[a];
    for(int i=0;i<a;i++) {
    cin>>b[i];
    }
    sort(b,b+a);
    for(int i=0;i<a;i++)
    {
        if(b[i]==b[i+1]) c++;
        else break;
    }
    if(c>(a-c)) cout<<b[0]<<endl;
    else cout<<b[a-1]<<endl;

    return 0;
}


#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main()
{
	int a,c=1;
	cin>>a;
	string b[a];
	for(int i=0;i<a;i++) {
	cin>>b[i];
	}
	if(a==1) cout<<b[0]<<endl;
	else
	{

	sort(b,b+a);
	for(int i=0;i<a;i++)
	{
		if(b[i]==b[i+1]) c++;
		else break;
	}
	if(c>(a-c)) cout<<b[0]<<endl;
	else cout<<b[a-1]<<endl;
}
	return 0;
}


#include<iostream>
using namespace std;

int main(void)
{
    string s,s1,s2;
    int i,n, a= 0, b = 0;
    cin >> n >> s;
    s1 = s;
    a++;
    for ( i = 1; i < n; i++){
        cin >> s;
        if ( s == s1)
           a++;
        else
            b++;
    }
    if ( a > b)
       cout << s1;
    else
        cout << s2;

    return 0;
}


#include<iostream>
using namespace std;

int main(void)
{

    string s,s1 = "",s2 = "";
    int i,n, a= 0, b = 0;
    cin >> n >> s;
    s1 = s;
    a++;
    for ( i = 1; i < n; i++){
        cin >> s;
        if ( s == s1)
           a++;
        else
            b++;
    }
    if ( a > b)
       cout << s1;
    else
        cout << s2;

    return 0;
}


#include<iostream>
using namespace std;

int main(void)
{
    int n, a = 0, b = 0;
    string s1 = "", s2 = "";
    string s;
    cin >> n;
    while ( n--){
          cin >> s;
          if ( s1 == ""){
             s1 = s;
             a++;
          }
          if ( s == s1)
             a++;
          else
              b++;
    }
    if ( a > b )
       cout << s1;
    else
        cout << s2;

    return 0;
}


#include<iostream>
using namespace std;

int main(void)
{
    string s,s1 = "",s2 = "";
    int i,n, a= 0, b = 0;
    cin >> n >> s;
    s1 = s;
    a++;
    for ( i = 1; i < n; i++){
        cin >> s;
        if ( s == s1)
           a++;
        else
            b++;
    }
    if ( a > b)
       cout << s1;
    else
        cout << s2;

    return 0;
}


#include<iostream>
using namespace std;

int main(void)
{
    string s,s1 = "",s2 = "";
    int i,n, a= 0, b = 0;
    cin >> n >> s;
    s1 = s;
    a++;
    for ( i = 1; i < n; i++){
        cin >> s;
        if ( s == s1)
           a++;
        else{
            s2 = s;
            b++;
        }
    }
    if ( a > b)
       cout << s1;
    else
        cout << s2;

    return 0;
}


#include<iostream>
using namespace std;

int main(void)
{
    string s = "",s1 = "",s2 = "";
    int i,n, a= 0, b = 0;
    cin >> n >> s;
    s1 = s;
    a++;
    for ( i = 1; i < n; i++){
        cin >> s;
        if ( s == s1)
           a++;
        else
            b++;
    }
    if ( a > b)
       cout << s1;
    else
        cout << s2;

    return 0;
}


#include <iostream>
#include <map>
#include <cmath>
using namespace std;
int main(){
	map<string,int> mp;
	map<string,int>::iterator it;
	int n; string s;
	cin>>n;
	for(int i=0;i<n; i++){
		cin>>s;
		mp[s]++;
	}
	if(mp.size()>1){
		it=mp.begin();
	int a=it->second;
	it++;
	int b=it->second;
	it--;
	if(a>b){
		cout<<it->first;
	}
	else{
		it++;
		cout<<it->first;
	}
	}
	else cout<<s;

}


#include <iostream>
#include <map>
#include <cmath>
using namespace std;
int main(){
	map<string,int> mp;
	map<string,int>::iterator it;
	int n; string s;
	cin>>n;
	for(int i=0;i<n; i++){
		cin>>s;
		mp[s]++;
	}
	it=mp.begin();
	if(it->second>++it->second){
		it--;
		cout<<it->first;
	}
	else{
		cout<<it->first;
	}
}


#include <iostream>
#include <map>
#include <cmath>
using namespace std;
int main(){
	map<string,int> mp;
	map<string,int>::iterator it;
	int n; string s;
	cin>>n;
	for(int i=0;i<n; i++){
		cin>>s;
		mp[s]++;
	}
	it=mp.begin();
	int a=it->second;
	it++;
	int b=it->second;
	it--;
	if(a>b){
		cout<<it->first<<" "<<it->second;
	}
	else{
		it++;
		cout<<it->first;
	}
}


#include <iostream>
#include <map>
#include <cmath>
using namespace std;
int main(){
	map<string,int> mp;
	map<string,int>::iterator it;
	int n; string s;
	cin>>n;
	for(int i=0;i<n; i++){
		cin>>s;
		mp[s]++;
	}
	if(mp.size()>1){
		it=mp.begin();
	int a=it->second;
	it++;
	int b=it->second;
	it--;
	if(a>b){
		cout<<it->first<<" "<<it->second;
	}
	else{
		it++;
		cout<<it->first;
	}
	}
	else cout<<s;

}


#include<stdio.h>
#include<ctype.h>
#include <stdio.h>
#include <string.h>
#include <iostream>
using namespace std;
int main()
{
	char str[111][100];
	char ch[100];
	int num[111];
	int n,m,i,j,k,l;
	while(~scanf("%d",&n))
	{
		memset(num,0,sizeof(num));
		k=0;
		for(i=0;i<n;i++)
		{
			m=1;
			scanf("%s",ch);
			for(j=0;j<k;j++)
			if(!strcmp(ch,str[j]))
			{
				m=0;
				num[j]++;
				break;
			}
			if(m)
			{
				int len=strlen(ch);
				for(j=0;j<=len;j++)
				{
					str[k][j]=ch[j];
				}
				k++;
			}
		}
		m=0;
		int max=0;
		for(i=0;i<k;i++)
		if(num[i]>max)
		{
			m=i;
			max=num[i];
		}
		printf("%s\n",str[m]);
	}
}/*2017-08-07 19:19:37.9*/


#include <cstdio>
#include <algorithm>
#include <cstring>
#include <map>
#include <string>
using namespace std;

map < string,int> mp;
char s[110][15];
int main(){
    int n;
    scanf("%d",&n);
    for(int i=0;i<n;i++){
        scanf("%s",s[i]);
        mp[s[i]]++;
    }
    int MAX = 0;
    for(int i=0;i<n;i++)
        MAX = max(MAX,mp[s[i]]);
    for(int i=0;i<n;i++){
        if(mp[s[i]] == MAX){
            printf("%s\n",s[i]);
            return 0;
        }
    }
    return 0;
}
/*2017-08-07 19:03:25.752*/


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <algorithm>
using namespace std;
#define N 1005
#define MAXMAXN 1e15;

char a[105][15], ch[15];
int num[105], n, top, maxn, maxi, i, j, flag;

int main()
{
    top = -1;
    memset(num, 0, sizeof(num));

    scanf("%d", &n);
    for (i = 0; i < n; i++)
    {
        scanf("%s", ch);
        flag = 0;
        for (j = 0; j <= top; j++)
        {
            if (strcmp(ch, a[j]) == 0)
            {
                flag = 1;
                num[j]++;
                break;
            }
        }
        if (!flag)
        {
            strcpy(a[++top], ch);
        }
    }
    maxn = -1, maxi = -1;
    for (i = 0; i <= top; i++)
    {
        if (num[i] > maxn)
        {
            maxn = num[i];
            maxi = i;
        }
    }
    puts(a[maxi]);
}
/*2017-08-07 19:08:11.178*/


#include<stdio.h>
#include<ctype.h>
#include <stdio.h>
#include <string.h>
#include <iostream>
using namespace std;
int main()
{
	char str[111][100];
	char ch[100];
	int num[111];
	int n,m,i,j,k;
	while(~scanf("%d",&n))
	{
		memset(num,0,sizeof(num));
		k=0;
		for(i=0;i<n;i++)
		{
			m=1;
			scanf("%s",ch);
			for(j=0;j<k;j++)
			if(strcmp(ch,str[j]))
			{
				m=0;
				num[j++];
				break;
			}
			if(m)
			{
				strcpy(str[k++],ch);
			}
		}
		m=0;
		int max=0;
		for(i=0;i<k;i++)
		if(num[i]>max)
		{
			m=i;
			max=num[i];
		}
		printf("%s\n",str[m]);
	}
}/*2017-08-07 19:12:46.468*/


#include <iostream>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include<string>
#include<map>
#define N 1000010
#define mod 100000000
using namespace std;

map<string ,int > mp;
map<string ,int >::iterator it;
int main()
{
    int n;
    scanf("%d",&n);
    string s;

    string anss;
    int ans=0;
    for (int i=0;i<n;++i)
    {
        cin>>s;
        mp[s]++;
        if (mp[s]>ans)
        {
            anss=s;
            ans=mp[s];
        }
    }

    cout<<anss<<endl;

    return 0;
}
/*2017-08-07 19:05:40.153*/


#include<iostream>
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<cstring>
#include<set>
#include<queue>
#include<vector>
#include<vector>
#include<map>
using namespace std;
char s[105][105];
int num[105];
int  main()
{
    int i,j,n,t;
    char a[105];
    while(~scanf("%d",&n))
    {
        t=0;
        memset(num,0,sizeof(num));
        for(i=0;i<n;i++)
        {
            int flag=0;
            scanf("%s",a);
            for(j=0;j<t;j++)
                if(strcmp(a,s[j])==0)
                {
                    break;
                }
            if(j==t) strcpy(s[t],a),num[t]++,t++;
            else num[j]++;
        }
        int maxx=-1;
        int q;
        for(i=0;i<t;i++)
        {
            if(num[i]>maxx) maxx=num[i],q=i;

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

    return 0;
}/*2017-08-07 19:26:30.773*/


#include<algorithm>
#include<stdio.h>
#include <string.h>
#define N 110
using namespace std;
int main()
{
	char s[N],a[N][N];
	int b[N];
	int n,top=0;
	scanf("%d",&n);
	while(n--)
	{
		scanf("%s",s);
		int flag=0;
		for(int i=0;i<top;i++)
			if(strcmp(a[i],s)==0)
				{b[i]++;flag=1;break;}
		if(flag==0)
			strcpy(a[top],s),b[top]=1,top++;
	}
	int max=0,x=0;
	for(int i=0;i<top;i++)
		if(b[i]>max) {max=b[i];x=i;}
	puts(a[x]);

}/*2017-08-07 19:14:01.996*/


#include<bits/stdc++.h>
using namespace std;
int main(){
int n,m=0,e=0;
string r,l;
cin>>n>>l;
for (int k=2; k<=n; k++){
 cin>>r;
 if (r!=l) e++;
}
 if (n-e>e)
 cout<<l;
 else cout<<r;

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
int n,m=0,e=0;
string r,l;
cin>>n>>l;
for (int k=0; k<n-1; k++){
 cin>>r;
 if (r!=l) e++;
}
 if (n-e>e)
 cout<<l;
 else cout<<r;

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
int n,m=0,e=0;
string r,l;
cin>>n>>r;
l=r;
for (int k=0; k<n-1; k++){
 cin>>r;
 if (r!=l) e++;
}
 if (n-e>e)
 cout<<r;
 else cout<<l;

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
int n,m=0,e=0;
string r,l;
cin>>n>>l;
for (int k=0; k<n-1; k++){
 cin>>r;
 if (r!=l) e++;
}
 if (n-e>e)
 cout<<r;
 else cout<<l;

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
int n,m=0,e=0;
string r,l;
cin>>n;
string a[n];
for (int k=0; k<n; k++)
 cin>>a[k];

r=a[0];
for (int k=0; k<n; k++){
 if (a[k]!=r){
  e++; l=a[k];
}
 else
 m++;
}
if (e>m) cout<<l;
else cout<<r;

    return 0;
}


#include<iostream>
#include<string>
using namespace std;
int main()
{
    int n;
    while(cin>>n)
    {
        string *p;int *b;int i,j,k,count;
        b=new int[n];
        p=new string[n];cin>>p[0];b[0]=1;
        for(i=1;i<n;i++)
        {
            cin>>p[i];
            for(j=0;j<=i;j++)
            {
                if(p[i]==p[j]){b[j]++;break;}
                else
                    b[i]=1;
            }
        }
        count=0;
         for(k=1;k<n;k++)
         {if(b[k]>count)
         count=b[k];
         else
         continue;
         }
         cout<<p[count]<<endl;

    }
    return 0;

}


#include<string>
#include<iostream>
#include<stdio.h>
using namespace std;
int main()
{
    int n;
    while(cin>>n)
    {
        string s1,s2,s3;
        int k1,k2;
        cin>>s1;k1++;
        cin>>s2;k2++;
        cin>>s3;
        if(s1==s2)k1++;
        else k2++;
        if(k1>k2)cout<<s1<<endl;
        else cout<<s2<<endl;

    }
    return 0;

}


#include<string>
#include<iostream>
#include<stdio.h>
using namespace std;
int main()
{
    int n;
     cin>>n;

        string s1,s2,s3;
        int k1,k2;
        cin>>s1;k1++;
        cin>>s2;k2++;
        cin>>s3;
        if(s1==s2)k1++;
        else k2++;
        if(k1>k2)cout<<s1<<endl;
        else cout<<s2<<endl;
    return 0;

}


#include<string>
#include<iostream>
#include<stdio.h>
using namespace std;
int main()
{
    int n;
     cin>>n;

        string s1,s2,s3;
        int k1,k2;
        cin>>s1;k1++;
        cin>>s2;k2++;
        cin>>s3;
        if(s1==s3)k1++;
        else k2++;
        if(k1>k2)cout<<s1<<endl;
        else cout<<s2<<endl;
    return 0;

}


#include<string>
using namespace std;
int main()
{
    int n;
    while(cin>>n)
    {
        string s1,s2,s3;
        int k1,k2;
        cin>>s1;k1++;
        cin>>s2;k2++;
        cin>>s3;
        if(s1==s2)k1++;
        else k2++;
        if(k1>k2)cout<<s1<<endl;
        else cout<<s2<<endl;

    }
    return 0;

}


#include<iostream>
#include<string>
using namespace std;
int main()
{
    int n;
    while(cin>>n)
    {
        string *p;int *b;int i,j,k,count,x=0;
        b=new int[n];
        p=new string[n];cin>>p[0];b[0]=1;
        for(i=1;i<n;i++)
        {
            cin>>p[i];
            for(j=0;j<=i;j++)
            {
                if(p[i]==p[j]){b[j]++;break;}
                else
                    b[i]=1;
            }
        }
        count=0;
         for(k=1;k<n;k++)
         {if(b[k]>count)
         { count=b[k];x=k;}
         else
         continue;
         }
         cout<<p[x]<<endl;

    }
    return 0;

}


#include<iostream>
#include<string>
#include<stdio.h>
using namespace std;
int main()
{
    int n,i,count=1;
    cin>>n;
    string p;
    string b,k;
    cin>>b;
    for(i=0;i<n-1;i++)
    {
        cin>>p;
        if(p==b)
            count++;
        else k=p;
    }
    if(2*count>n)
        cout<<b<<endl;
    else

        cout<<k<<endl;
    return 0;
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <iostream>
#include <string.h>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <fstream>
#define inf (long long)1e15
#define MAX_N  25

using namespace std;

int main()
{

   int n;
   cin >> n;
   vector <string> a(n);
   for(int i = 0; i < n; i++)cin >> a[i];
   sort(a.begin(), a.end());
   int maxx = -232323;
   int index = 0;
   for(int i = 0; i < n - 1; i++)
   {
       int k = 1;
       int j = 0;
       bool flag = 0;
       while(a[i] == a[i + 1] && i+1 < n)
       {
            k++;
            i++;
            flag = 1;
       }
       if(flag)i--;
       if(k > maxx){ maxx = k; index = i + 1;}
   }
   cout << a[index] << endl;

}


#include <vector>
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main()
{
   int n;
   cin >> n;
   vector <string> a(n);
   for(int i = 0; i < n; i++)cin >> a[i];
   sort(a.begin(), a.end());
   int index = 0;
   int maxxx = -1;
   int cnt = 1;
   for(int i = 0; i < n; i++)
   {
       if(i + 1 < n)
       {
           if(a[i] == a[i + 1]){ cnt++; }
           else
            {
                if(cnt > maxxx){maxxx = cnt; index = i;}
                cnt = 1;
            }
       }
   }
   cout << a[index] << endl;
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <iostream>
#include <string.h>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <fstream>
#define inf (long long)1e15
#define MAX_N  25

using namespace std;

int main()
{

   int n;
   cin >> n;
   vector <string> a(n);
   for(int i = 0; i < n; i++)cin >> a[i];
   sort(a.begin(), a.end());
   int maxx = -232323;
   int index = 0;
   for(int i = 0; i < n; i++)
   {
       int k = 1;
       int j = 0;
       bool flag = 0;
       while(a[i] == a[i + 1] && i+1 < n)
       {
            k++;
            i++;
            flag = 1;
       }
       if(flag)i--;
       if(k > maxx){ maxx = k; index = i + 1;}
   }
   cout << a[index] << endl;

}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <iostream>
#include <string.h>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <fstream>
#define inf (long long)1e15
#define MAX_N  25

using namespace std;

int main()
{

   int n;
   cin >> n;
   vector <string> a[n];
   for(int i = 0; i < n; i++)cin >> a[i];
   sort(a, a + n);
   int maxx = -232323;
   int index = 0;
   for(int i = 0; i < n; i++)
   {
       int k = 1;
       int j = 0;
       bool flag = 0;
       while(a[i] == a[i + 1] && i+1 < n)
       {
            k++;
            i++;
            flag = 1;
       }
       if(flag)i--;
       if(k > maxx){ maxx = k; index = i;}
   }
   cout << a[index] << endl;

}


#include <vector>
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main()
{
   int n;
   cin >> n;
   vector <string> a(n);
   for(int i = 0; i < n; i++)cin >> a[i];
   sort(a.begin(), a.end());
   int index = 0;
   int maxxx = 0;
   int cnt = 1;
   for(int i = 0; i < n; i++)
   {
       if(i + 1 < n)
       {
           if(a[i] == a[i + 1]){ cnt++; }
           else
            {
                if(cnt > maxxx){maxxx = cnt; index = i;}
                cnt = 1;
            }
       }
   }
   cout << a[index] << endl;
}


#include <vector>
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main()
{
   int n;
   cin >> n;
   vector <string> a(n);
   for(int i = 0; i < n; i++)cin >> a[i];
   sort(a.begin(), a.end());
   int index = 0;
   int maxxx = 1;
   int cnt = 1;
   for(int i = 0; i < n; i++)
   {
       if(i + 1 < n)
       {
           if(a[i] == a[i + 1]){ cnt++;}
           else
            {

                cnt = 1;
            }
            if(cnt > maxxx){maxxx = cnt; index = i;}
       }
   }
   cout << a[index] << endl;
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <iostream>
#include <string.h>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <fstream>
#define inf (long long)1e15
#define MAX_N  25

using namespace std;

int main()
{

   int n;
   cin >> n;
   vector <string> a(n);
   for(int i = 0; i < n; i++)cin >> a[i];
   sort(a.begin(), a.end());
   int maxx = -232323;
   int index = 0;
   for(int i = 0; i < n; i++)
   {
       int k = 1;
       int j = 0;
       bool flag = 0;
       while(a[i] == a[i + 1] && i+1 < n)
       {
            k++;
            i++;
            flag = 1;
       }
       if(flag)i--;
       if(k > maxx){ maxx = k; index = i;}
   }
   cout << a[index] << endl;

}


#include <vector>
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main()
{
   int n;
   cin >> n;
   vector <string> a(n);
   for(int i = 0; i < n; i++)cin >> a[i];
   sort(a.begin(), a.end());
   int maxx = -232323;
   int index = 0;
   for(int i = 0; i < n; i++)
   {
       int k = 1;
       int j = 0;
       bool flag = 0;
       while(a[i] == a[i + 1] && i+1 < n)
       {
            k++;
            i++;
            flag = 1;
       }
       if(flag)i--;
       if(k > maxx){ maxx = k; index = i;}
   }
   cout << a[index] << endl;
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <iostream>
#include <string.h>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <fstream>
#include <windows.h>
#define inf (long long)1e15
#define MAX_N  25

using namespace std;

int main()
{

   int n;
   cin >> n;
   string a[n];
   for(int i = 0; i < n; i++)cin >> a[i];
   sort(a, a + n);
   int maxx = -232323;
   int index = 0;
   for(int i = 0; i < n; i++)
   {
       int k = 1;
       int j = 0;
       bool flag = 0;
       while(a[i] == a[i + 1] && i+1 < n)
       {
            k++;
            i++;
            flag = 1;
       }
       if(flag)i--;
       if(k > maxx){ maxx = k; index = i;}
   }
   cout << a[index] << endl;

}


#include<bits/stdc++.h>
using namespace std;

int main()
{
    int n;
    while(cin>>n)
    {
        string str1,str2;
        map<string,int>mp;

        int i,cnt=0;
        for(i=0;i<n;i++)
        {
            cin>>str1;
            mp[str1]++;
            if(mp[str1]>cnt)
            {
                cnt=mp[str1];
                str2=str1;
            }
        }
        cout<<str2<<endl;
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n,x = 0,y = 0;
    string t1,t2;
    cin >> n;
    string s[n];
    cin >> s[0];
    if (n != 1){
    for (int i = 1 ; i < n ; i ++){
        cin >> s[i];
        if (s[i-1] != s[i]){
            t1 = s[i-1];
            t2 = s[i];
        }
    }
    for (int i = 0 ; i < n ; i ++){
        if (s[i] == t1){
            x ++;
        }
        else {
            y ++;
        }
    }
    if (x > y){
        cout << t1;
    }
    else {
        cout << t2;
    }
    }
    else if (n == 2){
        cout << s[0];
    }
    else {
        cout << s[0];
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n,x = 0,y = 0;
    string s[n],t1,t2;
    cin >> n >> s[0];
    if (n != 1){
    for (int i = 1 ; i < n - 1 ; i ++){
        cin >> s[i];
        if (s[i-1] != s[i]){
            t1 = s[i-1];
            t2 = s[i];
        }
    }
    for (int i = 0 ; i < n ; i ++){
        if (s[i] == t1){
            x ++;
        }
        else {
            y ++;
        }
    }
    if (x > y){
        cout << t1;
    }
    else {
        cout << t2;
    }
    }
    else {
        cout << s[0];
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n,x = 0,y = 0;
    string t1,t2;
    cin >> n;
    string s[n];
    cin >> s[0];
    if (n != 1){
    for (int i = 1 ; i < n - 1 ; i ++){
        cin >> s[i];
        if (s[i-1] != s[i]){
            t1 = s[i-1];
            t2 = s[i];
        }
    }
    for (int i = 0 ; i < n ; i ++){
        if (s[i] == t1){
            x ++;
        }
        else {
            y ++;
        }
    }
    if (x > y){
        cout << t1;
    }
    else {
        cout << t2;
    }
    }
    else {
        cout << s[0];
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n,x = 0,y = 0;
    string t1,t2;
    cin >> n;
    string s[n];
    cin >> s[0];
    if (n != 1 && n != 2){
    for (int i = 1 ; i < n ; i ++){
        cin >> s[i];
        if (s[i-1] != s[i]){
            t1 = s[i-1];
            t2 = s[i];
        }
    }
    for (int i = 0 ; i < n ; i ++){
        if (s[i] == t1){
            x ++;
        }
        else {
            y ++;
        }
    }
    if (x > y){
        cout << t1;
    }
    else {
        cout << t2;
    }
    }
    else if (n == 2){
        cout << s[0];
    }
    else {
        cout << s[0];
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll  long long int
#define MAX 1e9
int main()
{
    cin.tie(0);
    std::ios::sync_with_stdio(false);
    ll x;
    cin>>x;
    string s,m,t;
    vector<string> vec;
    for(int i=0;i<x;i++)
    {
        cin>>s;
        vec.push_back(s);
    }
    if(x==1){cout<<s<<endl;return 0;}
    int v=0,MIN=0;
    for(int i=0;i<vec.size()-1;i++)
    {
        for(int j=i+1;j<vec.size();j++)
        {
            if(vec[i]==vec[j]){v++;m=vec[i];}
        }
        if(v>MIN)
        {
         MIN=v;
         t=m;
        }
        v=0;
    }
    cout<<t<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll  long long int
#define MAX 1e9
int main()
{
    cin.tie(0);
    std::ios::sync_with_stdio(false);
    ll x;
    cin>>x;
    string s,m,t;
    vector<string> vec;
    for(int i=0;i<x;i++)
    {
        cin>>s;
        vec.push_back(s);
    }
    sort(vec.begin(),vec.end());
    if(x==1){cout<<s<<endl;return 0;}
    int v=0,MIN=100000000;
    for(int i=0;i<vec.size()-1;i++)
    {
        v=0;
        for(int j=i+1;j<vec.size();j++)
        {
            if(vec[i]==vec[j]){v++;m=vec[i];}
        }
        if(v<MIN)
        {
         MIN=v;
         t=m;
        }
    }
    cout<<t<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll  long long int
#define MAX 1e9
int main()
{
    cin.tie(0);
    std::ios::sync_with_stdio(false);
    ll x;
    cin>>x;
    string s,m;
    vector<string> vec;
    for(int i=0;i<x;i++)
    {
        cin>>s;
        vec.push_back(s);
    }
    if(x==1){cout<<s<<endl;return 0;}
    int v=0,MIN=100000000;
    for(int i=0;i<vec.size()-1;i++)
    {
        for(int j=i+1;j<vec.size();j++)
        {
            if(vec[i]==vec[j]){v++;}
            if(v<MIN)
            {
                MIN=v;
                m=vec[i];
            }
        }
    }
    cout<<m<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ll  long long int
#define MAX 1e9
int main()
{
    cin.tie(0);
    std::ios::sync_with_stdio(false);
    ll x;
    cin>>x;
    string s,m,t;
    vector<string> vec;
    for(int i=0;i<x;i++)
    {
        cin>>s;
        vec.push_back(s);
    }
    sort(vec.begin(),vec.end());
    if(x==1){cout<<s<<endl;return 0;}
    int v=0,MIN=100000000;
    for(int i=0;i<vec.size()-1;i++)
    {
        v=0;
        for(int j=i+1;j<vec.size();j++)
        {
            if(vec[i]==vec[j]){v++;m=vec[i];}
        }
        if(v<MIN)
        {
         MIN=v;
         t=m;
        }
    }
    cout<<m<<endl;
    return 0;
}


#include <iostream>
#include <string>
#include <set>

using namespace std;

int n;
set<string> myset;
string str;
set<string>::reverse_iterator rit1, rit2;

int main()
{
    while ( cin >> n ) {
        myset.clear();
        for ( int i = 0; i < n; ++i ) {
            cin >> str;
            myset.insert(str);
            }
        rit1 = myset.rbegin();
        rit2 = myset.rend();
        if ( myset.count( *rit1 ) > myset.count( *rit2 ) )
            cout << *rit1 << endl;
        else
            cout << *rit2 << endl;
        }
    return 0;
}


#include <iostream>
#include <string>
#include <vector>

using namespace std;

string str1, str2;
int n, i, j;
vector<string> vec1, vec2;

int main()
{
    while ( cin >> n ) {
        vec1.clear();
        vec2.clear();
        cin >> str2;
        vec1.push_back(str2);
        for ( i = 0; i < n - 1; ++i ) {
            cin >> str1;
            if ( str1 == str2 )
                vec1.push_back(str2);
            else
                vec2.push_back(str1);
        }
        i = vec1.size();
        j = vec2.size();
        if ( i > j )
            cout << vec1[0] << endl;
        else
            cout << vec2[0] << endl;
    }
    return 0;
}


#include <iostream>
#include <string>
#include <set>

using namespace std;

int n;
set<string> myset;
string str;
set<string>::reverse_iterator rit1, rit2;

int main()
{
    while ( cin >> n ) {
        myset.clear();
        for ( int i = 0; i < n - 1; ++i ) {
            cin >> str;
            myset.insert(str);
            }
        rit1 = myset.rbegin();
        rit2 = myset.rend();
        if ( myset.count( *rit1 ) > myset.count( *rit2 ) )
            cout << *rit1 << endl;
        else
            cout << *rit2 << endl;
        }
    return 0;
}


#include <iostream>
#include <string>
#include <set>

using namespace std;

int n;
string str;
multiset < string > myset;
multiset < string > :: iterator it;
multiset < string > :: reverse_iterator rit;

int main ( ) {
        while ( cin >> n ) {
                myset.clear ( );
                while ( n-- ) {
                        cin >> str;
                        myset.insert ( str );
                }
                it = myset.begin ( );
                rit = myset.rbegin ( );
                if ( myset.count ( *it ) > myset.count ( *rit ) ) cout << *it << endl;
                else cout << *rit << endl;
        }
}


#include <iostream>
#include <string>
#include <vector>

using namespace std;

string str1, str2;
int n, i, j;
vector<string> vec1, vec2;

int main()
{
    while ( cin >> n ) {
        vec1.clear();
        vec2.clear();
        cin >> str2;
        vec1.push_back(str2);
        for ( i = 0; i < n - 1; ++i ) {
            cin >> str1;
            if ( str1 == str2 )
                vec1.push_back(str1);
            else
                vec2.push_back(str2);
        }
        i = vec1.size();
        j = vec2.size();
        if ( i > j )
            cout << vec1[0] << endl;
        else
            cout << vec2[0] << endl;
    }
    return 0;
}


#include <iostream>
#include <string>
#include <set>

using namespace std;

int n;
set<string> myset;
string str;
set<string>::reverse_iterator rit;
set<string>::iterator it;

int main()
{
    while ( cin >> n ) {
        myset.clear();
        for ( int i = 0; i < n; ++i ) {
            cin >> str;
            myset.insert(str);
            }
        it = myset.begin();
        rit = myset.rbegin();
        if ( myset.count( *it ) > myset.count( *rit ) )
            cout << *it << endl;
        else
            cout << *rit << endl;
        }
    return 0;
}


#include<iostream>
#include<bits/stdc++.h>
using namespace std;

int main()
{
	int n,c1=1,c2=0;
	string a,b;
	cin >> n;
	cin >> a;
	while(n>1)
	{
		cin >> b;
		if(a.compare(b) == 0)
			c1++;
		else
			c2++;
		n--;
	}
	if(c1>c2)
	cout << a;
	else
	cout << b;
	return 0;
}


#include<iostream>
#include<bits/stdc++.h>
using namespace std;

int main()
{
    int n,i=0,x;
    cin >> n;
    x =n;
    string a[n];
    while(x>0)
    {
        cin >> a[i++];
        //cout<< a[i-1] << " ";
        x--;
    }
    sort(a,a+n);
    cout << a[n/2];
    return 0;
}


#include<iostream>
#include<bits/stdc++.h>
using namespace std;

int main()
{
    int n,i=0;
    cin >> n;
    string a[n];
    while(n>0)
    {
        cin >> a[i++];
        n--;
    }
    sort(a,a+n);
    cout << a[n/2];
    return 0;
}


#include<iostream>
#include<bits/stdc++.h>
using namespace std;

int main()
{
	int n,c1=1,c2=0;
	string a,b;
	cin >> n;
	cin >> a;
	while(n>1)
	{
		cin >> b;
		if(strcmp(a,b) == 0)
			c1++;
		else
			c2++;
		n--;
	}
	if(c1>c2)
	cout << a;
	else
	cout << b;
	return 0;
}


#include<iostream>
#include<bits/stdc++.h>
using namespace std;

int main()
{
    int n,i=0,x;
    cin >> n;
    x =n;
    string a[n];
    while(x>0)
    {
        cin >> a[i++];
        cout<< a[i-1] << " ";
        x--;
    }
    sort(a,a+n);
    cout << a[n/2];
    return 0;
}


using namespace std;

int n,h,x,an;

int main()
{
    cin>>n>>h;
    int ans=0;
    for(int i=1;i<=n;i++)
    {
        cin>>x;
        if(x>h)
            ans++;
        ans++;
    }
    cout<<an<<"\n";
}


#include<bits/stdc++.h>
using namespace std;

int n,h,x,an;

int main()
{
    cin>>n>>h;
    int ans=0;
    for(int i=1;i<=n;i++)
    {
        cin>>x;
        if(x>h)
            ans++;
        ans++;
    }
    cout<<an<<"\n";
}


#include <iostream>
using namespace std;

int n,h,x,ans;

int main()
{
    cin>>n>>h;
    int ans=0;
    for(int i=1;i<=n;i++)
    {
        cin>>x;
        if(x>h)
            ans++;
        ans++;
    }
    cout<<ans<<"\n";
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
  int n,h;   cin>>n>>h;
  int w,l;
  for(int i=0;i<n;i++){
    cin>>l;
    if(l>h){w+=2;}
    else{w++;}}
  cout>>w;
}


#include <iostream>
using namespace std;
 int n,h; int w,l;
int main()
{ cin>>n>>h;
   for(int i=0;i<n;i++){
    cin>>l;
    if(l>h){w+=2;}
    else{w++;}}
  cout<<w;}


#include <iostream>
using namespace std;
int main()
{ int n,h; cin>>n>>h;
    int w,l;
    for(int i=0;i<n;i++)
    {cin>>l
    if(l>h)
    {w+=2;}
    else{w++;}
    cout<<w;}
}


#include <iostream>
using namespace std;
int main()
{ int n,h;   cin>>n>>h;
  int w,l;
  for(int i=0;i<n;i++){
    cin>>l;
    if(l>h){w+=2;}
    else{w++;}}
  cout>>w;}


#include <bits/stdc++.h>
using namespace std;
 int n,h; int w,l;
int main()
{ cin>>n>>h;
  for(int i=0;i<n;i++){
    cin>>l;
    if(l>h){w+=2;}
    else{w++;}}
  cout<<w;
}


#include <iostream>
using namespace std;

int main() {
	int n, h, a, cn=0;
	//cout << "Input number of friends: ";
	cin >> n;
	//cout << "Input the height of fence: ";
	cin >> h;
	for (int i = 1; i <= n; ++i) {
		//cout << "Input the height of person: ";
		cin >> a;
		if (a > h) cn += 2;
		else ++cn;
	}
	cout << cn;
	return 0;
}


#include <iostream>
using namespace std;

int main() {
	int n, h, a, cn=0;
	cout << "Input number of friends: ";
	cin >> n;
	cout << "Input the height of fence: ";
	cin >> h;
	for (int i = 1; i <= n; ++i) {
		cout << "Input the height of person: ";
		cin >> a;
		if (a > h) cn += 2;
		else ++cn;
	}
	cout << cn;
	return 0;
}


#include <iostream>
using namespace std;

int main() {
	int n, h, a, cn=0;
	cin >> n;
	cin >> h;
	for (int i = 1; i <= n; ++i) {
		cin >> a;
		if (a > h) cn += 2;
		else ++cn;
	}
	cout << cn;
	return 0;
}


#include <iostream>

using namespace std;

int main()
{
    int n, h, temp, sum = 0;

    cin >> n >> h;

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

        cin >> temp;
        if (temp > h) {
            sum++;
        }
        sum++;
    }
    cout << sum << endl;

}


#include <iostream>

using namespace std;

int main()
{

    int n, h, temp, sum = 0;

    cin >> n;
    cin >> h;

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

        if (temp <= h) {
            sum++;
        }

        else {
            sum = sum + 2;
        }
    }

    cout << sum;

}


#include <iostream>

using namespace std;

int main()
{
    int n, h, temp, sum = 0;

    cin >> n >> h;

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

        cin >> temp;
        if (temp > h) {
            sum++;
        }
        sum++;
    }
    cout << sum << "\n";

}


#include<iostream>
using namespace std;
int main()
{

    int n,h,m,w=0;
    cin>>n>>h;
    for(int i=0;i<n;i++)
	{cin>>m;
	if(m<=h)
		w=w+1;
	else w=w+2;}
	cout<<w;

}


#include <iostream>
using namespace std;
int main()
{int n,h,m,w=0;
cin>>n,h;
for(int i=0;i<n;i++)
{cin>>m;
if(m<=7)
w+=1;
else
w+=2;}
cout<<w;}


#include <iostream>
using namespace std;
int main(){
    int n,h,m,w=0;
    cin>>n>>h;
    while(n!=1)
    {cin<<m;
    if(m<=7)
    {w+=1;n-1;}
    else {w+=2;n-1;}}

}


int main(){
    int f;
    int h;
    int wf;
    int width=0;
    cin>>f;
    cin>>h;
    for(int i=0 ; i<f;i++){
        cin>>wf;
        if(wf>h)
        {
            if(wf%5==0)
                width+=(wf/5);
            else
                width+=(wf/5)+1;
        }
        else
            width++;
    }
    cout<<width;
    return 0;
}


#include<iostream>

using namespace std;
int main(){
	int f;
	int h;
	int wf;
	int width = 0;
	cin >> f;
	cin >> h;
	for (int i = 0; i<f; i++){
		cin >> wf;
		if (wf>h)
		{
			if (wf % h == 0)
				width += (wf / h);
			else
				width += (wf / h) + 1;
		}
		else
			width++;
	}
	cout << width;

	return 0;
}


#include<iostream>
using namespace std;
int main(){
    int f;
    int h;
    int wf;
    int width=0;
    cin>>f;
    cin>>h;
    for(int i=0 ; i<0;i++){
        cin>>wf;
        if(wf<=h)
            width++;
        else
        {
            if(wf%5==0)
                width+=wf/5;
            else
                width+=(wf/5)+1;
        }
    }
    cout<<width;
    return 0;
}


#include<iostream>
using namespace std;
int main(){
	int f;
	int h;
	int wf;
	int width = 0;
	cin >> f;
	cin >> h;
	for (int i = 0; i<f; i++){
		cin >> wf;
		if (wf>h)
		{
			if (wf % 5 == 0)
				width += (wf / 5);
			else
				width += (wf / 5) + 1;
		}
		else
			width++;
	}
	cout << width;

	return 0;
}


#include<iostream>
using namespace std;
int main(){
    int f;
    int h;
    int wf;
    int width=0;
    cin>>f;
    cin>>h;
    for(int i=0 ; i<0;i++){
        cin>>wf;
        if(wf>h)
        {
            if(wf%5==0)
                width+=(wf/5);
            else
                width+=(wf/5)+1;
        }
        else
            width++;
    }
    cout<<width;
    return 0;
}


#include<iostream>
using namespace std;
int main(){
    int n,h;
    cin>>n;
    cin>>h;
    int arr[100];
    for(int i=0;i<n;i++){
        cin>>arr[i];
    }
    for(int i=0;i<n;i++)
    {if(arr[i]=<h)
    {arr[i]=1;}
    else
    {arr[i]=2;}
    }
    int sum=0;
    for(int i=0;i<n;i++){
        sum+=arr[i];
    }
    cout<<sum;
    return 0;
}


#include<iostream>
using namespace std;
int main(){
    int n,h;
    cin>>n;
    cin>>h;
    int arr[n];
    for(int i=0;i<n;i++){
        cin>>arr[i];
    }
    for(int i=0;i<n;i++)
    {if(arr[i]<h)
    {arr[i]=1;}
    else
    {arr[i]=2;}
    }
    int sum=0;
    for(int i=0;i<n;i++){
        sum+=arr[i];
    }
    cout<<sum;
    return 0;
}


#include<iostream>
using namespace std;
int main(){
    int n,h;
    cin>>n;
    cin>>h;
    int arr[100000];
    for(int i=0;i<n;i++){
        cin>>arr[i];
    }
    for(int i=0;i<n;i++)
    {if(arr[i]<=h)
    {arr[i]=1;}
    else
    {arr[i]=2;}
    }
    int sum=0;
    for(int i=0;i<n;i++){
        sum+=arr[i];
    }
    cout<<sum;
    return 0;
}


#include<iostream>
using namespace std;
int main(){
    int n,h;
    cin>>n;
    cin>>h;
    int arr[100];
    for(int i=0;i<n;i++){
        cin>>arr[i];
    }
    for(int i=0;i<n;i++)
    {if(arr[i]<=h)
    {arr[i]=1;}
    else
    {arr[i]=2;}
    }
    int sum=0;
    for(int i=0;i<n;i++){
        sum+=arr[i];
    }
    cout<<sum;
    return 0;
}


#include<iostream>
using namespace std;
int main(){
    int n,h;
    cin>>n;
    cin>>h;
    int arr[100];
    for(int i=0;i<n;i++){
        cin>>arr[i];
    }
    for(int i=0;i<n;i++)
    {if(arr[i]<h)
    {arr[i]=1;}
    else
    {arr[i]=2;}
    }
    int sum=0;
    for(int i=0;i<n;i++){
        sum+=arr[i];
    }
    cout<<sum;
    return 0;
}


#include<iostream>
using namespace std;
int main(){
    int n,h;
    cin>>n;
    cin>>h;
    int[n];
    for(int i=0;i<n;i++){
        cin>>ar[i];
    }
    for(int i=0;i<n;i++)
    {if(arr[i]<h)
    {arr[i]=1;}
    else
    {arr[i]=2;}
    }
    int sum=0;
    for(int i=0;i<n;i++){
        sum+=arr[i];
    }
    cout<<sum;
}


#include<iostream>
using namespace std;
/*#include <iostream>
using namespace std;
typedef long long ll;
ll i,n,h,ans,x;
int main()
{
	cin >> n >> h;
	ans = n;
	for (i = 0; i < n; i++)
	{
		cin >> x;
		ans += (x>h);
	}
	cout << ans << endl;
	return 0;
}
*/
int main()
{
	long long numOfFriends;
	long long fenceHeight;
	cout << "enter parameters:" << endl;
	cin >> numOfFriends >> fenceHeight;
	/*if (numOfFriends < 1 && numOfFriends > 1000)
	return 1;
	if (fenceHeight < 1 && numOfFriends > 1000)
	return 1;*/
	//int * friends = new int[numOfFriends];
	long long tmp;
	long long minWidth = 0;
	for (int i = 0; i < numOfFriends; i++)
	{
		cin >> tmp;
		/*if (tmp >= 1 && tmp <= 2 * fenceHeight)
		continue;
		else
		return 1;*/
		if (tmp <= fenceHeight)
			minWidth++;
		else
			minWidth += 2;
	}
	cout << minWidth << endl;;
	//system("pause");
	return 0;
}


#include<iostream>
using namespace std;

int main()
{
	int numOfFriends;
	int fenceHeight;
	cout << "enter parameters:" << endl;
	cin >> numOfFriends;
	cin >> fenceHeight;
	if (numOfFriends < 1 && numOfFriends > 1000)
		return 0;
	if (fenceHeight < 1 && numOfFriends > 1000)
		return 0;
	//int * friends = new int[numOfFriends];
	int tmp;
	int minWidth = 0;
	for (int i = 0; i < numOfFriends; i++)
	{
		cin >> tmp;
		if (tmp >= 1 && tmp <= 2 * fenceHeight)
			continue;
		else
			return 0;
		if (tmp <= fenceHeight )
			minWidth++;
		else
			minWidth += 2;
	}
	cout << minWidth;
	//system("pause");
	return 0;
}


#include<iostream>
using namespace std;

int main()
{
	int numOfFriends;
	int fenceHeight;
	cout << "enter parameters:" << endl;
	cin >> numOfFriends >> fenceHeight;
	/*if (numOfFriends < 1 && numOfFriends > 1000)
		return 1;
	if (fenceHeight < 1 && numOfFriends > 1000)
		return 1;*/
	//int * friends = new int[numOfFriends];
	int tmp;
	int minWidth = 0;
	for (int i = 0; i < numOfFriends; i++)
	{
		cin >> tmp;
		/*if (tmp >= 1 && tmp <= 2 * fenceHeight)
			continue;
		else
			return 1;*/
		if (tmp <= fenceHeight )
			minWidth++;
		else
			minWidth += 2;
	}
	cout << minWidth;
	//system("pause");
	return 0;
}


#include <iostream>
using namespace std;
typedef long long ll;
ll i, n, h, ans, x;
int main()
{
	cin >> n >> h;
	ans = n;
	for (i = 0; i < n; i++)
	{
		cin >> x;
		ans += (x>h);
	}
	cout << ans << endl;
	return 0;
}


#include<iostream>
using namespace std;

int main()
{
	int numOfFriends;
	int fenceHeight;
	cout << "enter parameters:" << endl;
	cin >> numOfFriends;
	cin >> fenceHeight;
	if (numOfFriends < 1 && numOfFriends > 1000)
		return 1;
	if (fenceHeight < 1 && numOfFriends > 1000)
		return 1;
	//int * friends = new int[numOfFriends];
	int tmp;
	int minWidth = 0;
	for (int i = 0; i < numOfFriends; i++)
	{
		cin >> tmp;
		if (tmp >= 1 && tmp <= 2 * fenceHeight)
			continue;
		else
			return 1;
		if (tmp <= fenceHeight )
			minWidth++;
		else
			minWidth += 2;
	}
	cout << minWidth;
	//system("pause");
	return 0;
}


#include<iostream>
using namespace std;

int main()
{
	int numOfFriends;
	int fenceHeight;
	cout << "enter parameters:" << endl;
	cin >> numOfFriends;
	cin >> fenceHeight;
	if (numOfFriends < 1 && numOfFriends > 1000)
		return 0;
	if (fenceHeight < 1 && numOfFriends > 1000)
		return 0;
	//int * friends = new int[numOfFriends];
	int tmp;
	int minWidth = 0;
	for (int i = 0; i < numOfFriends; i++)
	{
		cin >> tmp;
		if (tmp <= fenceHeight && tmp >= 1)
			minWidth++;
		else
			minWidth += 2;
	}
	cout << minWidth;
	//system("pause");
	return 0;
}


#include<iostream>
using namespace std;

int main()
{
	int numOfFriends;
	int fenceHeight;
	cout << "enter parameters:" << endl;
	cin >> numOfFriends;
	cin >> fenceHeight;
	if (numOfFriends < 1 && numOfFriends > 1000)
		return 0;
	if (fenceHeight < 1 && numOfFriends > 1000)
		return 0;
	//int * friends = new int[numOfFriends];
	int tmp;
	int minWidth = 0;
	for (int i = 0; i < numOfFriends; i++)
	{
		cin >> tmp;
		if (tmp <= fenceHeight)
			minWidth++;
		else
			minWidth += 2;
	}
	cout << minWidth;

	return 0;
}


#include<iostream>
using namespace std;

int main()
{
	long long numOfFriends;
	long long fenceHeight;
	cout << "enter parameters:" << endl;
	cin >> numOfFriends >> fenceHeight;
	/*if (numOfFriends < 1 && numOfFriends > 1000)
	return 1;
	if (fenceHeight < 1 && numOfFriends > 1000)
	return 1;*/
	//int * friends = new int[numOfFriends];
	long long tmp;
	long long minWidth = 0;
	for (int i = 0; i < numOfFriends; i++)
	{
		cin >> tmp;
		/*if (tmp >= 1 && tmp <= 2 * fenceHeight)
		continue;
		else
		return 1;*/
		if (tmp <= fenceHeight)
			minWidth++;
		else
			minWidth += 2;
	}
	cout << minWidth;
	//system("pause");
	return 0;
}


#include<iostream>
using namespace std;

int main()
{
	int numOfFriends;
	int fenceHeight;
	cout << "enter parameters:" << endl;
	cin >> numOfFriends;
	cin >> fenceHeight;
	if (numOfFriends < 1 && numOfFriends > 1000)
		return 0;
	if (fenceHeight < 1 && numOfFriends > 1000)
		return 0;
	//int * friends = new int[numOfFriends];
	int tmp;
	int minWidth = 0;
	for (int i = 0; i < numOfFriends; i++)
	{
		cin >> tmp;
		if (tmp <= fenceHeight)
			minWidth++;
		else
			minWidth += 2;
	}
	cout << minWidth << endl;
	system("pause");
	return 0;
}


#include<iostream>
using namespace std;
/*#include <iostream>
using namespace std;
typedef long long ll;
ll i,n,h,ans,x;
int main()
{
	cin >> n >> h;
	ans = n;
	for (i = 0; i < n; i++)
	{
		cin >> x;
		ans += (x>h);
	}
	cout << ans << endl;
	return 0;
}
*/
int main()
{
	long long numOfFriends;
	long long fenceHeight;
	cin >> numOfFriends >> fenceHeight;
	/*if (numOfFriends < 1 && numOfFriends > 1000)
	return 1;
	if (fenceHeight < 1 && numOfFriends > 1000)
	return 1;*/
	//int * friends = new int[numOfFriends];
	long long minWidth = 0;
	for (int i = 0; i < numOfFriends; i++)
	{
		cin >> tmp;
		/*if (tmp >= 1 && tmp <= 2 * fenceHeight)
		continue;
		else
		return 1;*/
		if (tmp <= fenceHeight)
			minWidth++;
		else
			minWidth += 2;
	}
	cout << minWidth << endl;;
	//system("pause");
	return 0;
}


#include<iostream>
using namespace std;
int main()
{
	int numOfFriends;
	int fenceHeight;
	cin >> numOfFriends >> fenceHeight;
	int tmp;
	int minWidth = 0;
	for (int i = 0; i < numOfFriends; i++)
	{
		cin >> tmp;
		if (tmp <= fenceHeight)
			minWidth++;
		else
			minWidth += 2;
	}
	cout << minWidth << endl;;
	return 0;
}


#include<iostream>
using namespace std;
/*#include <iostream>
using namespace std;
typedef long long ll;
ll i,n,h,ans,x;
int main()
{
	cin >> n >> h;
	ans = n;
	for (i = 0; i < n; i++)
	{
		cin >> x;
		ans += (x>h);
	}
	cout << ans << endl;
	return 0;
}
*/
int main()
{
	long long numOfFriends;
	long long fenceHeight;
	cin >> numOfFriends >> fenceHeight;
	/*if (numOfFriends < 1 && numOfFriends > 1000)
	return 1;
	if (fenceHeight < 1 && numOfFriends > 1000)
	return 1;*/
	//int * friends = new int[numOfFriends];
	long long tmp;
	long long minWidth = 0;
	for (int i = 0; i < numOfFriends; i++)
	{
		cin >> tmp;
		/*if (tmp >= 1 && tmp <= 2 * fenceHeight)
		continue;
		else
		return 1;*/
		if (tmp <= fenceHeight)
			minWidth++;
		else
			minWidth += 2;
	}
	cout << minWidth << endl;;
	//system("pause");
	return 0;
}


// ProblemSolving_CPP.cpp : Defines the entry point for the console application.
//

//#include "stdafx.h"
#include "iostream"

using namespace std;

int main()
{
	int counter = 0;
	int friends_number = 0, fence_height = 0;
	int* a = NULL;

	cin >> friends_number >> fence_height;

	a = new int[friends_number];

	for (int i = 0; i < friends_number; i++)
	{
		cin >> a[i];
	}

	for (int j = 0; j < friends_number; j++)
	{
		if (a[j] <= fence_height)
			counter++;
		else
			counter += 2;
	}
	cout << counter;

    return 0;
}


#include "stdafx.h"
#include "iostream"

using namespace std;

int main()
{
	int counter = 0;
	int friends_number = 0, fence_height = 0;
	int* a = NULL;

	cin >> friends_number >> fence_height;

	a = new int[friends_number];

	for (int i = 0; i < friends_number; i++)
	{
		cin >> a[i];
	}

	for (int j = 0; j < friends_number; j++)
	{
		if (a[j] <= fence_height)
			counter++;
		else
			counter += 2;
	}
	cout << counter;

    return 0;
}


// ProblemSolving_CPP.cpp : Defines the entry point for the console application.
//

//#include "stdafx.h"
#include "iostream"

using namespace std;

int main()
{
	int counter = 0;
	int friends_number = 0, fence_height = 0;

	int add = 55;
	int* a = &add;

	cin >> friends_number >> fence_height;

	a = new int[friends_number];

	for (int i = 0; i < friends_number; i++)
	{
		cin >> a[i];
	}

	for (int j = 0; j < friends_number; j++)
	{
		if (a[j] <= fence_height)
			counter++;
		else
			counter += 2;
	}
	cout << counter;

    return 0;
}

//
//// Use a as a normal array
//delete[] a;  // When done, free memory pointed to by a.
//a = NULL;     // Clear a to prevent using invalid memory reference.


#include <iostream>

using namespace std;

int main(){
	int n,k,h;
	cin>>n>>h;
	k=n;
	for(int i=0;i<n;i++){
		cin>>k;
		if(k>h){k++;}
	}
	cout<<k;
}


#include <iostream>

using namespace std;

int main(){
	int n,k,h,curr;
	cin>>n>>h;
	k=n;
	for(int i=0;i<n;i++){
		cin>>curr;
		if(curr>h){k++;}
	}
	cout<<k;
}


#include <iostream>

using namespace std;

int main(){
	int n,k,h;
	cin>>n>>h;
	k=n;
	for(int i=0;i<n;i++){
		cin>>k;
		if(k>h){k++;}
	}
	cout<<k<<endl;
}


#include <iostream>

int main(){
	int n,k,h;
	cin>>n>>h;
	k=n;
	for(int i=0;i<n;i++){
		cin>>k;
		if(k>h){k++;}
	}
	cout<<k<<endl;
}


#include <iostream>
using namespace std;
int main()
{
    int n,h,a,x;
    cin>>n>>h>>a;
    a=0;
    for(int i=0;i<n;i)
    {
        cin>>a;
        if(a>h)
            a++;
    }   a++;
    cout<<a<<endl;
    return 0;
}


#include <iostream>
using namespace std;
int main()
{
    int n,h,a,x;
    cin>>n>>h>>a;
    a=0;
    for(int i=0;i<n;i)
    {
        cin>>a;
        if(a>h)
            a++;
    }   a++;
    cout<<x<<endl;
    return 0;
}


#include <iostream>
using namespace std;
int main()
{
    int n,h;
    cin>>n>>h;
    x=0;
    for(int i=1;i<=n;i)
    {
        cin>>a;
        if(a>h)
            x++;
    }   x++;
    cout<<x<<endl;
    return 0;
}


#include<iostream>
using namespace std;
int main()
{
    int no,hei,wid,len;
    cin>>no>>hei;
    wid=0;
    for(int i=0;i<no;i++)
    {
        cin>>len;
        if(len>hei)
            wid++;
        wid++;
    }
    cout<<wid<<endl;

    return 0;
}


#include <iostream>

using namespace std;

int main()
{
	int n, h;
	cin >> n >> h;
	int nh[1000];
	for (int i = 0; i < n; i++) {
		cin >> nh[i];
	}
	int width = 0;
	for (int i = 0; i < n; i++) {
		if (nh[i] > h) {
			width += 2;
		}
		else {
			width += 1;
		}
	}
	cout << width;
    return 0;
}


#include "stdafx.h"
#include <iostream>

using namespace std;

int main()
{
	int n, h;
	cin >> n >> h;
	int nh[100];
	for (int i = 0; i < n; i++) {
		cin >> nh[i];
	}
	int width = 0;
	for (int i = 0; i < n; i++) {
		if (nh[i] >= h) {
			width += 2;
		}
		else {
			width += 1;
		}
	}
	cout << width;
    return 0;
}


#include <iostream>

using namespace std;

int main()
{
	int n, h;
	cin >> n >> h;
	int nh[100];
	for (int i = 0; i < n; i++) {
		cin >> nh[i];
	}
	int width = 0;
	for (int i = 0; i < n; i++) {
		if (nh[i] > h) {
			width += 2;
		}
		else {
			width += 1;
		}
	}
	cout << width;
    return 0;
}


#include <iostream>

using namespace std;

int main()
{
	int n, h;
	cin >> n >> h;
	int nh[100];
	for (int i = 0; i < n; i++) {
		cin >> nh[i];
	}
	int width = 0;
	for (int i = 0; i < n; i++) {
		if (nh[i] >= h) {
			width += 2;
		}
		else {
			width += 1;
		}
	}
	cout << width;
    return 0;
}


int main()
{
	int n, h;
	cin >> n >> h;
	int nh[100];
	for (int i = 0; i < n; i++) {
		cin >> nh[i];
	}
	int width = 0;
	for (int i = 0; i < n; i++) {
		if (nh[i] >= h) {
			width += 2;
		}
		else {
			width += 1;
		}
	}
	cout << width;
    return 0;
}


#include <stdio.h>
void main()
{
	short n, h, hi, wr,i=1;
	scanf("%u%u", &n, &h);
	for (; i <= n; i++)
	{
		scanf("%u", &hi);
		wr++;
		if (hi>h)
		wr++;
	}
	printf("%u\n", wr);
}


#include <stdio.h>

int main()
{
	int n, h, j, width;
	scanf("%d%d", &n, &h);
	for (int i = 1; i <= n; i++)
	{
		scanf("%d", &j);
		width++;
		if (j>h)width++;
	}
	printf("%d\n", width);
	return 0;
}


#include <stdio.h>

int n, h, j, width;

int main()
{
	scanf("%d%d", &n, &h);
	for (int i = 1; i <= n; i++)
	{
		scanf("%d", &j);
		width++;
		if (j>h)width++;
	}
	printf("%d\n", width);
	return 0;
}


#include <stdio.h>
void main()
{
	int n, h, j, wr=1,i=1;
	scanf_s("%d%d", &n, &h);
	for (; i <= n; i++)
	{
		scanf_s("%d", &j);
		wr++;
		if (j>h)
			wr++;
	}
	printf("%d\n", wr);
}


#include <stdio.h>

int main()
{
	int n, h, j, width,i;
	scanf("%d%d", &n, &h);
	for (i=1; i <= n; i++)
	{
		scanf("%d", &j);
		width++;
		if (j>h)
		width++;
	}
	printf("%d\n", width);
	return 0;
}


#include <stdio.h>
void main()
{
	int n, h, j, wr=0,i=1;
	scanf_s("%d%d", &n, &h);
	for (; i <= n; i++)
	{
		scanf("%d", &j);
		wr++;
		if (j>h)
			wr++;
	}
	printf("%d\n", wr);
}


#include <iostream>

using namespace std;

int main()
{
	long n, a, b;
	cin >> n;
	int count = 1;
	cin >> a;

	for (int i = 1; i <= n - 1; i++)
	{
		cin >> b;
		if (a != b)
		{
			count++;
		}
		a = b;
	}
	cout << count << endl;
	return 0;
}


#include<iostream>
using namespace std;

	int main()
	{
		int n,h,x;
		int ans=0;
		cin >> n >> h;
		for (int i=1;i<=n;i++)
		{
			cin >> x;
			if (x>h) ans=ans+2; else ans++;
		}
		cout << ans;
		return 0;
	}


#include<iostream>
using namespace std;

	int main()
	{
		int n,h,x;
		int ans=0;
		cin >> n >> h;
		for (int i=1;i<=n;i++)
		{
			cin >> x;
			if (x>h) ans=ans+2 else ans++;
		}
		cout << ans;
		return 0;
	}


#include <iostream>
using namespace std ;
int main()
{
	long int c,h,sum=0;
	cin>>c>>h;
	long int l[1000];
	for(int i=0;i<c;i++)
	{
		cin>>l[i];
		if(l[i]>h)
			sum+=2;
		else
			sum+=1;
	}
	cout<<sum;
}


#include <iostream>
using namespace std ;
int main()
{
	short int c,h,sum=0;
	cin>>c>>h;
	short int l[1000];
	for(int i=0;i<c;i++)
	{
		cin>>l[i];
		if(l[i]>h)
			sum+=2;
		else
			sum+=1;
	}
	cout<<sum;
}


#include <iostream>
using namespace std ;
int main()
{
	int c,h,sum=0;
	cin>>c>>h;
	int l[1000];
	for(int i=0;i<c;i++)
	{
		cin>>l[i];
		if(l[i]>h)
			sum+=2;
		else
			sum+=1;
	}
	cout<<sum;
}


#include <iostream>
using namespace std;
int main()
{
    int n,h,i,a,count;
    cout <<n;
    cout <<n;
    count=0;

    for (i=0; i<=n; i++)
        cin >> a;
        {
    if (a<=h)
        count++;
    else count +=2;
        }
    cout << count;
    return 0;
}


#include <iostream>
using namespace std;
int main()
{
    int n,h,i,a,count;
   cin  >> n >> h;
    count=0;

    for (i=0; i<=n; i++)
        cin >> a;
        {
    if (a<=h)
        count++;
    else count +=2;
        }
    cout << count;
    return 0;
}


#include <iostream>
int main()
{
    int n,h,i,a;
    cout <<n;
    cout <<h;

for (i=0, i<=n, i++)
cin >> a;
if a<=h
count++;
else count +=2;
cout << count;
return 0;
}


#include <iostream>
using namespace std;
int main()
{
    int n,h,i,a,count;
    cout <<n;
    cout <<n;

    for (i=0; i<=n; i++)
        cin >> a;
    if (a<=h)
        count++;
    else count +=2;
    cout << count;
    return 0;
}


#include <iostream>
using namespace std;
int main()
{
    int n,h,i,a,count;
   cin  >> n >> h;
    count=0;

    for (i=0; i<n; i++)
    {
        cin >> a;

    if (a<=h)
        count++;
    else count +=2;
        }
    cout << count;
    return 0;
}


#include <iostream>
int main()
{
    int n,h,i,a;
    cout << n;
    cout << h;

for (i=0, i<=n, i++)
cin >> a;
if a<=h
count++;
else count +=2;
cout << count;
return 0;
}


#include <iostream>
using namespace std;

int n,h,an=0,X;
int _tmain(int argc, _TCHAR* argv[])
{
	cin>> n>> h;

	for (int i = 0; i < n; i++)
	{
			cin >>X ;
			if (X>h )
			{
			an++;
			}
			an=an+1;

	}

cout<< an;

	return 0;
}


#include <iostream>
using namespace std;

int n,h,an=0,X;
int main()
{
	cin>> n>> h;

	for (int i = 0; i < n; i++)
	{
			cin >>X ;
			if (X>h )
			{
			an++;
			}
			an=an+1;

	}

cout<< an;

	return 0;
}


// PRAC ACM.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <iostream>
using namespace std;

int n,h,an=0;
int X[1005];

int _tmain(int argc, _TCHAR* argv[])
{
	cin>> n>> h;

	for (int i = 0; i < n; i++)
	{
			cin >>X[i] ;
			if (X[i]>h )
			{
			an=an+2;
			}
			else {an=an+1;}
	}

cout<< an;

	return 0;
}


#include <iostream>
using namespace std;
int main()
{
    int n, h, k=0;
    cin>>n>>h;
    for (int i = 0; i < n; i++)
    {
        int a;
        cin>>a;
        if (a<=h) k++;
        else k+=2;
    }
    cout<<k;
    return 0;
}


#include <iostream>
using namespace std;
int main()
{
    int n, h, k=0;
    cin>>n>>h;
    for (int i = 0; i < n; i++)
    {
        int a;
        cin>>a;
        if (a<=h) k++
        else k+=2;
    }
    cout<<k;
    return 0;
}


#include <iostream>
using namespace std;
int main()
{
    int n, h, k=0;
    cin>>n>>h;
    for (int i = 0; i < n; i++)
    {
        int a;
        cin>>a;
        if (a<=h) k++
        else k+=2;
    }
    cout<<k;
    system ("PAUSE");
    return 0;
}


#include <iostream>
using namespace std;
int main()
{
    int n, h, k=0;
    cin>>n>>h;
    for (int i = 0; i < n; i++)
    {
        int a;
        cin>>a;
        if (a<=h) k++;
        else k+=2;
    }
    cout<<k;
    system ("PAUSE");
    return 0;
}


<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
	<FileVersion major="1" minor="6" />
	<Project>
		<Option title="test2" />
		<Option pch_mode="2" />
		<Option compiler="gcc" />
		<Build>
			<Target title="Debug">
				<Option output="bin/Debug/test2" prefix_auto="1" extension_auto="1" />
				<Option object_output="obj/Debug/" />
				<Option type="1" />
				<Option compiler="gcc" />
				<Compiler>
					<Add option="-g" />
				</Compiler>
			</Target>
			<Target title="Release">
				<Option output="bin/Release/test2" prefix_auto="1" extension_auto="1" />
				<Option object_output="obj/Release/" />
				<Option type="1" />
				<Option compiler="gcc" />
				<Compiler>
					<Add option="-O2" />
				</Compiler>
				<Linker>
					<Add option="-s" />
				</Linker>
			</Target>
		</Build>
		<Compiler>
			<Add option="-Wall" />
			<Add option="-fexceptions" />
		</Compiler>
		<Unit filename="main.cpp" />
		<Extensions>
			<code_completion />
			<envvars />
			<debugger />
			<lib_finder disable_auto="1" />
		</Extensions>
	</Project>
</CodeBlocks_project_file>


#include <iostream>

using namespace std;

int main()
{
    int n , h , ai , minn = 0 ;
    cin >> n >> h ;
        if( n >= 1 && h >= 1   &&  n <=1000 && h <= 1000 ){
        for ( int i = 0 ; i < n ; i++){
            cin >> ai ;
            if( ai >= 1 && ai <= 2*h ){
                if ( ai <= h ) { minn = minn + 1 ; }
                else { minn = minn + 2 ;}
            }

        }
        cout<< minn << endl ;

    }
    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    int n , h , ai , minn =0 ;
    cin >> n >> h ;
    if( 1 <= n , h  &&  n , h <= 1000 ){
        for ( int i = 0 ; i < n ; i++){
            cin >> ai ;
            if( 1 <= ai && ai <= 2*h ){
                if ( ai <= h )  minn +=1 ;
                else minn +=2 ;
            }

        }
        cout<< minn ;

    }
    return 0;


#include <iostream>

using namespace std;

int main()
{
    int n , h , ai , minn = 0 ;
    cin >> n >> h ;
        if( n , h >= 1   &&  n , h <= 1000 ){
        for ( int i = 0 ; i < n ; i++){
            cin >> ai ;
            if( ai >= 1 && ai <= 2*h ){
                if ( ai <= h ) { minn = minn + 1 ; }
                else { minn = minn + 2 ;}
            }

        }
        cout<< minn << endl ;

    }
    return 0;


#include<iostream>
using namespace std ;
int main ()
{
    int a,width , n , h , i ;
    cin>>n>>h ;

    for(i=0;i<n;i++)
    {if(a>h)
        width+=2;

        else
        width++;

    }
cout<<width ;
    return 0 ;

}


#include<iostream>
using namespace std;

int main()
{
    int n , h , x;
    int width = 0 ;
    cin>>n;
    cin>>h;
    for(int i=0 ; i<n ; i++)
    {
        cin>>x;
        if(x>h){width=width+2;}
        else{width=width+1;}
    }
    cout<<width<<endl;
    return 0;
}


#include<iostream>
using namespace std ;
int main ()
{
    int a,width , n , h , i ;
    cin>>n>>h ;
    for(i=0;i<n;i++){

        if(a>h)
        width++=2;

        else
        width++=1;
    }
    cout<<width ;

    return 0 ;
}


#include<iostream>
using namespace std ;
int main ()
{
    int a,width , n , h , i ;
    cin>>n>>h ;
    for(i=0;i<n;i++)
    {
         if(a>h)
        width++=2;

        else
        width++;
    }
    cout<<width ;
    return 0 ;

}


#include <iostream>

using namespace std;

void main()
{
    int h, n;
    cin >> h >> n;

    int width = 0;

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

        if(a > h)
            width += 2;
        else
            width += 1;
    }

    cout << width << "\n";
}


#include <iostream>

using namespace std;

void main()
{
    int h, n;
    cin >> h >> n;

    int width = 0;

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

        if(a >= h)
            width += 2;
        else
            width += 1;
    }

    cout << width << "\n";
}


#include <iostream>

using namespace std;

void main()
{
    int h, n;
    cin >> n >> h;

    int width = 0;

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

        if(a >= h)
            width += 2;
        else
            width += 1;
    }

    cout << width << "\n";
}


#include <iostream>

using namespace std;

void main()
{
    int h, n;
    cin >> n >> h;

    int width = 0;

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

        if(a > h)
            width += 2;
        else
            width += 1;
    }

    cout << width << "\n";
}


#include <iostream>
using namespace std;

int main()
{
	int n, h, z; // kol-vo dryzeu, zabor
	int a;
	cin >> n >> h;
	for (int i = 0; i < n; i++)
	{
		cin >> a;
		if (a < h)
			z++;
		else
			z += 2;
	}
	cout << z;
	system("pause");
	return 0;
}


#include <iostream>
using namespace std;

int main()
{
	int n, h, z = 0; // kol-vo dryzeu, zabor
	int a;
	cin >> n >> h;
	for (int i = 0; i < n; i++)
	{
		cin >> a;
		if (a <= h)
			z++;
		else
			z += 2;
	}
	cout << z;
	system("pause");
	return 0;
}


#include <iostream>
using namespace std;

int main()
{
	int n, h, z = 0; // kol-vo dryzeu, zabor
	int a;
	cin >> n >> h;
	for (int i = 0; i < n; i++)
	{
		cin >> a;
		if (a < h)
			z++;
		else
			z += 2;
	}
	cout << z;
	system("pause");
	return 0;
}


#include <iostream>
using namespace std;

int main()
{
	int n, h, z = 0; // kol-vo dryzeu, zabor
	int a;
	cin >> n >> h;
	for (int i = 0; i < n; i++)
	{
		cin >> a;
		if (a <= h)
			z++;
		else
			z += 2;
	}
	cout << z;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
	int q;cin>>q;
	while(q--){
		int n;cin>>n;
		bool A[1000]={0};
		int a[1000],z=0,m=1;
		for(int i=0;i<n;i++)
		cin>>a[i];
		for(int i=0;i<n;i++){
			if(a[i]==m){
				A[m]=1;
				if(i==z){
					z++;
				}
				else{
					for(int j=i;j>z;j--){
						if(j!=i)A[a[j-1]]=1;
						swap(a[j],a[j-1]);
					}
				z=i;
				i--;
				}
				for(int j=1;j<=n;j++){
					if(A[j]==0){
						m=j;break;
					}
				}
			}
		}
		for(int i=0;i<n;i++){
			if(i!=n-1)cout<<a[i]<<" ";
			else cout<<a[i]<<endl;
		}
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
	int q;cin>>q;
	while(q--){
		int n;cin>>n;
		bool A[1000]={1,1};
		int a[1000],z=0,m=1;
		for(int i=0;i<n;i++)
		cin>>a[i];
		for(int i=0;i<n;i++){
			if(a[i]==m){
				A[m]=1;
				if(i==z){
					z++;
				}
				else{
					for(int j=i;j>z;j--){
						if(j!=i)A[a[j-1]]=1;
						swap(a[j],a[j-1]);
					}
				z=i;
				}
				for(int j=1;j<=n;j++){
					if(A[j]==0){
						m=j;break;
					}
				}
			}
		}
		for(int i=0;i<n;i++){
			if(i!=n-1)cout<<a[i]<<" ";
			else cout<<a[i]<<endl;
		}
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int a[105],b[105],asd[105];
int main(){
	int t;
	cin>>t;
    while(t--){
		int n;
		cin>>n;
		for(int i=1;i<=n;i++)cin>>a[i],asd[i]=0;
		for(int i=1;i<n;i++)
			for(int j=i;j<n;j++)
				if(a[j]>a[j+1]&&asd[j]==0)
					swap(a[j],a[j+1]),asd[j]=1;
		for(int i=1;i<=n;i++)cout<<a[i]<<" ";
	}
}


#include<bits/stdc++.h>
using namespace std;
int a[105],b[105],asd[105];
int main(){
	int t;
	cin>>t;
    while(t--){
		int n;
		cin>>n;
		for(int i=1;i<=n;i++)cin>>a[i],asd[i]=0;
		for(int i=n-1;i>=1;i--)
			for(int j=i;j<n;j++)
				if(a[j]>a[j+1]&&asd[j]==0)
					swap(a[j],a[j+1]),asd[j]=1;
		for(int i=1;i<=n;i++)cout<<a[i]<<" ";
	}
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define PI 3.1415926535897932384626
const int mod = 1000000007;
#define fo1(i,a,b) for(int i=a;i<=b;i++)
#define deb(x) cout<<x<<"\n";
#define deB(x,y) cout<<x<<" "<<y<<"\n";
#define Deb(x,y,z) cout<<x<<" "<<y<<" "<<z<<"\n"
#define YES cout<<"YES\n";
#define Yes cout<<"Yes\n";
#define NO cout<<"NO\n";
#define No cout<<"No\n";
#define all(v) (v).begin(),(v).end()
#define mk(arr,n,type)  type *arr=new type[n];

int main() {
    ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

    int t;
    cin>>t;
    while(t--){
        int n;
        cin>>n;
        mk(arr,n,int);
        for(int i=0;i<n;i++){
            cin>>arr[i];
        }
        int pos=0;
        int k=1;
        while(pos<n-1){
            int idx=-1;
            for(int i=0;i<n;i++){
                if(arr[i]==k){
                    idx=i;
                    break;
                }
            }
            if(k==idx+1){
                k++;
                if(pos<idx+1){
                    pos=idx+1;
                }
                continue;
            }
            for(int i=idx-1;i>=pos;i--){
                arr[i+1]=arr[i];
            }
            arr[pos]=k;
            k++;
            pos=idx;
        }
        for(int i=0;i<n;i++){
            cout<<arr[i]<<" ";
        }
        cout<<endl;
    }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define PI 3.1415926535897932384626
const int mod = 1000000007;
#define fo1(i,a,b) for(int i=a;i<=b;i++)
#define deb(x) cout<<x<<"\n";
#define deB(x,y) cout<<x<<" "<<y<<"\n";
#define Deb(x,y,z) cout<<x<<" "<<y<<" "<<z<<"\n"
#define YES cout<<"YES\n";
#define Yes cout<<"Yes\n";
#define NO cout<<"NO\n";
#define No cout<<"No\n";
#define all(v) (v).begin(),(v).end()
#define mk(arr,n,type)  type *arr=new type[n];

int main() {
    ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

    int t;
    cin>>t;
    while(t--){
        int n;
        cin>>n;
        mk(arr,n,int);
        for(int i=0;i<n;i++){
            cin>>arr[i];
        }
        int pos=0;
        int k=1;
        while(pos<n-1){
            int idx=-1;
            for(int i=0;i<n;i++){
                if(arr[i]==k){
                    idx=i;
                    break;
                }
            }
            if(k==idx+1){
                k++;
                pos++;
                continue;
            }
            for(int i=idx-1;i>=pos;i--){
                arr[i+1]=arr[i];
            }
            arr[pos]=k;
            k++;
            pos=idx;
        }
        for(int i=0;i<n;i++){
            cout<<arr[i]<<" ";
        }
        cout<<endl;
    }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define PI 3.1415926535897932384626
const int mod = 1000000007;
#define fo1(i,a,b) for(int i=a;i<=b;i++)
#define deb(x) cout<<x<<"\n";
#define deB(x,y) cout<<x<<" "<<y<<"\n";
#define Deb(x,y,z) cout<<x<<" "<<y<<" "<<z<<"\n"
#define YES cout<<"YES\n";
#define Yes cout<<"Yes\n";
#define NO cout<<"NO\n";
#define No cout<<"No\n";
#define all(v) (v).begin(),(v).end()
#define mk(arr,n,type)  type *arr=new type[n];

int main() {
    ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

    int t;
    cin>>t;
    while(t--){
        int n;
        cin>>n;
        mk(arr,n,int);
        for(int i=0;i<n;i++){
            cin>>arr[i];
        }
        int pos=0;
        int k=1;
        while(pos<n-1){
            int idx=-1;
            for(int i=0;i<n;i++){
                if(arr[i]==k){
                    idx=i;
                    break;
                }
            }
            if(k==idx+1){
                k++;
                pos=idx+1;
                continue;
            }
            for(int i=idx-1;i>=pos;i--){
                arr[i+1]=arr[i];
            }
            arr[pos]=k;
            k++;
            pos=idx;
        }
        for(int i=0;i<n;i++){
            cout<<arr[i]<<" ";
        }
        cout<<endl;
    }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define PI 3.1415926535897932384626
const int mod = 1000000007;
#define fo1(i,a,b) for(int i=a;i<=b;i++)
#define deb(x) cout<<x<<"\n";
#define deB(x,y) cout<<x<<" "<<y<<"\n";
#define Deb(x,y,z) cout<<x<<" "<<y<<" "<<z<<"\n"
#define YES cout<<"YES\n";
#define Yes cout<<"Yes\n";
#define NO cout<<"NO\n";
#define No cout<<"No\n";
#define all(v) (v).begin(),(v).end()
#define mk(arr,n,type)  type *arr=new type[n];

int find_smallest(int arr[], int n, int l) {
	int x = arr[l];
	int j = l;
	for (int i = l + 1; i < n; i++) {
		if (arr[i] < x) {
			x = arr[i];
			j = i;
		}
	}
	return j;
}

int main() {
	ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

	int t;
	cin >> t;
	while (t--) {
		int n;
		cin >> n;
		mk(arr, n, int);
		for (int i = 0; i < n; i++) {
			cin >> arr[i];
		}
		if (is_sorted(arr, arr + n)) {
			for (int i = 0; i < n; i++) {
				cout << arr[i] << " ";
			}
			cout << endl;
		} else {
			if (n == 1 or n == 2) {
				sort(arr, arr + n);
				for (int i = 0; i < n; i++) {
					cout << arr[i] << " ";
				}
				cout << endl;
			} else {
				int cnt = n - 1;
				int l = 0;
				while (cnt) {
					int j = find_smallest(arr, n, l);
					while (j > l) {
						if (cnt == 0) {
							break;
						}
						swap(arr[j], arr[j - 1]);
						j = j - 1;
						cnt--;
					}
					l++;
					if (l >= n) {
						break;
					}
				}
				for (int i = 0; i < n; i++) {
					cout << arr[i] << " ";
				}
				cout << endl;
			}
		}
	}

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define PI 3.1415926535897932384626
const int mod = 1000000007;
#define fo1(i,a,b) for(int i=a;i<=b;i++)
#define deb(x) cout<<x<<"\n";
#define deB(x,y) cout<<x<<" "<<y<<"\n";
#define Deb(x,y,z) cout<<x<<" "<<y<<" "<<z<<"\n"
#define YES cout<<"YES\n";
#define Yes cout<<"Yes\n";
#define NO cout<<"NO\n";
#define No cout<<"No\n";
#define all(v) (v).begin(),(v).end()
#define mk(arr,n,type)  type *arr=new type[n];

int find_smallest(int arr[], int n, int l) {
	int x = arr[l];
	int j = l;
	for (int i = l + 1; i < n; i++) {
		if (arr[i] < x) {
			x = arr[i];
			j = i;
		}
	}
	return j;
}

int main() {
	ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

	int t;
	cin >> t;
	while (t--) {
		int n;
		cin >> n;
		mk(arr, n, int);
		for (int i = 0; i < n; i++) {
			cin >> arr[i];
		}
		if (is_sorted(arr, arr + n)) {
			for (int i = 0; i < n; i++) {
				cout << arr[i] << " ";
			}
			cout << endl;
		} else {
			if (n == 1 or n == 2) {
				sort(arr, arr + n);
				for (int i = 0; i < n; i++) {
					cout << arr[i] << " ";
				}
				cout << endl;
			} else {
				int cnt = n - 1;
				int k = 0;
				while (k < n) {
					if (arr[k] == k + 1) {
						cnt--;
						k++;
					} else {
						break;
					}
				}
				int l = 0;
				while (cnt) {
					int j = find_smallest(arr, n, l);
					while (j > l) {
						if (cnt == 0) {
							break;
						}
						swap(arr[j], arr[j - 1]);
						j = j - 1;
						cnt--;
					}
					l++;
					if (l >= n - 1) {
						break;
					}
				}
				for (int i = 0; i < n; i++) {
					cout << arr[i] << " ";
				}
				cout << endl;
			}
		}
	}

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define PI 3.1415926535897932384626
const int mod = 1000000007;
#define fo1(i,a,b) for(int i=a;i<=b;i++)
#define deb(x) cout<<x<<"\n";
#define deB(x,y) cout<<x<<" "<<y<<"\n";
#define Deb(x,y,z) cout<<x<<" "<<y<<" "<<z<<"\n"
#define YES cout<<"YES\n";
#define Yes cout<<"Yes\n";
#define NO cout<<"NO\n";
#define No cout<<"No\n";
#define all(v) (v).begin(),(v).end()
#define mk(arr,n,type)  type *arr=new type[n];

int main() {
    ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

    int t;
    cin>>t;
    while(t--){
        int n;
        cin>>n;
        mk(arr,n,int);
        for(int i=0;i<n;i++){
            cin>>arr[i];
        }
        if(is_sorted(arr,arr+n)){
            for(int i=0;i<n;i++){
                cout<<arr[i]<<" ";
            }
            cout<<endl;
        }else{
            int cnt=n-1;
            int k=1;
            while(true){
                if(cnt<=0 or is_sorted(arr,arr+n)){
                    break;
                }
                int j=-1;
                for(int i=0;i<n;i++){
                    if(arr[i]==k){
                        j=i;
                        break;
                    }
                }
                for(int i=j;i>k-1;i--){
                    if(cnt==0 or is_sorted(arr,arr+n)){
                        break;
                    }else{
                        swap(arr[i],arr[i-1]);
                        cnt--;
                    }
                }
                k++;
            }
            for(int i=0;i<n;i++){
                cout<<arr[i]<<" ";
            }
            cout<<endl;
        }
    }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define PI 3.1415926535897932384626
const int mod = 1000000007;
#define fo1(i,a,b) for(int i=a;i<=b;i++)
#define deb(x) cout<<x<<"\n";
#define deB(x,y) cout<<x<<" "<<y<<"\n";
#define Deb(x,y,z) cout<<x<<" "<<y<<" "<<z<<"\n"
#define YES cout<<"YES\n";
#define Yes cout<<"Yes\n";
#define NO cout<<"NO\n";
#define No cout<<"No\n";
#define all(v) (v).begin(),(v).end()
#define mk(arr,n,type)  type *arr=new type[n];

int find_smallest(int arr[], int n, int l) {
	int x = arr[l];
	int j = l;
	for (int i = l + 1; i < n; i++) {
		if (arr[i] < x) {
			x = arr[i];
			j = i;
		}
	}
	return j;
}

int main() {
	ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

	int t;
	cin >> t;
	while (t--) {
		int n;
		cin >> n;
		mk(arr, n, int);
		for (int i = 0; i < n; i++) {
			cin >> arr[i];
		}
		if (is_sorted(arr, arr + n)) {
			for (int i = 0; i < n; i++) {
				cout << arr[i] << " ";
			}
			cout << endl;
		} else {
			if (n == 1 or n == 2) {
				sort(arr, arr + n);
				for (int i = 0; i < n; i++) {
					cout << arr[i] << " ";
				}
				cout << endl;
			} else {
				int cnt = n - 1;
				int l = 0;
				while (cnt) {
					int j = find_smallest(arr, n, l);
					while (j > l) {
						if (cnt == 0) {
							break;
						}
						swap(arr[j], arr[j - 1]);
						j = j - 1;
						cnt--;
					}
					l++;
					if (l >= n - 1) {
						break;
					}
				}
				for (int i = 0; i < n; i++) {
					cout << arr[i] << " ";
				}
				cout << endl;
			}
		}
	}

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define PI 3.1415926535897932384626
const int mod = 1000000007;
#define fo1(i,a,b) for(int i=a;i<=b;i++)
#define deb(x) cout<<x<<"\n";
#define deB(x,y) cout<<x<<" "<<y<<"\n";
#define Deb(x,y,z) cout<<x<<" "<<y<<" "<<z<<"\n"
#define YES cout<<"YES\n";
#define Yes cout<<"Yes\n";
#define NO cout<<"NO\n";
#define No cout<<"No\n";
#define all(v) (v).begin(),(v).end()
#define mk(arr,n,type)  type *arr=new type[n];

int main() {
    ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

    int t;
    cin>>t;
    while(t--){
        int n;
        cin>>n;
        int arr[n+5];
        for(int i=1;i<=n;i++){
            cin>>arr[i];
        }
        bool used[n+5];
        memset(used,0,sizeof(used));

        for(int i=1;i<=n;i++){
            int idx=0;
            for(int j=1;j<=n;j++){
                if(arr[j]==i){
                    idx=j;
                }
            }

            while(idx>i){
                if(arr[idx]<arr[idx-1] and used[idx]==false){
                    swap(arr[idx],arr[idx-1]);
                    used[idx]=true;
                    idx--;
                }else{
                    break;
                }
            }
        }
        for(int i=1;i<=n;i++){
            cout<<arr[i]<<" ";
        }
        cout<<endl;
    }

    return 0;
}


#include<bits/stdc++.h>
#include <math.h>
#include <algorithm>
#include <vector>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef pair<ll, int> li;
typedef pair<int, ll> il;
typedef vector<ii> vii;
typedef vector<il> vil;
typedef vector<li> vli;

#define ff first
const double pi = acos(-1.0);
#define ss second
#define pb push_back
#define mp make_pair
#define sz size()
#define MOD 1000000007
int dx8[] = {0, 0, 1, 1, 1, -1, -1, -1};
int dy8[] = {1,-1, 1, -1, 0, 0, -1, 1};

int main()
{
    #ifndef ONLINE_JUDGE
    //freopen ("in.txt", "r", stdin);
    //freopen ("out.txt", "w", stdout);
    #endif
    int t;
    cin>>t;
    while(t--){
        int n, i, idx, j, x, c=0;
        cin>>n;
        vi v;
        for(i=0;i<n;i++){
            cin>>x;
            x--;
            v.pb(x);
            mp[x]=i;
        }
        idx=1; i=0;
        while(i<n){
            int mn = min_element(v.begin() + i, v.end()) - v.begin();
            x=v[mn];
            v.erase(v.begin()+mn);
            v.insert(v.begin()+i, x);
            cout<<i<<" "<<mn<<endl;
            if (i==mn) i=mn+1;
            else i=mn;
        }
        for(i=0;i<n;i++)cout<<v[i]+1<<" ";
        cout<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
#include <math.h>
#include <algorithm>
#include <vector>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef pair<ll, int> li;
typedef pair<int, ll> il;
typedef vector<ii> vii;
typedef vector<il> vil;
typedef vector<li> vli;

#define ff first
const double pi = acos(-1.0);
#define ss second
#define pb push_back
#define mp make_pair
#define sz size()
#define MOD 1000000007
int dx8[] = {0, 0, 1, 1, 1, -1, -1, -1};
int dy8[] = {1,-1, 1, -1, 0, 0, -1, 1};

int minimum(int b, int e, int a[ ]){
    int i, mn=101;
    for(i=b;i<=e;i++)if(a[i]<mn)mn=a[i];
    return mn;
}

int main()
{
    #ifndef ONLINE_JUDGE
    freopen ("in.txt", "r", stdin);
    freopen ("out.txt", "w", stdout);
    #endif
    int t;
    cin>>t;
    while(t--){
        int n, i, idx, j, c=0;
        cin>>n; int a[n+1];
        map <int, int> mp; set<int> s;
        for(i=1;i<=n;i++){
            cin>>a[i];mp[a[i]]=i;
        }
        idx=1;
        for(i=1;i<=n;i++){
                int mn=minimum(idx, n, a);
                j=mp[mn];
                s.insert(a[i]);
                while(j>idx && j>1){
                    swap(a[j], a[j-1]);
                    j--;
                    c++;
                    if(c==n-1)break;
                }
                if(a[i]==i && *s.begin()==1)idx=mp[mn]+1;
                else idx=mp[mn];
            if(c==n-1)break;
        }
        for(i=1;i<=n;i++)cout<<a[i]<<" ";
        cout<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
#include <math.h>
#include <algorithm>
#include <vector>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef pair<ll, int> li;
typedef pair<int, ll> il;
typedef vector<ii> vii;
typedef vector<il> vil;
typedef vector<li> vli;

#define ff first
const double pi = acos(-1.0);
#define ss second
#define pb push_back
#define mp make_pair
#define sz size()
#define MOD 1000000007
int dx8[] = {0, 0, 1, 1, 1, -1, -1, -1};
int dy8[] = {1,-1, 1, -1, 0, 0, -1, 1};

int main()
{
    #ifndef ONLINE_JUDGE
    //freopen ("in.txt", "r", stdin);
    //freopen ("out.txt", "w", stdout);
    #endif
    int t;
    cin>>t;
    while(t--){
        int n, i, idx, j, x, c=0;
        cin>>n;
        vi v;
        for(i=0;i<n;i++){
            cin>>x;
            x--;
            v.pb(x);
        }
        idx=1; i=0;
        while(i<n){
            int mn = min_element(v.begin() + i, v.end()) - v.begin();
            x=v[mn];
            v.erase(v.begin()+mn);
            v.insert(v.begin()+i, x);
            if (i==mn) i=mn+1;
            else i=mn;
        }
        for(i=0;i<n;i++)cout<<v[i]+1<<" ";
        cout<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
#include <math.h>
#include <algorithm>
#include <vector>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef pair<ll, int> li;
typedef pair<int, ll> il;
typedef vector<ii> vii;
typedef vector<il> vil;
typedef vector<li> vli;

#define ff first
const double pi = acos(-1.0);
#define ss second
#define pb push_back
#define mp make_pair
#define sz size()
#define MOD 1000000007
int dx8[] = {0, 0, 1, 1, 1, -1, -1, -1};
int dy8[] = {1,-1, 1, -1, 0, 0, -1, 1};

int minimum(int b, int e, int a[ ]){
    int i, mn=101;
    for(i=b;i<=e;i++)if(a[i]<mn)mn=a[i];
    return mn;
}

int main()
{
    #ifndef ONLINE_JUDGE
    freopen ("in.txt", "r", stdin);
    freopen ("out.txt", "w", stdout);
    #endif
    int t;
    cin>>t;
    while(t--){
        int n, i, idx, j, c=0;
        cin>>n; int a[n+1];
        map <int, int> mp; set<int> s;
        for(i=1;i<=n;i++){
            cin>>a[i];mp[a[i]]=i;
        }
        idx=1;
        for(i=1;i<=n;i++){
                int mn=minimum(idx, n, a);
                j=mp[mn];
                s.insert(a[i]);
                while(j>idx){
                    swap(a[j], a[j-1]);
                    j--;
                    c++;
                    if(c==n-1)break;
                }
                if(s.sz==i && *s.begin()==1 && i==n-1)break;
                else if(s.sz==i && *s.begin()==1)idx=mp[mn]+1;
                else idx=mp[mn];
            if(c==n-1)break;
        }
        for(i=1;i<=n;i++)cout<<a[i]<<" ";
        cout<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
#include <math.h>
#include <algorithm>
#include <vector>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef pair<ll, int> li;
typedef pair<int, ll> il;
typedef vector<ii> vii;
typedef vector<il> vil;
typedef vector<li> vli;

#define ff first
const double pi = acos(-1.0);
#define ss second
#define pb push_back
#define mp make_pair
#define sz size()
#define MOD 1000000007
int dx8[] = {0, 0, 1, 1, 1, -1, -1, -1};
int dy8[] = {1,-1, 1, -1, 0, 0, -1, 1};

int main()
{
    #ifndef ONLINE_JUDGE
    freopen ("in.txt", "r", stdin);
    freopen ("out.txt", "w", stdout);
    #endif
    int t;
    cin>>t;
    while(t--){
        int n, i, inx, c=0, j, idx, g=1;
        cin>>n;
        int a[n+1];
        map <int, int> mp;
        for(i=1;i<=n;i++){
            cin>>a[i];
            mp[a[i]]=i;
        }

        idx=1;
        set <int> s;
        for(i=1;i<=n;i++){
            s.insert(a[i]);
            if(*s.begin()==1 && *s.end()==a[i]){
                if(i+1<=n)idx=i+1;
                else idx=i;
               // cout<<"u"<<endl;
                 //idx=i;
                 continue;
            }
            if(mp[i]>=idx){
                j=mp[i];
                while(j>=idx && j>1){
                    c++;
                    swap(a[j], a[j-1]);
                    //cout<<j<<" "<<j-1<<endl;
                    if(c==n-1)break;
                    j--;
                }

            }
            idx=mp[i-1];
            if(c==n-1)break;
        }
         for(i=1;i<=n;i++) cout<<a[i]<<" ";
        cout<<endl;
    }

    return 0;
}


#include<bits/stdc++.h>
#include <math.h>
#include <algorithm>
#include <vector>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef pair<ll, int> li;
typedef pair<int, ll> il;
typedef vector<ii> vii;
typedef vector<il> vil;
typedef vector<li> vli;

#define ff first
const double pi = acos(-1.0);
#define ss second
#define pb push_back
#define mp make_pair
#define sz size()
#define MOD 1000000007
int dx8[] = {0, 0, 1, 1, 1, -1, -1, -1};
int dy8[] = {1,-1, 1, -1, 0, 0, -1, 1};

int minimum(int b, int e, int a[ ]){
    int i, mn=101;
    for(i=b;i<=e;i++)mn=min(mn, a[i]);
    return mn;
}

int main()
{
    #ifndef ONLINE_JUDGE
    freopen ("in.txt", "r", stdin);
    freopen ("out.txt", "w", stdout);
    #endif
    int t;
    cin>>t;
    while(t--){
        int n, i, idx, j, c=0;
        cin>>n; int a[n+1];
        map <int, int> mp; set<int> s;
        for(i=1;i<=n;i++){
            cin>>a[i];mp[a[i]]=i;
        }
        idx=1;
        for(i=1;i<=n;i++){
                int mn=minimum(idx, n, a);
                j=mp[mn];
                s.insert(a[i]);
                while(j>idx){
                    swap(a[j], a[j-1]);
                    j--;
                    c++;
                    if(c==n-1)break;
                }
                if(s.sz==i && *s.begin()==1)idx=mp[mn]+1;
                else idx=mp[mn];
            if(c==n-1)break;
        }
        for(i=1;i<=n;i++)cout<<a[i]<<" ";
        cout<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
#include <math.h>
#include <algorithm>
#include <vector>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef pair<ll, int> li;
typedef pair<int, ll> il;
typedef vector<ii> vii;
typedef vector<il> vil;
typedef vector<li> vli;

#define ff first
const double pi = acos(-1.0);
#define ss second
#define pb push_back
#define mp make_pair
#define sz size()
#define MOD 1000000007
int dx8[] = {0, 0, 1, 1, 1, -1, -1, -1};
int dy8[] = {1,-1, 1, -1, 0, 0, -1, 1};

int minimum(int b, int e, int a[ ]){
    int i, mn=101;
    for(i=b;i<=e;i++)if(a[i]<mn)mn=a[i];
    return mn;
}

int main()
{
    #ifndef ONLINE_JUDGE
    freopen ("in.txt", "r", stdin);
    freopen ("out.txt", "w", stdout);
    #endif
    int t;
    cin>>t;
    while(t--){
        int n, i, idx, j, c=0;
        cin>>n; int a[n+1];
        map <int, int> mp; set<int> s;
        for(i=1;i<=n;i++){
            cin>>a[i];mp[a[i]]=i;
        }
        idx=1;
        for(i=1;i<=n;i++){
                int mn=minimum(idx, n, a);
                j=mp[mn];
                s.insert(a[i]);
                while(j>idx){
                    swap(a[j], a[j-1]);
                    j--;
                    c++;
                    if(c==n-1)break;
                }
                if(s.sz==i && *s.begin()==1)idx=mp[mn]+1;
                else idx=mp[mn];
            if(c==n-1)break;
        }
        for(i=1;i<=n;i++)cout<<a[i]<<" ";
        cout<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
#include <math.h>
#include <algorithm>
#include <vector>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef pair<ll, int> li;
typedef pair<int, ll> il;
typedef vector<ii> vii;
typedef vector<il> vil;
typedef vector<li> vli;

#define ff first
const double pi = acos(-1.0);
#define ss second
#define pb push_back
#define mp make_pair
#define sz size()
#define MOD 1000000007
int dx8[] = {0, 0, 1, 1, 1, -1, -1, -1};
int dy8[] = {1,-1, 1, -1, 0, 0, -1, 1};

int main()
{
    #ifndef ONLINE_JUDGE
    freopen ("in.txt", "r", stdin);
    freopen ("out.txt", "w", stdout);
    #endif
    int t;
    cin>>t;
    while(t--){
        int n, i, idx, j, c=0;
        cin>>n; int a[n+1];
        map <int, int> mp;
        for(i=1;i<=n;i++){
            cin>>a[i];mp[a[i]]=i;
        }
        idx=1;
        for(i=1;i<=n;i++){
            if(i!=mp[i]){
                j=mp[i];
                while(j>idx){
                    swap(a[j], a[j-1]);
                    j--;
                    c++;
                    if(c==n-1)break;
                }
                idx=mp[i];
            }
            else idx=mp[i]+1;
            if(c==n-1)break;
        }
        for(i=1;i<=n;i++)cout<<a[i]<<" ";
        cout<<endl;
    }
    return 0;
}