void main()
{
  int alphabetic(char);
  int longest(char[]);
  int shortest(char[]);
  int i,j;
  char line[1000];
  gets(line);
  for(i=longest(line);alphabetic(line[i]);i++)
  printf("%c",line[i]);
  printf("\n");
  for(j=shortest(line);alphabetic(line[j]);j++)
  printf("%c",line[j]);
  printf("\n");
}

 int alphabetic(char c)
{

  if((c>='a'&&c<='z')||(c>='A'&&c<='Z'))
  return(1);
  else return(0);
}

 int longest(char string[])
{
  int len=0,length=0,flag=1,place=0,i,point;
  for(i=0;i<=strlen(string);i++)
  if(alphabetic(string[i]))
  if(flag)
  {
   point=i;
   flag=0;
   }
   else len++;
   else
  {
    flag=1;
    if(len>length)
    {
      length=len;
      place=point;
     }
      len=0;

   }
  return(place);
}
  int shortest(char string[])
 {
   int len=0,length=10,flag=1,place=0,i,point;
   for(i=0;i<=strlen(string);i++)
   if(alphabetic(string[i]))
   if(flag)
   {
     point=i;
     flag=0;
    }
    else len++;
   else
   {
     flag=1;
     if(len<length)
      {
         length=len;
         place=point;

       }
     len=0;
    }
   return(place);
}


int main(){
         char word[50][100]={0};
         char max[100],min[100];
	int len[50];
	int n;
	int da=0,xiao=100;
	for(int i=0;i<100;i++){
		scanf("%s",word[i]);
                  len[i]=strlen(word[i]);
                  n=i;
                  if(len[i]==0){break;}
	}
         for(int j=0;j<n;j++){
                  if(len[j]<xiao){
                       xiao=len[j];
                       strcpy(min,word[j]);
                  }
                  if(len[j]>da){
                       da=len[j];
                       strcpy(max,word[j]);
                  }
         }
         printf("%s\n",max);
         printf("%s\n",min);
      	return 0;
}


main()
{
	char str[1000],*p,*p1,*p2,*p3;
	int len,max=0,min=100;
	gets(str);
	for(p1=p=str;*p!='\0';p++)
	{
		if(*p==' ')
		{
			*p='\0';
			len=strlen(p1);
			if(len<min)   {min=len;p2=p1;}
			if(len>max) {max=len; p3=p1;}
			p1=p+1;
		}
	}
		len=strlen(p1);
			if(len<min)   {min=len;p2=p1;}
			if(len>max) {max=len; p3=p1;}

	puts(p3);
	puts(p2);
}


int main()
{
   char juzi[3000];
   gets(juzi);
   int n=strlen(juzi);
   int i;
   int cishu=0;
   char danci[50][100]={0};
   int m=0;
   int j=0;
   for(i=0; i<n; i++)
   {
	   if(juzi[i]!=' ')
       {
	    danci[m][j]=juzi[i];
		j+=1;
	   }
	   if(juzi[i]==' ')
	   {
	    m+=1;
		j=0;
	   }
   }
   int chang[50];
   int t;
   for(i=0; i<=m; i++)
   {
	   chang[i]=strlen(danci[i]);
   }
   for(i=0; i<=m; i++)
   {
      for(j=m; j>i; j--)
	  {
	      if(chang[j]>chang[j-1])
		  {
		     t=chang[j];
			 chang[j]=chang[j-1];
			 chang[j-1]=t;
		  }
	  }
   }
   int max=chang[0];
   int min=chang[m];
   cishu=0;
   int sum=0;
   for(i=0; i<=m; i++)
   {
       if(strlen(danci[i]) == max && cishu==0)
	   {
	     printf("%s", danci[i]);
		 cishu+=1;
	   }
   }
   for(i=0; i<=m; i++)
   {
       if(strlen(danci[i]) == min && sum==0)
	   {
	     printf("\n%s", danci[i]);
		 sum+=1;
	   }
   }
    return 0;
}


main()
{
   char c,str[1000],word[20];
   char longword[20],shortword[20];
   int i,j, longlen=0,shortlen=20;
   gets(str);
   i=0;
   j=0;
   while((c=str[i])!='\0')
     if(c!=' ')
       word[j++]=str[i++];
     else
     {
        i++;
        word[j]='\0';
        if(j>longlen)
         {  longlen=j;strcpy(longword,word);}
        if(j<shortlen)
         {  shortlen=j;strcpy(shortword,word);}
        j=0;
      }
	 word[j]=0;
	 if(j>longlen)
         {  longlen=j;strcpy(longword,word);}
        else if(j<shortlen)
         {  shortlen=j;strcpy(shortword,word);}
    puts(longword);
    puts(shortword);
}


int main()
{
   char str[LEN];
   int i,wordlen=0,maxlen=0,minlen=30,iofmax,iofmin;

   gets(str);
   for(i=0;;i++)
   {
      if(str[i]!=' '&&str[i]!='\0') wordlen++;
      else
      {
        if(wordlen>maxlen)
        {
           maxlen=wordlen;
           iofmax=i-wordlen;
        }
        if(wordlen<minlen)
        {
           minlen=wordlen;
           iofmin=i-wordlen;
        }
        wordlen=0;
      }
      if(str[i]=='\0') break;
   }

   for(i=iofmax;i<iofmax+maxlen;i++) printf("%c",str[i]);
   printf("\n");
   for(i=iofmin;i<iofmin+minlen;i++) printf("%c",str[i]);
   printf("\n");

  return 0;
}


int main()
{
	char allwords[WORD*LENGTH];

	int i;
	//int minPos = 0, maxPos = 0, tmpPos = 0;
	char *minP, *maxP, *tmpP;
	int minLen = LENGTH, maxLen = 0, tmpLen = 0;

	gets(allwords);

	int len = strlen(allwords);

    minP = &allwords[0];
	maxP = &allwords[0];
	tmpP = &allwords[0];

	for(i = 0; i < len + 1; i++)
	{
		if(allwords[i] == ' ' || allwords[i] == '\0')
		{
			if(tmpLen > maxLen)
			{
				maxP = tmpP;
				maxLen = tmpLen;
			}
			if(tmpLen < minLen)
			{
				minP = tmpP;
				minLen = tmpLen;
			}
			allwords[i] = '\0';
			tmpLen = 0;
			tmpP = &allwords[i + 1];
		}
		else
		{
			tmpLen++;
		}
	}

	printf("%s\n", maxP);
	printf("%s\n", minP);

	return 0;
}


void main(void)
{
	char s[4000];
	gets(s);

	char *start[200];
	start[0]=s;
	int l=0,n=1;
	while(s[l]!=0)
	{
		if(s[l]==','||s[l]==' ')
		{
			s[l]=0;
			if(s[l+1]!=','&&s[l+1]!=' ')
				start[n++]=s+l+1;
		}

		l++;
	}

	int len[200],i,max=0,min=0;
	for(i=0;i<=n-1;i++)
	{
		len[i]=strlen(start[i]);

		if(len[max]<len[i]) max=i;
		else if(len[min]>len[i]) min=i;
	}

	puts(start[max]);
	puts(start[min]);
}


int main()
{
	char word[1000]={'\0'};
	int length[100],point[100];
	int i,j,a,b,k,p,q;
	gets(word);
	k=strlen(word);
	a=0;
	b=0;
	point[1]=0;
	for(i=0;i<=k;i++)
	{
		if(word[i]==44||word[i]==32||word[i]=='\0')
		{
			b=b+1;
			length[b]=i-a;
			a=i+1;
			point[b+1]=i+1;
		}
	}
	a=length[1];
	p=1;
	for(i=2;i<=b;i++)
	{if(length[i]>a) {a=length[i];p=i;}}
	for(i=point[p];i<=point[p]+a-1;i++)
	{printf("%c",word[i]);}
	printf("\n");
	a=length[1];
	p=1;
	for(i=2;i<=b;i++)
	{if(length[i]<a&&length[i]!=0) {a=length[i];p=i;}}
	for(i=point[p];i<=point[p]+a-1;i++)
	{printf("%c",word[i]);}
	return 0;
}


int main(){
    char number[10000];
    gets(number);
    char danci[100][100];
    int max,min;
    int i,j,k=0,n=0;
    char chang[100],duan[100]="aaaaa";
    for(i=0;i<strlen(number);i++){
           if(number[i]!=' '&&number[i]!=0){
              danci[n][k]=number[i];
              k+=1;}
            else{
               n+=1;
               k=0;}

    }
    max=0;
    min=10;
    for(i=0;i<=n;i++){
        if(strlen(danci[i])>max){max=strlen(danci[i]);
            strcpy(chang,danci[i]);}
        if(strlen(danci[i])<min){min=strlen(danci[i]);
            strcpy(duan,danci[i]);}}
    printf("%s\n%s",chang,duan);
return 0;
}


//

int main()
{
	char sentence[2000], longist[40], shortist[20];
	int longnum = 0, shortnum = 200, thisnum = 0;
	int i = 0, l = 0, s = 0;
	cin.getline(sentence, 2000);
	do{
		thisnum = 0;
		while(sentence[i] != ',' && sentence[i] != ' ' && sentence[i] != '\0')
		{
			thisnum++;
			i++;
		}
		if (thisnum > longnum)
		{
			longnum = thisnum;
			l = i - thisnum;
		}
		if (thisnum < shortnum)
		{
			s = i - thisnum;
			shortnum = thisnum;
		}
		while(sentence[i] == ' ' || sentence[i] == ',')
			i++;
	}while(sentence[i] != '\0');
	for (i = l; i < l + longnum; i++)
		cout << sentence[i];
	cout << endl;
	for (i = s; i < s + shortnum; i++)
		cout << sentence[i];
	return 0;
}


// 13.1.cpp

int main()
{
	char ch[3000];
	int len1 = 0, len2 = 0, len = 0, i, j;
	int m = 0, n = 0, p = 0, num = 0;
	while(cin)
	{
		ch[len] = getchar();
		if (ch[len] == ' ' || ch[len] == '\n')
			num++;
		if (num == 1)
		{
			n = 0;
			len2 = len;
		}
		if (ch[len] == '\n')
			break;
		len++;
	}
	ch[len] = ' ';
	for (i = 0; i <= len; i++)
	{
		if (ch[i] != ' ')
			 p++;
		else
		{
			if (p > len1)
			{
				len1 = p;
				m = i - p;
			}
			if (p < len2)
			{
				len2 = p;
				n = i - p;
			}
			p = 0;
		}
	}
	for (i = m; i < m + len1; i++)
		cout << ch[i];
	cout << endl;
	for (i = n; i < n + len2; i++)
		cout << ch[i];
	cout << endl;
	return 0;
}


int main()
{  char str[10000];
   gets(str);
   char word[50],longword[50],shortword[50];
   int longnum=0,shortnum=50,k=0,i,j,num=0;
   for(i=0;i<strlen(str);i++)
   {
          if(str[i]!=' '&&str[i]!=',')
          {     num++;
                word[k]=str[i];
                k++;

          }
           if(((str[i]==' '||str[i]==',')&&str[i-1]!=' '&&str[i-1]!=',')||str[i+1]==0)
           {    word[k]=0;
                if(longnum<num)
                {longnum=num;
                 strcpy(longword,word);
                }
                if(shortnum>num)
                {shortnum=num;
                 strcpy(shortword,word);
                }
                num=0;
                k=0;
           }
   }
   longword[longnum]='\0';

   printf("%s\n%s",longword,shortword);
return 0;
}


int main()
{
	char str[50*100], word[50][100];
	int i,j,k,max,min,max1=0,min1=0;

	gets(str);

	for(i=0,k=0,j=0;str[i]!='\0';i++)
	{
		if(str[i]==' ')
		{
			word[k][j]='\0';
			k++;
			j=0;
			continue;
		}
		word[k][j]=str[i];
		j++;
	}
	word[k][j]='\0';

	max=(int)strlen(word[0]);
	min=(int)strlen(word[0]);

	for(i=0;i<=k;i++)
	{
		if(max<(int)strlen(word[i]))
		{
			max=(int)strlen(word[i]);
			max1=i;
		}
		if(min>(int)strlen(word[i]))
		{
			min=(int)strlen(word[i]);
			min1=i;
		}
	}

	printf("%s\n",word[max1]);
	printf("%s\n",word[min1]);

	return 0;
}


int main()
{
    int i,k;
    char a[100][100],b[100],c[100];
    int n=0;
    for(i=0;i<100;i++)
    {
        scanf("%s",a[i]);
        n++;
        k=getchar();
        if(k=='\n')
            break;
    }
    strcpy(b,a[0]);
    for(i=0;i<n;i++)
    {
        if(strlen(b)>strlen(a[i]))
            strcpy(b,a[i]);
    }
    strcpy(c,a[0]);
    for(i=0;i<n;i++)
    {
        if(strlen(c)<strlen(a[i]))
            strcpy(c,a[i]);
    }
    printf("%s\n",c);
    printf("%s\n",b);
}


int main()
{
	int n,a,b,c,len;
	unsigned maxlen,minlen;
	char max[20],min[20];
	char cen[20];
	scanf("%s",&cen);
	len=strlen(cen);
	maxlen=minlen=len;
	strcpy(max,cen);
	strcpy(min,cen);
	while(getchar()!='\n')
	{
		scanf("%s",&cen);
		if(strlen(cen)>maxlen)
		{
		strcpy(max,cen);
		maxlen=strlen(cen);
		}
		if(strlen(cen)<minlen)
		{
		strcpy(min,cen);
		minlen=strlen(cen);
		}

	}
	printf("%s\n",max);
	printf("%s\n",min);

}


int main(){
	char a[NUM*LEN];
	char b[NUM][LEN];
	int i,k,index;
	int max,min;
	gets(a);
    index=0;
	for(i=0;;i++){
		for(k=0;;){
			if(a[index]!=' '&&a[index]!=0){
				b[i][k]=a[index];
				index++;
				k++;
			}else{
				b[i][k]=0;
				index++;
				k++;
				break;
			}
		}
		if(a[index-1]==0){
			break;
		}
	}
    max=0;
    min=0;
	for(k=1;k<=i;k++){
		if(strlen(b[k])>strlen(b[max])){
			max=k;
		}
		if(strlen(b[k])<strlen(b[min])){
			min=k;
		}
	}
	printf("%s\n",b[max]);
    printf("%s\n",b[min]);
    return 0;
}


int main () {
	char s[5000];
	char *ss[50];

	int i,n=0,max=0,min=0;
	gets(s);
ss[n++]=s;
for(i=0;s[i];i++){
if(s[i]==' '){
s[i]=0;
ss[n++]=s+i+1;
}
}
for(i=0;i<n;i++){
if(strlen(ss[i])<strlen(ss[min])){
min=i;
}
if(strlen(ss[i])>strlen(ss[max])){
max=i;
}
}
puts(ss[max]);
puts(ss[min]);
return 0;
}


void main()
{
	int max,min,len,i,j;
	char *p,*q,*max_index,*min_index,a[1024];
	gets(a);
	max=0;
	min=100;
	for(p=q=a;;)
	{
		if(*q==' '||*q=='\0')
		{   len=q-p;
			if(len>max)
			{
				max=len;
				max_index=p;
			}
			if(len<min)
			{
				min=len;
				min_index=p;
			}
			if(*q=='\0') break;
		    q=p=q+1;
		}
		else
			q++;

	}
	for(;*max_index!=' '&&*max_index;max_index++)
		printf("%c",*max_index);
	printf("\n");
	for(;*min_index!=' '&&*min_index;min_index++)
		printf("%c",*min_index);
	printf("\n");

}


int main()
{
	char word[50][101];
	char input[5001];
	int num = 0;
	gets(input);
	int len = strlen(input);
	for(int i=0; i<len; i++)
	{
		int j=0;
		while(i<len && ((input[i]>='a'&&input[i]<='z') || (input[i]>='A'&&input[i]<='Z')))
		{
			word[num][j] = input[i];
			j++;
			i++;
		}
		if(j>0)
		{
			word[num][j] = '\0';
			num++;
		}
	}
	int max_len=strlen(word[0]);
	int min_len=max_len;
	int max_index = 0, min_index = 0;
	for(int i=1; i<num; i++)
	{
		if(max_len < strlen(word[i]))
		{
			max_index = i;
			max_len = strlen(word[i]);
		}
		if(min_len > strlen(word[i]))
		{
			min_index = i;
			min_len = strlen(word[i]);
		}
	}
	printf("%s\n%s\n", word[max_index], word[min_index]);
}


void main()
{
	int i,k,m,maxnum,minnum;
	int temp0,max,min;
	char a[100][20]={'\0'};
	char temp;
	k=0;m=0;
	while((temp=getchar())!='\n')
	{
		if(temp!=' ')
		{
			a[k][m]=temp;
			m++;
		}
		else
		{
			k++;
			m=0;
		}
	}

	max=0;min=100;
	for(i=0;i<=k;i++)
	{
		temp0=strlen(a[i]);
		if(temp0>max)
		{
			maxnum=i;
			max=temp0;
		}
		if(temp0<min)
		{
			minnum=i;
			min=temp0;
		}
	}

	printf("%s\n",a[maxnum]);
	printf("%s\n",a[minnum]);
}


int main()
{
	int n;
	int i;
	int j;
	int index=0;
	scanf("%d%*c",&n);
	char **pS=NULL;
	char **pS2=NULL;
	char buffer[256];
	char *temp=NULL;
	pS=(char **)malloc(sizeof(char **)*n);
	pS2=(char **)malloc(sizeof(char **)*n);
	for(index=0;index<n;index++)
	{
		temp=buffer;
		while((*(temp++)=getchar())!=' ')
		{
			if(*(temp-1)=='\n')
				break;
		}

		*(temp-1)='\0';

		pS[index]=(char *)malloc(temp-buffer);
		pS2[index]=(char *)malloc(temp-buffer);
		strcpy(pS[index],buffer);
		strcpy(pS2[index],buffer);
	}

	char *intermedia=NULL;

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

			if(strlen(pS[j])<strlen(pS[j+1]))
			{
				intermedia=pS[j];
				pS[j]=pS[j+1];
				pS[j+1]=intermedia;
			}
		}

	for(i=0;i<n;i++)
		for(j=0;j<n-1;j++)
		{
			if(strlen(pS2[j])>strlen(pS2[j+1]))
			{
				intermedia=pS2[j];
				pS2[j]=pS2[j+1];
				pS2[j+1]=intermedia;
			}
		}
	printf("%s\n%s",pS[0],pS2[0]);

	return 0;
}


void main()
{
	char s[20000],a[100],maxa[100],mina[100];
	int len,min=1000,max=0,i,j;
	gets(s);
	for(i=0;;i++)
	{
		for(j=0;s[i]!=' '&&s[i]!=','&&s[i]!='\0';j++,i++)
		{
			a[j]=s[i];
		}
		a[j]='\0';
		len=strlen(a);
		if(len==0)
			continue;
		if(max<len)
		{
			max=len;
			strcpy(maxa,a);
		}
		if(min>len)
		{
			min=len;
			strcpy(mina,a);
		}
		if(s[i]=='\0')
			break;
	}
	printf("%s\n%s\n",maxa,mina);
}


int main(){
	char juzi[NUM*LEN];
	char danci[NUM][LEN];
	int i, k, index;
	int maxLenDanCiIndex=0, minLenDanCiIndex=0;
	gets(juzi);
index = 0;
for(i = 0; ; i++){
	for(k = 0; ;){
		if(juzi[index] != ' ' && juzi[index] != 0){
			danci[i][k] = juzi[index];
			index++;
			k++;
		}else{
			danci[i][k] = 0;
			index++;
			k++;
			break;
		}
	}
	if(juzi[index-1] == 0){
		break;
	}
}

for(k = 1; k <= i; k++){
	if(strlen(danci[k]) > strlen(danci[maxLenDanCiIndex])){
		maxLenDanCiIndex = k;
	}

	if(strlen(danci[k]) < strlen(danci[minLenDanCiIndex])){
		minLenDanCiIndex = k;
	}
}
printf("%s\n", danci[maxLenDanCiIndex]);
printf("%s\n", danci[minLenDanCiIndex]);

	return 0;
}


int main()
{
   int i, y, z;
   char m[100], max[100],min[100];
   scanf("%s",m);
   y=z=strlen(m);
   strcpy(min,m);
   strcpy(max,m);
   for(i=1;i<50;i++)
   {
      scanf(" %s",m);
      if(y<strlen(m)){
          strcpy(max,m);
		  y=strlen(m);
      }
      if(z>strlen(m)){
          strcpy(min,m);
		  z=strlen(m);
      }
   }
   printf("%s\n%s",max,min);
   return 0;
}


int main()
{
	char a[100],b[100],c[100];
	int n,j,i,k,l,max,min;
	cin>>n;
	cin>>a;
	strcpy(b,a);
	strcpy(c,a);
	max=min=strlen(a);
	for(i=2;i<=n;i++)
	{
		cin>>a;
		k=strlen(a);
		if(k>max)
		{
			max=k;
			strcpy(b,a);
		}
		else if(k<min)
		{
			min=k;
			strcpy(c,a);
		}
	}
	cout<<b<<endl;
	cout<<c<<endl;
	return 0;
}


int main()
{
	char a[1000],b[1000]={0},c[1000]={0},da[1000],xiao[1000];
	int i,m,n,j,i1,j1,i2,j2,s0,s=0,k=0,count=0,max=0,min=0;
	char x;
	gets(a);
	n=strlen(a);
	max=0;
	min=n+1;
	for(i=0;i<n;i++)
	{
		x=a[i];
		if(x==32||x==39||i==n-1)
		{
			if(count>max&&i!=n-1)
			{
				max=count;
				b[count]=0;
				strcpy(da,b);
			}
			else if(i==n-1)
			{
				count++;
				b[count-1]=a[i];
				if(count>max)
				{
					max=count;
					b[count]=0;
					strcpy(da,b);
				}
				break;
			}
			count=0;
		}
		else
		{
			count++;
			b[count-1]=a[i];
		}
	}
	count=0;
	for(i=0;i<n;i++)
	{
		x=a[i];
		if(x==32||x==39||i==n-1)
		{
			if(count<min&&i!=n-1)
			{
				min=count;
				c[count]=0;
				strcpy(xiao,c);
			}
			else if(i==n-1)
			{
				count++;
				c[count-1]=a[i];
				if(count<min)
				{
					min=count;
					c[count]=0;
					strcpy(xiao,c);
				}
				break;
			}
			count=0;
		}
		else
		{
			count++;
			c[count-1]=a[i];
		}
	}
	printf("%s\n",da);
	printf("%s\n",xiao);
	return 0;
}


//*********************
//function:??????
//date:2012/12/28
//writer:???
//*********************
int main()
{
	char a[1000] = {0};
	cin.getline(a, 1000);
	int len;
	int i;
	int longhead = 0, longend = 0, shorthead = 0, shortend = 0;
	int longlen = 0, shortlen = 100, templen = 0, temphead = 0;
	len = strlen(a);

	for (i = 0;i < len;i++)
	{
		if (a[i] != ' ' && a[i] != ',')
			templen++;
		else
		{
			if (templen > longlen)
			{
				longlen = templen;
				longhead = temphead;
				longend = i - 1;
			}
			if (templen < shortlen)
			{
				shortlen = templen;
				shorthead = temphead;
				shortend = i - 1;
			}
			temphead = i + 1;
			templen = 0;
			if (a[i] == ',')
				i++;
		}
	}
	if (templen > longlen)
	{
		longlen = templen;
		longhead = temphead;
		longend = i - 1;
	}
	if (templen < shortlen)
	{
		shortlen = templen;
		shorthead = temphead;
		shortend = i - 1;
	}
	for (i = longhead;i <= longend;i++)
		cout << a[i];
	cout << endl;
	for (i= shorthead;i <= shortend;i++)
		cout << a[i];
	cout << endl;
	return 0;
}


main()
{
int n,l,s,ln=0,sn=30,i=0;
char a[200][30];
scanf("%d",&n);
while(n--)
{
scanf("%s",a[i]);
if(ln<strlen(a[i]))
{
ln=strlen(a[i]);
l=i;
}
if(sn>strlen(a[i]))
{
sn=strlen(a[i]);
s=i;
}
i++;
}
printf("%s\n%s",a[l],a[s]);
}


void main()
{
    char string[300],max[20]="",min[20]="aaaaaaaaaaaaaaa";
    int length,len,sho;
    do
    {
    	scanf("%s",string);
    	length=strlen(string);
    	len=strlen(max);sho=strlen(min);
    	if(length>len) strcpy(max,string);
    	if(length<sho) strcpy(min,string);
    }while (getchar()!='\n');
    puts(max);
    puts(min);
}


int main()
{
	char sen[1000];
	gets(sen);
	char danci[50][100];
	int i,k,n,len;
	k=0;
	n=0;
	len=strlen(sen);
	for(i=0;i<len;i++){
		if(sen[i]!=' '){
			danci[n][k]=sen[i];
			k++;
		}
		else{
			danci[n][k]='\0';
			n++;
			k=0;
		}
	}
	danci[n][k]='\0';
	int max = 0;
	int min=0;
for (i=1; i<n+1; i++) {
if (strlen(danci[i]) < strlen(danci[min])) {
min = i;
}
if (strlen(danci[i]) > strlen(danci[max])) {
max = i;
}
}
/* ??????? */
puts(danci[max]);
puts(danci[min]);
return 0;
}


int main()
{
	int n,i,l=0,s=100,p;
	char a[200][100];
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%s",&a[i]);
		p=strlen(a[i]);
		if(p>l)
			l=p;
		if(p<s)
			s=p;
	}
	for(i=0;i<n;i++)
	{
		p=strlen(a[i]);
		if(p==l)
		{
			puts(a[i]);
			break;
		}
	}
	for(i=0;i<n;i++)
	{
		p=strlen(a[i]);
		if(p==s)
		{
			puts(a[i]);
			break;
		}
	}
	return 0;
}


void main()
{
	char word[201][30]={0};
	int i,j,n,a[201]={0},flag=0;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%s",word+i);
		a[i]=strlen(*(word+i));
	}
	for(i=0;i<n;i++){
		flag=0;
		for(j=0;j<n;j++){
			if(*(a+i)<*(a+j)){
				flag=1;
				break;
			}
		}
		if(flag==1) continue;
		else if(flag==0){
			printf("%s\n",*(word+i));
			break;
		}
	}
	for(i=0;i<n;i++){
		flag=0;
		for(j=0;j<n;j++){
			if(*(a+i)>*(a+j)){
				flag=1;
				break;
			}
		}
		if(flag==1) continue;
		else if(flag==0){
			printf("%s\n",*(word+i));
			break;
		}
	}
}


void main()
{
	int i,num=0,a[50],max,min;
	char str[50][20],strmax[20],strmin[20],z;
	for(i=0;;i++)
	{
		scanf("%s",str[i]);
		a[i]=strlen(str[i]);
		num++;
		scanf("%c",&z);
		if(z=='\n') break;
	}
	max=a[0];
	min=a[0];
	strcpy(strmax,str[0]);
	strcpy(strmin,str[0]);
	for(i=1;i<num;i++)
	{
		if(a[i]>max)
		{
			max=a[i];
			strcpy(strmax,str[i]);
		}
		if(a[i]<min)
		{
			min=a[i];
			strcpy(strmin,str[i]);
		}
	}
	printf("%s\n%s",strmax,strmin);
}


void main()
{
	char c[1000];
	int i,count=0,max,min,mark1,mark2,length;
	gets(c);
	length=strlen(c);
	for(i=0;i<length+1;i++)
	{
		if(c[i]!=' '&&c[i]!='\0')
			count++;
		else
		{
			if(c[i-1]==',')
				count--;
			max=min=count;
			count=0;
			mark1=mark2=0;
			break;
		}
	}
	for(i=0;i<length+1;i++)
	{
		if(c[i]!=' '&&c[i]!='\0')
			count++;
		else
		{
			if(c[i-1]==',')
				count--;
			if(max<count)
			{
				max=count;
				mark1=i-max;
			}
			if(min>count)
			{
				min=count;
				mark2=i-min;
			}
			count=0;
		}
	}
	for(i=0;i<max;i++)
		printf("%c",c[mark1+i]);
	printf("\n");
	for(i=0;i<min;i++)
		printf("%c",c[mark2+i]);
	printf("\n");
}


void main()
{
	int i,j;
	char word[40],Max_word[40]="",Min_word[40]="afwefjaklwejfioajwe";
	do
	{
		scanf("%s",word);
		if (strlen(word)>strlen(Max_word)) strcpy(Max_word,word);
		if (strlen(word)<strlen(Min_word)) strcpy(Min_word,word);
	} while (getchar()!='\n');
	puts(Max_word);
	puts(Min_word);
}


int main()
{
  char s[20],min[20],max[20];
  char c;
  strcpy(min,"1111111111111111111");
  max[0]='\0';
  while(1)
    {
        scanf("%s",s);
        if(strlen(min)>strlen(s)) strcpy(min,s);
        if(strlen(max)<strlen(s)) strcpy(max,s);
        c=getchar();  if(c=='\n') break;
    }
  printf("%s\n",max);
  printf("%s\n",min);
}


int main(){
char str[500];
int i,j,longest=0,shortest=20,lenth,k=-1,a,b,c,d;
gets(str);
for(i=0;str[i]!='\0';i++)
{if(str[i]==' ')
{lenth=i-k;
if(lenth>longest)
{longest=lenth;
a=i;
b=k;}
if(lenth<shortest)
{shortest=lenth;
c=i;
d=k;}
k=i;}}
if(str[i]=='\0')
{lenth=i-k;
if(lenth>longest)
{longest=lenth;
a=i;
b=k;}
if(lenth<shortest)
{shortest=lenth;
c=i;
d=k;}
}
for(j=b+1;j<a;j++){
printf("%c",str[j]);}
printf("\n");
for(j=d+1;j<c;j++){
printf("%c",str[j]);}
return 0;
}


int main()
{
char a[2000];
int n,lmax=0,lmin=0,smax=0,smin=0,e=0,s=0,i,emax,emin;
gets(a);
n=strlen(a);
for(i=0;i<n;i++)
{
if(a[i]==' ')
{
lmax=i;
lmin=i;
emax=i;
emin=i;
break;
}
}
for(i=0;i<=n;i++)
{
if(a[i]==' '|| (i == n)){
e=i;
if(e-s>lmax)
{
lmax=e-s;
smax=s;
emax=e;
}
if(e-s<lmin)
{
lmin=e-s;
smin=s;
emin=e;
}
while(a[i]==' ')
i++;
s = i;
}
}
char max[300],min[300];
int j=0;
for(i=smax;i<emax;i++)
{
max[j]=a[i];
j++;
}
max[lmax]='\0';
j = 0;
for(i=smin;i<emin;i++)
{
min[j]=a[i];
j++;
}
min[lmin]='\0';
puts(max);
puts(min);
return 0;
}


int main(){
	char a[50][20];
	char b,c[50],d[50];
	int i,j;
	for(i=0;;i++){
		scanf("%s",a[i]);
		scanf("%c",&b);
		if(b=='\n'){
			j=i;
			break;}}
	strcpy(c,a[0]);
	strcpy(d,a[0]);

	for(i=0;i<=j;i++){
		if(strlen(a[i])>strlen(c))
			strcpy(c,a[i]);
		if(strlen(a[i])<strlen(d))
	         strcpy(d,a[i]);
	}
	printf("%s\n%s\n",c,d);
	return 0;
}


int main()
{
	int n,count[201]={0},paixu[201]={0},flag,len,m,tem,i,j;
	char sen[2000],word[201][50];
	scanf("%d",&n);
	scanf("\n");
	gets(sen);
	len=strlen(sen);
	flag=0;
	m=0;
	for(i=0;i<len;i++)
	{
		if((sen[i]!=' ')&&(flag==1))
			word[m][count[m]++]=sen[i];
		if((sen[i]!=' ')&&(flag==0))
		{word[m][count[m]++]=sen[i];flag=1;}
		if((sen[i]==' ')&&(flag==1))
		{m++;flag=0;}
	}
	for(i=0;i<=m;i++)
		paixu[i]=count[i];
	for(i=0;i<=m;i++)
		for(j=i+1;j<=m;j++)
			if(paixu[i]<paixu[j])
			{
				tem=paixu[i];
				paixu[i]=paixu[j];
				paixu[j]=tem;
			}
	for(i=0;i<=m;i++)
	{
		if(count[i]==paixu[0])
		{
			for(j=0;j<count[i];j++)
				printf("%c",word[i][j]);
			break;
		}
	}
	printf("\n");
	for(i=0;i<=m;i++)
	{
		if(count[i]==paixu[m])
		{
			for(j=0;j<count[i];j++)
				printf("%c",word[i][j]);
			break;
		}
	}
	return 0;
}


void main()
{
	char str[80][80],str1[80];
	int i=0,j=0,min=80,max=0,num=0,k,t,len,len1,lens;
	gets(str1);
	lens=strlen(str1);
  for(j=0;str1[j]!='\0';j++)
	{
		str[num][i++]=str1[j];
		k=i;
		if(str1[j]==' '||str1[j]=='\n')
		{
			str[num][i-1]='\0';
			num++;
				i=0;
		}
		t=num;

	}
	str[t][k]='\0';
	for(i=lens-1;;i--)
		if(str1[i]==' ')
		{
			k=i;
			break;
		}
 		j=0;
       for(i=k+1;i<lens;i++)
   str[t+1][j++]=str1[j];
   str[t+1][j]='\0';
	for(i=0;i<t+1;i++)
	{
		len1=strlen(str[i]);
		max=max>len1?max:len1;
		min=min<len1?min:len1;
	}
	for(i=0;i<t+1;i++)
	{
         len=strlen(str[i]);
		if(max==len)
		{
			printf("%s\n",str[i]);
			break;
		}
	}
	for(i=0;i<t+1;i++)
	{
		len=strlen(str[i]);
		if(min==len)

		{
			printf("%s\n",str[i]);
			break;
		}
	}
}


int main()
{
	int i,j,n;
	char a[200][25];
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%s",a[i]);
	}
	int maxi=0,mini=0;
	for(i=1;i<n;i++)
	{
		if(strlen(a[i])>strlen(a[maxi]))
			maxi=i;
		else if(strlen(a[i])<strlen(a[mini]))
			mini=i;
	}
	printf("%s\n%s",a[maxi],a[mini]);
	return 0;
}


int main()
{
	char sentence[N*31];
	int len,wordlen[N],max_wordlen,min_wordlen,max=0,min=0;
	int point[N],t=1;
	int i;
	gets(sentence);
	len=strlen(sentence);
	sentence[len]=' ';
	sentence[len+1]='\0';
	len=len+1;
	point[0]=0;
	for(i=0;i<len;i++)
	{
		if(sentence[i]==' ')
		{
			point[t]=i;
			point[t+1]=i+1;
			wordlen[(t-1)/2]=point[t]-point[t-1];
			t=t+2;
		}
		else if(sentence[i]==',')
		{
			point[t]=i;
			point[t+1]=i+2;
			wordlen[(t-1)/2]=point[t]-point[t-1];
			t=t+2;
			i++;
		}
	}
	max_wordlen=wordlen[0];
	min_wordlen=wordlen[0];
	for(i=0;i<=(t-3)/2;i++)
	{
		if(max_wordlen<wordlen[i])
		{
			max_wordlen=wordlen[i];
			max=i;
		}
		if(min_wordlen>wordlen[i])
		{
			min_wordlen=wordlen[i];
			min=i;
		}
	}
	for(i=point[max*2];i<point[max*2+1];i++)
	{
		printf("%c",sentence[i]);
	}
	printf("\n");
	for(i=point[min*2];i<point[min*2+1];i++)
	{
		printf("%c",sentence[i]);
	}
	printf("\n");
	return 0;
}


int main(int argc, char* argv[])
{
	int n,m,i,j,max=0,min=100;
	char str[201][255];
	int a[201];
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%s",str[i]);
		getchar();
		a[i]=strlen(str[i]);
        if(a[i]>max)  max=a[i];
		if(a[i]<min)   min=a[i];
	}
	//printf("%d %d",max,min);
    for(i=0;i<n;i++)
	{
		if(a[i]==max)  {
		 puts(str[i]);
	  printf("\n");
	  break;
		}
	}
	for(i=0;i<n;i++)
	{
	 if(a[i]==min)
	 {
		puts(str[i]);
	 printf("\n");
	 break;
	 }
	}
	return 0;
}


int main()
{
    int i,j=0,word=0,count=0;
    char str[1000];
    int p[50]={0};
    int l,n1,n2;
    int lengh[50]={0};
    gets(str);
    int len=strlen(str);
    for(i=0;i<len;i++){
        if(str[i]==' '){
        word=0;
        }
        else {
            if(word==0){
            word=1;
            p[j]=i;
            j++;
            count++;
            }
            }
        }
        for(i=j=0;i<count;i++){
            for(l=p[i];str[l]!=' '&&l<len;l++){
                lengh[j]++;
                }
                j++;
            }
            int max=0,min=100000;
            for(i=0;i<count;i++){
                if(lengh[i]>max){
                   n1=p[i];
                   max=lengh[i];
                    }
                    if(lengh[i]<min){
                        n2=p[i];
                        min=lengh[i];
                        }
                        }
              for(i=n1;str[i]!=' '&&i<len;i++)
              printf("%c",str[i]);
              printf("\n");
              for(i=n2;str[i]!=' '&&i<len;i++)
              printf("%c",str[i]);
              printf("\n");
              return 0;

    }


void main()
{
	char a[1000],b[50][100];
	int n,i,j,k,max=0,min;
	gets(a);
	n=strlen(a);
	min=n;
	for(i=0,k=0;i<n;i++)
	{
		if(a[i]!=' ')
		{
			for(j=i;j<n;j++)
			{
				if(a[j]==' ')break;
				else b[k][j-i]=a[j];
			}
			b[k++][j-i]='\0';
			i=j;
		}

	}
	for(i=0;i<k;i++)
	{
		if((int)strlen(b[i])>max)max=strlen(b[i]);
		if((int)strlen(b[i])<min)min=strlen(b[i]);
	}
	for(i=0;i<k;i++) if((int)strlen(b[i])==max) {printf("%s\n",b[i]);break;}
	for(i=0;i<k;i++) if((int)strlen(b[i])==min) {printf("%s\n",b[i]);break;}
}


void main()
{
	char a[100][100];int b[100];
	int i;char c;
	for(i=0;;i++)
	{
		scanf("%s",a[i]);
		c=getchar();
		if(c=='\n') break;
	}
	int n=i+1;
	for(i=0;i<n;i++)
	{
		b[i]=strlen(a[i]);
	}
	int max=0;int min=100;int imax=0,imin=0;
	for(i=0;i<n;i++)
	{
		if(b[i]>max) {max=b[i];imax=i;}
		if(b[i]<min) {min=b[i];imin=i;}
	}
	printf("%s\n%s",a[imax],a[imin]);
}


int main()
{
    int n ;
    cin>> n ;
    char a[100] = {0};
    a[0] = 1 ;
    int length = 1 ;
    for (int i = 0 ; i< n ; i++)
    {
        int add = 0 ;
        for (int j = 0 ; j<length ; j++)
        {
            a[j] *= 2 ;
            a[j] += add ;
            if (a[j] > 9)
            {
                int temp = a[j] ;
                add = temp /10 ;
                a[j] = temp % 10 ;
            }
            else
            {
                add = 0 ;
            }

        }
        if (add > 0)
        {
            a[length] = add ;
            length ++ ;
        }
    }
    for (int i = 0 ; i< length ; i++ )
        a[i] += '0' ;
    for (int i = length-1 ; i>= 0 ;i--)
        cout<<a[i] ;
    return  0;
}


int main()
{
	int a[MAXLEN]={0};
	int i,n,count=1;
	void multiply2(int a[MAXLEN]);

	cin >> n;
	a[0]=1;
	for (i=0;i<n;i++)			//calculate 2^n;
		multiply2(a);

	for (i=MAXLEN-1;i>=0;i--)	//find the highest bit
		if (a[i]!=0)
			break;

	for (;i>=0;i--)				//print result
		cout << a[i];
	cout << endl;

	return 0;
}

void multiply2(int a[MAXLEN])		//calculate a*2,and store the result in array a[]
{
	int i,l;
	for (l=MAXLEN-1;l>=0;l--)
		if (a[l]!=0)
			break;

	for (i=0;i<=l;i++)
		a[i] *= 2;
	for (i=0;i<l+2;i++)
		if ( a[i]>=10 )
		{
			a[i] -= 10;
			a[i+1]++;
		}
}


int a[100] = {0}, len = 1;
void cal(int);
void print();

int main()
{
	int n;
	cin >> n;
	a[0] = 2;
	if(n > 0)
	{
		cal(n);
		print();
	}
	else
	{
		cout << "1" << endl;
	}
	return 0;
}

void cal(int x)
{
	int i;
	if(x != 1)
	{
		for(i = 0; i < len; i++)
		{
			a[i] *= 2;
		}
		for(i = 0; i < len; i++)
		{
			if(a[i] >= 10)
			{
				a[i] -= 10;
				a[i+1] += 1;
				if(i == len - 1)
				{
					len++;
				}
			}
		}
		cal(x - 1);
	}
}

void print()
{
	int i;
	for(i = len - 1; i >= 0; i--)
	{
		cout << a[i];
	}
	cout << endl;
}


int num[101] = {0};
void fun()
{
	int temp = 0, j = 100;
	do
	{
		if (num[j] < 5)
		{
			num[j] =  num[j] * 2 + temp;
			temp = 0;
		}
		else
		{
			num[j] = num[j] * 2 - 10 + temp;
			temp = 1;
		}
		j--;
	} while(j >= 0);
	return;
}
int main()
{
	num[100] = 1;
	int N, i, flag = 0;
	cin >> N;
	for (i = 0; i< N; i++)
		fun();
	for (i = 0; i < 101; i++)
	{
		if (flag == 0 && num[i] == 0)
			continue;
		cout << num[i];
		flag = 1;
	}
	return 0;
}


int main ()
{
	int i,j,k,n, remain = 0, index;
	int ans[100000] = {1,0};
	cin >> n;
	for (i = 0; i < n; i++)
	{
		remain = 0;
		for (j = 0; j < 100000; j++)
		{
			ans[j] = 2*ans[j] + remain;
			remain = ans[j] /10;
			ans[j] = ans[j] %10;
		}
	}

	index = 99999;
	while (ans[index] == 0)
		index--;
	for (i = index; i >= 0; i--)
		cout << ans[i];
	cout << endl;

}


int main()
{
  int n,i;
  double result=1;
  scanf("%d",&n);
  result=pow(2.0,1.0*n);
  printf("%.0lf",result);
  return 0;
}


char a[2000];
int result[2000];
int temp[2000];
void calculate()
{
	memset(result,0,sizeof(result));
	int i = 0, j = 0;
	for(i = 0; i <= 1900; i++)
	{
		result[i] = temp[i] * 2 + result[i];
		if(result[i] >= 10)
		{
			result[i+1] = result[i] / 10 + result[i+1];
			result[i] = result[i] % 10;
		}
	}
	for(i = 0; i <= 1900; i++)
	{
		temp[i] = result[i];
	}
}
int main()
{
	memset(result,0,sizeof(result));
	memset(temp,0,sizeof(temp));
	temp[0] = 1;
	int n = 0, i = 0, j = 0;
	cin >> n;
	if(n == 0)
		cout << 1 << endl;
	else
	{
		for(i = 1; i <= n; i++)
		{
			calculate();
		}
		for(i = 1900; i >= 0; i--)
		{
			if(result[i] != 0)
				break;
		}
		for(j = i; j >= 0; j--)
		{
			cout << result[j];
		}
		cout << endl;
	}
	return 0;
}


int main()
{
	int ans[100]={0},flag=0;
	ans[0]=1;
	int n,i,j;
	cin>>n;
	for(j=1;j<=n;j++)
		for(i=0;i<100;i++)
		{
			ans[i]=ans[i]*2+flag;
			if(ans[i]>=10)
			{
				flag=1;
				ans[i]=ans[i]%10;
			}
			else
				flag=0;
		}
	for(i=99;i>=0;i--)
		if(ans[i]!=0)
			break;
	for(j=i;j>=0;j--)
		cout<<ans[j];
	cout<<endl;
	return 0;
}


/*
 * 2Npower.cpp
 * ?????2?N??
 *  Created on: 2013-1-11
 *      Author: ???
 */

void operate(int N);

int main()
{
	int N;               //?????
	cin>>N;              //?????
    operate(N);          //????operate
    return 0;
}

void operate(int N)
{
	int i,j;
	int num=0;
	int result[51];      //????
		memset(result,0,sizeof(result));//???
	if(N==0){
		cout<<'1';
		return  ;}
    result[50]=2;        //????
    for(i=2;i<=N;i++)
    {
        for(j=50;j>=0;j--)
        {
        	result[j]=result[j]*2+num;
        	if(result[j]>=10){
        		result[j]=result[j]-10;
        	    num=1;
        	}
        	else
        		num=0;
        }
    }
    for(i=0;i<=50;i++) //?????
    	if(result[i]!=0)
    		break;
    for(j=i;j<=50;j++) //??
    	cout<<result[j];
    return ;
}


int main()
{
	int a[45] = {0};
	int n;

	cin >> n;

	a[0] = 1;

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

		for(int j = 0; j <= 40; j ++)
		{
			p = a[j] * 2 + bit;
			a[j] = p % 10;
			bit = p / 10;
		}
	}

	int start;

	for(int i = 40; i >= 0; i --)
	if(a[i] != 0)
	{
		start = i;
		break;
	}

	for(int i = start; i >= 0; i --)
	cout << a[i];

	return 0;
}


char result[30] = {0};
void mul();
int main()
{
    int n;
    result[0] = '1';
    cin >> n;
    int i;
    if(n == 0)   cout << result << endl;
    else
    {
        for(i = 1; i <= n; i++)
            mul();
        for(i = strlen(result) - 1; i >= 0; i--)
            cout << result[i] ;
    }
    return 0;
}
void mul()
{
    int k;
    int div = 0;
    k = strlen(result);
    for(int i = 0; i < k; i++)
    {
       int t;
       t = result[i] - '0';
       t = t * 2;
       result[i] = t % 10 + div + '0';
       div =  t / 10;
       if(i == k - 1 && div != 0)
            result[i + 1] = div + '0';
    }
}


int main()
{
    int n,i;
    double a=1.0;
    scanf("%d",&n);
    for(i=1;i<=n;i++){
       a=a*2;
    }
    printf("%.0lf",a);
    scanf("%d",&n);
    return 0;
}


double f(double a);
int main(){
    double n,m;
    scanf("%lf",&n);
	m=f(n);
	printf("%.0lf",m);
	return 0;
}
double f(double a)
{
    double b;
	if(a==0) b=1.0;
    else if(a==1) b=2,0;
	else b=f(a-1)*2.0;
	return b;
}


int num[40]={0};
int jinwei[40]={0};
void square()  //?2
{
	for (int i=39;i>0;i--)
	{
		int a=num[i]*2;
		jinwei[i-1]=a/10;
		num[i]=a%10+jinwei[i];
	}
}
int main ()
{
	num[39]=1;     //???2?0??=1
	int n;
	cin>>n;
	for (int i=0;i<n;i++)    //?n?2
		square();
	int head;
	for (int i=0;i<40;i++)
		if (num[i]!=0)
		{
			head=i;
			break;
		}
	for (int i=head;i<40;i++)
		cout<<num[i];

	return 0;
}


int main()
{
	int n, temp = 0;
	int power[32] = {0,1};
	cin >> n;
	for(int i = 1; i <= n; i++)
	{
		for(int j = 1; j < 32; j++)
		{
			power[j] *= 2;
			power[j] += temp;
			if(power[j] >= 10)
			{
				power[j] -= 10;
				temp = 1;
			}
			else
				temp = 0;
		}
	}
	int i = 31;
	while(power[i] == 0)
		i--;
	for(int j = i; j >= 1; j--)
		cout << power[j];
	cout << endl;
	return 0;
}


/**
 * ??????
 * ???1000012844
 * ?????2?N??
 **/

void multiply( char str[], int n );

int main()
{
	int N;
	char str[ 200 ] = "1";

	cin >> N;

	while ( N > 0 )
	{
		multiply( str, 2 );
		N--;
	}

	cout << str << endl;

	return 0;
}

void multiply( char str[], int n )
{
	int num[ 200 ];
	int jump = 0, temp;
	memset( num, 0, sizeof( num ) );
	char *sPtr = str + strlen( str ) - 1;
	int *nPtr = num + 199;

	while( sPtr != str - 1 )
	{
		*nPtr-- = *( sPtr-- ) - '0';
	}

	nPtr = num + 199;

	while ( nPtr != num - 1 )
	{
		temp = *nPtr * n % 10 + jump;
		jump = *nPtr * n / 10;
		*nPtr-- = temp;
	}

	nPtr = num;
	sPtr = str;
	while ( *nPtr == 0 )
	{
		nPtr++;
	}

	while ( nPtr != num + 200 )
	{
		*sPtr++ = *nPtr++ + '0';
	}

	*sPtr = 0;
}


int main()
{
double n,a;
scanf("%lf",&n);
a=pow(2.0,n);
printf("%.0lf",a);
return 0;
}


//?????????//
char cnum[100];
int inum[100];
int cal();
int main ()
{
	memset(cnum, '0', sizeof(cnum));
	memset(inum, 0, sizeof(inum));
	cnum[0] = '1';
	int len;
	int n;
	cin >> n;
	if (n == 0)
	{
		cout << "1" << endl;
		return 1;
	}
	for (int i = 1; i <= n; i++)
	{
		len = cal();
	}
	for (int i = len; i >= 0; i--)
		cout << cnum[i];
	cout << endl;
	return 0;
}
int cal()
{
	int i;
	for (i = 0; i < 100; i++)
		inum[i] = cnum[i] - '0';
	for (i = 0; i < 100; i++)
		inum[i] *= 2;
	for (i = 0; i < 100; i++)
	{
		if (inum[i] >= 10)
		{
			inum[i] -= 10;
			inum[i + 1]++;
		}
	}
	for (i = 0; i < 100; i++)
		cnum[i] = inum[i] + '0';
	for (i = 99; i >= 0; i--)
		if (inum[i] != 0)
			break;
	return i;
}


int main(){
	int n,i;
	double f;
	scanf("%d",&n);
	f=pow(2.0,(double)n);
	printf("%.0lf",f);
	return 0;
}


char result[33] = {0};

void Multiply()
{
	int i = 0, up = 0;
	int len = strlen(result);
	for (i = 0; i < len; i++)
	{
		int temp = result[i] - '0';
		temp *= 2;
		result[i] = temp % 10 + up + '0';
		up = temp / 10;
		if (i == len - 1 && up != 0)
			result[i + 1] = up + '0';
	}
}

int main()
{
	int n;
	result[0] = '1';
	cin >> n;
	int i;
	if (n == 0)
		cout << result << endl;
	else
	{
		for (i = 1; i <= n; i++)
			Multiply();
		for (i = strlen(result) - 1; i >= 0; i--)
			cout << result[i];
	}
	return 0;
}


const int MAX_DIGIT = 10000;

int main()
{
    int num[100];
    num[0] = 1;
    num[1] = 0;
    int numDigits = 1;
    int n;
    cin >> n;
    for (int i = 0; i < n; ++i)
    {
        int end = numDigits;
        for (int i = 0; i < end; ++i)
        {
            num[i] *= 2;
        }
        for (int i = 0; i < end; ++i)
        {
            if (num[i] >= MAX_DIGIT)
            {
                if (i != numDigits - 1)
                    num[i+1] += num[i] / MAX_DIGIT;
                else
                {
                    num[numDigits] = num[i] / MAX_DIGIT;
                    ++numDigits;
                }
            }
            num[i] = num[i] % MAX_DIGIT;
        }
    }
    for (int i = numDigits - 1; i >= 0; --i)
    {
        if (i != numDigits - 1)
            cout << setfill('0') << setw(4);
       cout << num[i];
    }
    cout << endl;
}


int main()
{
	int a[50] = {0};
	int n, i, j, carry, temp;
	cin >> n;
	a[0] = 1;
	for (i = 1;i <= n;i++)
	{
		carry = 0;
		for (j = 0;j < 49;j++)
		{
			temp = floor(a[j] * 2 / 10);
			a[j] = (a[j] * 2) % 10;
			a[j] += carry;
			carry = temp;
		}
	}
	temp = 0;
	for (i = 0;i < 49;i++)
		if (a[i] != 0)
			temp = i;
	for (j = temp;j >= 0;j--)
		cout << a[j];
	cout << endl;
	return 0;
}


//
//  main.cpp
//  final
//
//  Created by blues cookie on 13-1-11.
//  Copyright (c) 2013? blues cookie. All rights reserved.
//

int a[100]={1};
int len=1;
void cal(int num)
{
	if(num==0)return;int carrybit=0;
	int i;
	for(i=0;i<len;i++)
	{
		a[i]=a[i]*2+carrybit;
		carrybit=a[i]/10;
		a[i]=a[i]%10;
	}
	if(carrybit==1)
	{
		len++;
		a[i]=1;
	}
	cal(num-1);
}
int main()
{
	int num;
	cin>>num;
	cal(num);
	for(int j=len-1;j>=0;j--)
	{
		cout<<a[j];
    }
}


int main()
{
	int i,n,temp=39,isum,ins,step=0;
	char sum[40];
	for(i=0;i<40;i++) sum[i]='0';
	sum[39]='1';
	cin >> n;
	if(n==0) {
		cout << '1' << endl;
		return 0;
	}
	else{
	while(n > 0){
		for(i=0;i<40;i++){
			if(sum[i]!='0') {
				temp=i;
				break;
			}}
		for(i=39;i>=temp-1;i--){
			isum=(int)sum[i]-48;
			ins=isum*2+step;
			if(ins < 10){
				sum[i]=(char)(ins+48);
				step=0;
			}
			else{
				sum[i]=(char)(ins+38);
				step=1;
			}}
		n--;
	}}
	for(i=0;i<39;i++){
		if(sum[i] != '0') {
			temp=i;
			break;
		}}
	for(i=temp;i<=39;i++) cout << sum[i];
	cout << endl;
	return 0;
}


//#include "stdafx.h"

int lena=0;
void cheng(int *a)
{
	for (int i=0;i<lena;i++)
	{
		a[i]=a[i]*2;

	}
	for (int i=0;i<lena;i++)
	{
		a[i+1]+=a[i]/10;
		a[i]=a[i]%10;
	}
	if (a[lena]>0) lena++;
	//cout<<lena;
}
int main()
//int _tmain(int argc, _TCHAR* argv[])
{
	int a[10000]={1};
	int n;
	lena=1;
	cin>>n;
	for (int i=0;i<n;i++)

	cheng(a);
	for (int i=lena-1;i>=0;i--)
		cout<<a[i];
	cout<<endl;

}


char number[110]={0};
void fraction()
{
	int yushu=0;
	for ( int i=100;i>=0;i--)
	{
		if(number[i]!='0')
		number[i]=number[i]*2-'0'+yushu;
		else
		{
			number[i]=number[i]+yushu;
			yushu=0;
		}
		if(number[i]>'9')
		{
			number[i]=number[i]-10;
			yushu=1;
		}
		else
			yushu=0;
	}
}
int main()
{
	int n;
	cin>>n;
	for ( int i=0;i<100;i++)
		number[i]='0';
	number[100]='1';
	for ( int i=0;i<n;i++)
	{
		fraction();
	}
	int start=0;
	for( int i=0;i<=100;i++)
		if(number[i]!='0')
		{
			start=i;
			break;
		}
	for ( int i=start;i<=100;i++)
	cout<<number[i];

	return 0;

}


int num[101]={2};
int mul();
int main()
{
	int i;
	int n;
	int a;
	cin>>n;
	if (n==0)
		cout<<'1'<<endl;
	else
	{
	for (i=0;i<n-1;i++)
		mul();
	for (i=100;i>=0;i--)
		if (num[i]!=0)
		{
			a=i;
			break;
		}
	for (i=a;i>=0;i--)
		cout<<num[i];
	cout<<endl;
	}
return 0;
}
int mul()
{
	int i;
	int temp[101]={0};
	for (i=0;i<101;i++)
		temp[i]=2*num[i];
	for (i=0;i<101;i++)
	{
		if (temp[i]>9)
		{
			temp[i+1]+=temp[i]/10;
			num[i]=temp[i]%10;
		}
		else
			num[i]=temp[i];
	}
	return 0;
}


int main()
{
	int n;
	int an[100]={4,2,8,1,4,7,3,7,0,1,-1};
	int carry=0;
	int dig;
	cin>>n;
	if(n<=30)
		cout<<(int)pow((double)2,(double)n)<<endl;
	else
	{
		n=n-30;
		for(int i=0;i<n;i++)
		{
			carry=0;
			for(dig=0;an[dig]+1;dig++)
			{
				an[dig]=an[dig]*2+carry;
				carry=an[dig]/10;
				an[dig]=an[dig]%10;
			}
			if(carry)
			{
				an[dig]=carry;
				an[dig+1]=-1;
			}
		}
		int st;
		for(st=100;an[st]!=-1;st--){}
		for(int i=st-1;i>=0;i--)
			cout<<an[i];
		cout<<endl;
	}
	return 0;
}


int main(int argc, char* argv[])
{
	int n;
	scanf("%d",&n);
	double sum=1;
	for(int i=1;i<=n;i++)
	{
	sum=sum*2;
	}

	printf("%.lf",sum);

	return 0;
}


int main(){
    int n;
    int result[32]={0};
    int carry=0;
    int i,j,key=0;
    scanf("%d",&n);
    if(n==0){
       printf("1");
    }else{
       result[0]=1;
       for(i=1;i<=n;i++){
           for(j=0;j<32;j++){
               result[j]=result[j]*2+carry;
               carry=0;
               if(result[j]>=10){
               result[j]=result[j]-10;
               carry=1;
               }
           }
       }
       for(i=31;i>=0;i--){
               if(result[i]!=0){
               printf("%d",result[i]);
               i--;
               break;
               }
       }
       for(;i>=0;i--){
               printf("%d",result[i]);
       }
    }

	return 0;
}


void increase (char []);
int main()
{
	int N, sum = 0, i, j;
	char num[100];
	memset (num, '\0',100);
	num[0] = '1';
	cin >> N;
	for (i = 0; i < N; i++)
		increase (num);
	i = 0;
	while (num[i] != '\0') ++i;
	for (j = i - 1; j >= 0; j--)
	{
		cout << num[j];
	}
	return 0;
}
int mid = 0;
void increase (char num[100])
{
	int n = 0;
	while (num[n] != '\0' || mid != 0)
	{
		if (num[n] != '\0')
		mid += (num[n] - '0') * 2;
		if (mid < 10)
		{
			num[n] = mid + '0';
			mid = 0;
		}
		else
		{
			num[n] = mid % 10 + '0';
			mid = 1;
		}
		++n;
	}
}


int main()
{
	int n,i,N;
	double total;
	total=1.0;
    scanf("%d",&N);
    if(N==0){
             total=1;}
    if(N!=0){
    for(i=0;i<N;i++){
                     total*=2;
                     }
    }
    printf("%.0lf",total);
	scanf("%d",&n);
	return 0;
}


int num[10000000] = {0}, flag[10000000], len = 1;

void minusn()
{
	int i;
	flag[0] = 0;
	for(i = 0; i < len; i++)
	{
		num[i] *= 2;
		num[i] += flag[i];
		flag[i+1] = 0;
		if(num[i] >= 10)
		{
			flag[i+1] = 1;
			num[i] = num [i] % 10;
		}

	}
	if(flag[i] == 1)
	{
		len++;
		num[i] += flag[i];
	}

	return;
}

int main()
{
	int n, i, j, temp;
	num[0] = 1;
	cin >> n;
	for(i = 1; i <= n; i++)
		minusn();
	for(j = 0, i = len - 1; j < len / 2; j++, i--)
	{
		temp = num[i];
		num[i] = num[j];
		num[j] = temp;
	}
	for(i = 0; i < len; i++)
		cout << num[i];
	cout <<endl;

	return 0;
}


int main()
{
    const int max = 200;
    int result[max+1];
    memset(result, 0, sizeof(result));
    int n, i, j;
    cin >> n;
    int size=1;
    result[0]= 1;
    int c = 0;
    for (i=0;i<n;i++)
    {
        for (j=0;j < size;j++)
        {
             result[j] = result[j] * 2 + c ;//??????????????
             if (result[j] >= 10)
             {
                 result[j] -= 10;
                 c = 1;
                 if (j == size-1)
                 {
                     size++;
                 }
             }
             else
             {
                 c=0;
             }
        }
    }
    i=max;
    while (result[i] == 0)
    {
          i--;
    }
    for (;i>=0;i--)
    {
        cout << result[i] ;
    }
    cout << endl;
    return 0;
}


int main()
{
    int m,n,i;
    double s=1;
    scanf("%d",&n);
    if(n==0){printf("1");}
    else
    {
        for(i=1;i<=n;i++)
        {
          s*=2;
        }
        printf("%.0f",s);
    }

    return 0;
}


int num[105]={0};
void times()
{
    int i,j,temp[105]={0};
    for(i=104;i>=0;i--)
    if(num[i]!=0) break;
    for(j=0;j<=i;j++)
    {
        temp[j]=num[i-j];
        temp[j]=temp[j]*2;
    }
    for(j=0;j<=i;j++)
    {
        temp[j+1]+=temp[j]/10;
         temp[j]=temp[j]%10;
    }
    if(temp[i+1]==0)
    {
        for(j=0;j<=i;j++)
        num[j]=temp[i-j];
    }
    else for(j=0;j<=i+1;j++)
         num[j]=temp[i+1-j];
}
int main()
{
    int i,n,stop;
    cin>>n;
    num[0]=1;
    for(i=0;i<n;i++)
    times();
    for(stop=104;num[stop]==0;stop--);
    for(i=0;i<=stop;i++)
    cout<<num[i];
    return 0;
}


void compute (int x, int time);
char num[100];
int ad[100];
int N, len = 1;
int main()
{
	int j, k;
	cin >> N;
	for (k = 0; k < 100; k++)
	{
		num[k] = '0';
		ad[k] = 0;
	}
	if (N == 0)
	{
		cout << '1';
		return 0;
	}
	num[0] = '2';
	compute(1, N);
	for (j = len - 1; j >= 0; j--)    // ????
	{
		cout << num[j];
	}
	return 0;
}

void compute (int x, int time)
{
	int i, number;
	if (time == 1)
	{
		return;
	}
	else if (x == time)   // ?x???????x + 1
	{
		return;
	}
	x++;  // ?x??????????2^2
	for (i = 0; i < len; i++)
	{
		if (num[i] != '0')
		{
			number = num[i] - '0';   // ?num[i]??i??????
			number = number * 2;
			if (number >= 10)
			{
				num[i] = number - 10 + '0';
				ad[i + 1] = ad[i + 1] + 1;
			}
			else
			{
				num[i] = number + '0';
			}
		}
	}

	for (int s = 0; s < 100; s++)
	{
		num[s] = num[s] + ad[s];
	}

	while (num[len] != '0')
	{
		len++;
	}
	for (int r = 0; r < 100; r++)
	{
		ad[r] = 0;
	}
	compute(x, N);
}


int main()
{
	int N;
	scanf("%d",&N);
	int i,sz[1000];
	double sum=1;
	for(i=1;i<=N;i++){
		sz[i]=2;
		sum=sum*sz[i];
	}
	printf("%.0lf",sum);
	return 0;
}


char *mul(char *, char *);

int main()
{
	char str1[100000] = "1", str2[100000];
	int n, i;
	int length = strlen(str2);
	char *q = str1, *p = str2;;
	cin >> n;
	for (i = 0; i < n; i++)
	{
		q = str1;
		p = mul(str1, str2);
		p--;
		for (; p >= str2; p--)
		{
			*q = *p;
			q++;
		}
	}
	cout << str1 << endl;
	return 0;
}
char *mul(char *num, char *str2)
{
	int length = strlen(num);
	char *p, *q;;
	p = num + length - 1;
	q = str2;
	int i, n = 0, m = 0, k = 0;
	for (i = 0; i < length; i++)
	{
		n = *p - '0';
		n = n * 2 + m;
		k = n % 10;
		m = n / 10;
		*q = k + '0';
		if (i != length - 1)
			p--;
		q++;
	}
	if (m != 0)
	{
		*q = m + '0';
		q++;
	}
	*q = '\0';
	return q;
}


/*
 * 3.cpp
 *
 *  Created on: 2011-12-31
 *      Author: 2011
 */
void times2(char *a,int length){
	int i,carry=0;
	for(i=0;i<length;i++){
		a[i]=a[i]*2+carry-'0';
		if(a[i]>'9'){
			a[i]=a[i]-10;
			carry=1;
		}
		else carry=0;
	}
	if(carry==1){
		a[length]='1';
	}
}
int main(){
	int n,i,length;
	cin>>n;
	char answer[100]="1";
	for(i=1;i<=n;i++){
		length=strlen(answer);
		times2(answer,length);
	}
	length=strlen(answer);
	for(i=length-1;i>=0;i--){
		cout<<answer[i];
	}
	cout<<endl;
	return 0;
}


int main()
{
	int N, i, j, count, flag;
	char num[1000];
	for (i = 0; i < 1000; i++)
	{
		num[i] = '0';
	}
	num[0] = '1';
	cin >> N;
	for (i = 1; i <= N; i++)
	{
		count = 999;
		while (num[count] == '0')
			count--;
		count++;
		j = 0;
		flag = 0;
		while (j <= count)
		{
			num[j] = 2 * num[j] - '0';
			if (flag == 1)
			{
				num[j]++;
			}
			if (num[j] > '9')
			{
				num[j] -= 10;
				flag = 1;
			}
			else flag = 0;
			j++;
		}
	}
	count = 100;
	while (num[count] == '0')
		count--;
	for (i = count; i >= 0; i--)
	{
		cout << num[i];
	}
	cout << endl;
	return 0;
}


void exponent(int a[], int n);
int main()
{
	int n;
	int a[200];
	int i;
	memset(a, 0, sizeof(a));
	a[0] = 1;
	cin >> n;
	exponent(a, n);
	for(i = 199; a[i] == 0; i--);
	for(;i >= 0;i--)
	{
		cout << a[i];
	}
	return 0;
}
void exponent(int a[], int n)
{
	if(n == 0)
		return;
	else
	{
		int i, k;
		for(i = 199; a[i] == 0; i--);
		for(k = 0; k <= i; k++)
		{
			a[k] = a[k] * 2;
		}
		for(k = 0; k <= i; k++)
		{
			a[k + 1] = a[k] / 10 + a[k + 1];
			a[k] = a[k] % 10;
		}
		exponent(a, n - 1);
		return;

	}
}


int n, num[100];
void multi()
{
	int pos = 0, step;
	while(num[pos] == 0)
	{
		pos++;
	}
	for(int i = 99; i >= pos; i--)
		num[i] *= 2;
	for(int i = 99; i >= pos; i--)
	{
		if(num[i] >= 10)
		{
			step = num[i] / 10;
			num[i - 1] += step;
			num[i] = num[i] % 10;
		}
	}
}
int main()
{
	int p = 0;
	cin >> n;
	if(n == 0)
		cout << 1 << endl;
	else
	{
		memset(num, 0, 100);
		num[99] = 2;
		for(int i = 1; i < n; i++)
			multi();
		while(num[p] == 0)
		{
			p++;
		}
		for(; p < 100; p++)
			cout << num[p];
	}
	return 0;
}


char number[100];
char transnum[100];
void inttochar(int num)
{
	int i = 0;
	char temp[100];
	do
	{
		temp[i] = num % 10 + '0';
		num = num / 10;
		i++;
	}while(num != 0);
	for (int j = i - 1; j >= 0; j--)
	{
		number[i - 1 - j] = temp[j];
	}
	return;
}
void multiply(char number[], int k)
{
	int t = 0;
	for(int j = strlen(number) - 1; j >= 0; j--)
	{
		transnum[j + 1] = ((number[j] - '0') * k + t)% 10 + '0';
		t = ((number[j] - '0') * k + t)/ 10;
	}
	transnum[0] = t + '0';
	strcpy(number, transnum);
	return;
}
int main()
{
	int n;
	cin >> n;
	if (n < 31)
	{
		cout << (int)pow((double)2, n) << endl;
	}
	else
	{
		int num = (int)pow((double)2, 30);
		inttochar(num);
		n = n - 30;
		while (n != 0)
		{
			if (n <= 3)
			{
				int k = (int)pow((double)2, n);
				multiply(number, k);
				n = 0;
			}
			else
			{
				multiply(number, 8);
				n = n - 3;
			}
		};
		int i = 0;
		do
		{
			if(number[i] != '0')
				break;
			else
				i++;
		}while(1);
		for (int j = i; j < strlen(number); j++)
		{
			cout << number[j];
		}
		cout << endl;
	}
	return 0;
}


int main()
{
	int N;
	cin >> N;
	const int  MAX_LEN = 210;
	unsigned num[MAX_LEN + 1] = { 0 };
	num[1] = 1;

	for (int i = 1; i <= N; i++)
	{
		for (int k = 1; k <= N; k++)
			num[k] *= 2;
		for (int k = 1; k <= N; k++)
			if (num[k] >= 10)
			{
				num[k + 1] = num[k + 1] + num[k] / 10;
				num[k] = num[k] % 10;
			}
	}
	int j = MAX_LEN;
	while (num[j] == 0)
		j--;
	for (int k = j; k > 0; k--)
		cout << num[k];
	cout << endl;
	return 0;
}


char number[100];
int main()
{
	number[0]='0';
	int n;
	cin>>n;
	void power(int);
	if(n==0)
		cout<<"1"<<endl;
	else
	{
	power(n-1);
	int i;
	for(i=1;i<=strlen(number)-1;i++)
		cout<<number[i];
	}
	return 0;
}

void power(int n)
{
	if(n==0)
		number[1]='1';
	else
		power(n-1);
	int len=strlen(number);
	int a[100];
	a[len-1]=0;
	int i;
	for(i=len-1;i>=1;i--)
	{
		if(2*(number[i]-'0')+a[i]<=9)
			number[i]=2*(number[i]-'0')+a[i]+'0',a[i-1]=0;
		else
			number[i]=2*(number[i]-'0')+a[i]-10+'0',a[i-1]=1;
	}
	if(a[0]==1)
		number[0]='1';
	else
		number[0]='0';
	if(number[0]!='0')
	{
		for(i=len;i>=1;i--)
			number[i]=number[i-1];
		number[0]='0';
	}
}


int main()
{
	int n, a[32] = {1}, compute[32] = {0}, k;
	cin >> n;
	for(int i = 1; i <= n; i++)
	{
		for(int j = 0; j < 32; j++)
			compute[j] += a[j] * 2;
		for(int j = 0; j < 32; j++)
		{
			compute[j + 1] += compute[j] / 10;
			compute[j] %= 10;
		}
		for(int j = 0; j < 32; j++)
			a[j] = compute[j];
		memset(compute, 0, sizeof(compute));
	}
	for(k = 31; k >= 0; k--)
		if(a[k])
			break;
	for(int i = k; i >= 0; i--)
		cout << a[i];
	cout << endl;
	return 0;
}


int main()
{
	int n, i, pos;
	const int MAX = 200;
	unsigned an[MAX]={0};
	an[0] = 1;
	cin >> n;
	if(n==0)
		cout << an[0];
	else
	{
		while(n--)
		{
			for(i=0;i<MAX;i++)
				an[i] = an[i] * 2;
			for(i=0;i<MAX;i++)
				if(an[i]>9)
				{
					an[i+1]+=an[i]/10;
					an[i] = an[i] % 10 ;
				}
		}
		for(i=MAX-1;an[i]==0;i--);
		for(;i>=0;i--)
			cout << an[i] ;
	}
	return 0;

}


int num[200]={0};
int len=0;
int plusbig()
{
	int i;
	for (i=0;i<len;i++)num[i]+=num[i];
	for (i=0;i<len-1;i++)
	{

		if(num[i]>=10)
		{
			num[i+1]++;
			num[i]=num[i]%10;
		}
	}
	if(num[len-1]>=10)
	{
		num[len-1]=num[len-1]%10;
		num[len]=1;
		len++;
	}
	return 0;
}
int main()
{
	int i,n;
	cin>>n;
	len=1;
	num[0]=1;
	for(i=0;i<n;i++) plusbig();
	for(i=len-1;i>=0;i--)cout<<num[i];
	return 0;
}


int main()
{
	int N;			//N????
	cin >> N;
	int num[32] = {0};
	num[1] = 1;
	int cntbyte = 1;

	for(int i = 1 ; i <= N ; i++)
	{
		for(int j = 1 ; j <= cntbyte ; j++)
			num[j] *= 2;
		for(int j = 1 ; j <= cntbyte ; j++)
		{
			if (num[j] >= 10)
			{
				num[j] -= 10;
				num[j+1] ++;
			}
		}
		if (num[cntbyte + 1] != 0)
			cntbyte ++;
	}
	for (int k = cntbyte; k >= 1; k--)
		cout << num[k];
	cin.get();
	cin.get();
	return 0;
}


int main()
{
	int n;
	cin>>n;

	if(n==0)
		cout<<1;
	else

	{
			int an[100];
			memset(an,0,sizeof(an));
			an[0]=2;
			for(int i=1;i<n;i++)
			{
				for(int jjj=0;jjj<90;jjj++)
					an[jjj]=2*an[jjj];
				for(int j=0;j<90;j++)
				{
					if(an[j]>=10)
					{
						an[j]=an[j]-10;
						an[j+1]+=1;
					}
				}
			}
			int jj=90;
			while(an[jj]==0)
				jj--;
			for(int mm=jj;mm>=0;mm--)
				cout<<an[mm];
	}
	return 0;
}


void everydouble(int a[])
{
     int i;
     for (i=0;i<=99;i++)
         a[i]*=2;
}

void moveahead(int a[])
{
     int i;
     for (i=0;i<=99;i++)
     {
         if (a[i]>=10)
         {a[i]-=10;a[i+1]++;}
     }
}

void print(int a[])
{
     int flag=0,i;
     for (i=0;i<=99;i++)
     {
         if (a[i]!=0)
            flag=i;
     }
     for (i=flag;i>=0;i--)
     printf("%d",a[i]);
}

int main(int argc, char *argv[])
{
  int n,i,j;
  scanf("%d",&n);
  int a[100];
  a[0]=1;
  for (i=1;i<=99;i++)
      a[i]=0;
  for (i=0;i<=n-1;i++)
  {
      everydouble(a);
      moveahead(a);
  }
  print(a);
  return 0;
}


/*
 * exam.cpp
 *
 *  Created on: 2011-12-31
 *      Author: 2011
 */
int main(){
	int result[10000]={1};
	int length=1,n,i,k;
	cin>>n;
	for (k=0;k<=n-1;k++){
	for (i=0;i<=length-1;i++){
		result[i]=result[i]*2;
	}
	for (i=0;i<=length-1;i++){
		result[i+1]=result[i+1]+result[i]/10;
		result[i]=result[i]%10;
	}
	if (result[i])length++;
}
	for (i=length-1;i>=0;i--)cout<<result[i];
	return 0;
}


int main () {
int n,i;
scanf ("%d",&n);
double s=1;
for (i=0;i<n;i++){
s=s*2;
}
printf ("%.0lf",s);
return 0;
}


int result[100];
int main()
{
    int n;
    cin >> n;
    int i, j, size = 1, c = 0;
    memset(result, 0 ,sizeof(result));
    result[0] = 1;
    for (i = 0; i < n; i++)
    {
        for (j = 0; j < size; j++)
        {
            result[j] = result[j] * 2 + c ;
            c = result[j]/10;
            if (result[j] >= 10)
            {
                result[j] = result[j] % 10;
                if (j == size - 1)
                {
                    size++;
                }
            }
        }
    }
    for(j = size - 1; j >= 0; j--)
    {
        cout << result[j];
    }
    return 0;
}


int main()
{
	double m = 1;
	int n, i;
	cin >> n;
	for (i = 1; i <= n; i++)
		m = m * 2;
	cout << setprecision(0) << fixed;
	cout << m;

}


int main()
{
	int trans,decimal = 0,i,len;
	char num[910000]={'0'};
	num[0]='2';
	long int p;
	cin >> p;
	if (p == 0)
	{
		cout << '1' << endl;
		return 0;
	}
	while(p -1)
	{
		decimal = 0;
		len = strlen(num);
		for (i = 0; i < len; i++)
		{
			trans = (num[i] -'0') * 2 + decimal;
			if (trans>=10)
			{
				trans-=10;
				num[i] = '0'+trans;
				decimal = 1;
			}
			else
			{
				num[i]='0'+ trans;
				decimal = 0;
			}
		}
		if (decimal)
		{
			num[i] = '1';
			num[i+1] = '\0';
		}
		else
		{
			num[i] = '\0';
		}
		p--;
	}
	len = strlen(num);
	for (i = len-1; i>=0; i--)
	{
		cout << num[i];
	}
	cout << endl;
	    return 0;
}


int main()
{
	int x, length = 1, i;
	char result[51];
	for (i = 1; i < 51; i++)
		result[i] = '0';
	result[0] = '1';
	for (cin >> x; x > 0; x--)
	{
		for (i = 0; i < length; i++)
			result[i] = result[i] * 2 - '0';
		for (i = 0; i < length - 1; i++)
			if (result[i] > '9')
			{
				result[i] -= 10;
				result[i + 1]++;
			}
		if (result[i] > '9')
		{
			result[i] -= 10;
			result[i + 1]++;
			length++;
		}
	}
	for (length--; length >= 0; length--)
		cout << result[length];
	return 0;
}


int main(){
	int n;
	scanf("%d",&n);
	int result1[MAX];
	int i;
	for(i=0;i<MAX;i++){
		result1[i]=0;
	}
	int p=1;
	int j=0;
	result1[0]=1;
	for(i=0;i<n;i++){
		for(j=0;j<MAX;j++){
			result1[j]=result1[j]*2;
		}
		for(j=0;j<MAX;j++){
			if(result1[j]>9){
			result1[j]=result1[j]-10;
			result1[j+1]++;
			}
		}
	}
	int m[MAX];
	for(i=0;i<MAX;i++){
		m[i]=result1[MAX-1-i];
	}
	j=0;
	while(j<MAX){
		if(m[j]==0){
			j++;
		}else{
			break;
		}
	}
	for(i=j;i<MAX;i++){
		printf("%d",m[i]);
	}
	printf("\n");
	return 0;
}


int main()
{
	char str[100];
	int num[100],i;
	memset(str,0,sizeof(str));
	memset(num,0,sizeof(num));
	int N;
	cin>>N;
	if(N==0) cout<<1<<endl;
	else{
	str[0] = 2;
	num[0] = 2;
	while(N>1)
	{
		N--;
		for(i=0;i<100;i++)
		{
			num[i] = num[i]*2;
		}
		for(i=0;i<100;i++)
		{
			if(num[i]>=10)
			{
				num[i] = num[i]-10;
				num[i+1]++;
			}
		}
	}
	int k=99;
	while(num[k]==0 && k>0) k--;
	for(i=k;i>=0;i--)
		cout<<num[i];
	cout<<endl;
	}
	return 0;
}


int main()
{
	int N, i, j, t = 0, result[1000] = {0};
	cin >> N;
	result[0] = 1;
	for (i = 0; i < N; i++)
	{
		result[0] = result[0] * 2;
		for (j = 0; j < 100; j++)
		{
			if (result[j] > 9)
			{
				result[j + 1] = result[j + 1] * 2 + 1;
				result[j] = result[j] - 10;
			}
			else
			{
				result[j + 1] = result[j + 1] * 2;
			}
		}
	}
	for (i = 90; i > 0; i--)
		if(result[i] != 0)
		{
			t = i;
			break;
		}
	for (i = t; i >= 0; i--)
		cout << result[i];
	return 0;
}


int main(){
	int n;
	double m;
	scanf("%d",&n);
	if(n==0){
		printf("1");
	}
	else{
		m=pow(2,n);
		printf("%.lf",m);
	}
	return 0;
}


/*
 * ????
 * Created on: 2013-1-4
 * ??
 * Author: ???
 */
int main(){
	double n;
	cin>>n;
	cout<<fixed<<setprecision(0)<<pow(2.0,n)<<endl;
	return 0;
}


int longInt[100];
int main()
{
 int size = 1;//??
 int c;//??
 int n;//n??
 int i;
    cin>>n;
 longInt[0] = 1;
 for(i = 0; i < n; i++)
 {
  c = 0;
  for(int j = 0; j < size; j++)
  {
   longInt[j] = longInt[j]*2 + c;
   c = longInt[j]/1000;
   if(longInt[j] >= 1000)
   {

    longInt[j] = longInt[j]%1000;
    if(j == size-1)
    {
     size ++;
    }
   }
  }
 }
 for(i = size - 1; i > -1; i--)
 {
  if(i != size-1)
  {
   cout<<setw(3)<<setfill('0');
  }
  cout<<longInt[i];

 }
 cout<<endl;

 return 0;
}


void f(int);
char mul[10000];
int main()
{
	int k, len, i;
	cin >> k;
	mul[0] = 2 + '0';
	if (k == 0)
	{
		cout << 1;
		exit(1);
	}
	f(k);
	len = strlen(mul);
	for (i = len - 1; i >= 0; i--)
		cout << mul[i] - '0';
	cout << endl;
	return 0;
}
void f(int k)
{
    int len, i;
	char mul_save[10000] = {0};
	if (k == 1)
		return ;
	else
	{
		len = strlen(mul);
		for (i = 0; i < len; i++)
		{
			mul_save[i] = (mul[i] - '0') * 2 + '0';
		}
		for (i = 0; i < len; i++)
		{
			if (mul_save[i] >= 10 + '0' && i != len - 1)
			{
				mul_save[i] -= 10;
				mul_save[i + 1]++;
			}
			else if(mul_save[i] >= 10 + '0')
			{
				mul_save[i] -= 10;
				mul_save[len] = 1+'0';
			}
		}
		if (mul_save[len] != 0)
			mul_save[len + 1] = 0;
		strcpy(mul, mul_save);
		f(k - 1);
	}
}


int num[1000]={0};
int jinwei[1000]={0};
int weishu=1;
int temp;
void multiply()
{
	int i;
	for (i=0;i<=weishu;i++)
	{
		temp=num[i]*2;
		num[i]=temp%10+jinwei[i];
		jinwei[i+1]=temp/10;
	}
	num[i]=jinwei[i];
	if (jinwei[weishu]==1)
	{
		weishu+=1;
	}
}
int main()
{
	int j,n;
	num[0]=1;
	cin >>n;
	for (j=0;j<n;j++)
	{
		multiply();
	}
	for (j=weishu-1;j>=0;j--)
	{
		cout <<num[j];
	}
	return 0;
}


void cheng(int a[100], const int n, int flag);
int main()
{
	int n;
	int a[100] = {2};
	cin >> n;
	if(n == 0)
		cout << "1" << endl;
	else
		cheng(a, n, 0);
	return 0;
}
void cheng(int a[100], const int n, int flag)
{
	int i = 0, j = 0, count = 0, l = 0, k = 0;
	int b[100] = {0};
	count = 99;
	while(a[count] == 0)
		count --;
	if(flag == n - 1)
	{
		for(i = 0; i <= count; i++)
			cout << a[i];
	}
	else
	{
		for(i = count; i >= 0; i--)
		{
			b[j++] = a[i];
		}
		for(i = 0; i <= count; i++)
			b[i] = b[i] * 2;
		for(i = 0; i <= count; i++)
		{
			if(b[i] >= 10)
			{
				b[i] = b[i] - 10;
			    b[i + 1]++;
			}
		}
		l = count + 1;
		while(b[l] == 0)
			l--;
		for(i = l; i >= 0; i--)
		{
			a[k++] = b[i];
		}
		flag++;
		cheng(a, n, flag);
	}
}


int a[200]={2};

void cal(int a[200],int I,int n)
{
	if(I==n)
	{
		int i;
		for(i=199;i>0;i--) if(a[i]) break;
		for(;i>=0;i--) cout<<a[i];
		cout<<endl;
	}

	else
	{
		int result[200]={0};

		for(int i=0;i<200;i++)
		{
			result[i]+=a[i]*2;
			if(result[i]>=10)
			{
				result[i+1]+=result[i]/10;
				result[i]=result[i]%10;
			}
		}

		cal(result,I+1,n);
	}
}

int main()
{
	int n;
	cin>>n;
	if(!n) cout<<1;

	else cal(a,1,n);

	return 0;
}


int a[50] = {0};

int length()
{
	int i;
	for (i = 49; i >= 0; i--)
		if (a[i] != 0)
			return (i + 1);
	return 0;
}

void power(int N)
{
	int i, temp, add = 0;
	if (N == -1)
		cout << "1" << endl;
	else if (N == 0)
	{
		for (i = length() - 1; i >= 0; i--)
			cout << a[i];
		cout << endl;
		return;
	}
	else
	{
		for (i = 0; i < length(); i++)
		{
			temp = add + a[i] * 2;
			a[i] = temp % 10;
			add = temp / 10;
		}
		a[i] = add;
		power(N - 1);
	}
}

int main()
{
	int N;
	a[0] = 2;
	cin >> N;
	power(N - 1);
	return 0;
}


int main ()
{
	int n, m = 0, i, j = 0, flag = 0, flag1 = 1;
	int result[1001] = {1};
	cin >> n;
	for (i = 0; i < n; i++)
	{
		for (j = 0; j <= 1000; j++)
		{
			if (flag == 0) result[j] = result[j] * 2;
			if (flag == 1) {result[j] = result[j] * 2 + 1; flag = 0;}
			if (result[j] >= 10)
			{
				result[j] = result[j] - 10;
				flag = 1;
			}
		}
	}

	for (i = 1000; i >= 0; i--)
	{
		if (result[i] == 0 && flag1 == 1)
		{ continue;}
		else
		{
			flag1 = 0;
			cout << result[i];
		}

	}

return 0;

}


int main(){
	double a,b;
	cin>>a;
	b=(double)pow(2,a);
	cout<<fixed<<setprecision(0);
	cout<<b<<endl;
	return 0;
}


int main()
{
int n;
int flag=1;
cin>>n;
int result[109];
memset(result,0,sizeof(result));
result[1]=1;
while(n>0)
{
n--;
for(int i=1;i<=100;i++)
   result[i]=result[i]*2;
for(int i=1;i<=100;i++)
   if(result[i]>=10)
      {
      result[i]=result[i]-10;
	  result[i+1]++;
	  }
}
for(int i=99;i>=1;i--)
   {
    if(result[i]>1e-6)
       flag=0;
    if(flag==0)
       cout<<result[i];
   }
return 0;
}


int main()
{
    const int MAX_LEN = 1000;
    int n,i,j;
    cin >> n;
    int num[MAX_LEN]={0};
    num[0]=1;
    for (i=0;i<n;i++)
    {
        for (j=0;j<MAX_LEN;j++)
        {
            num[j]=num[j]*2;
        }
        for (j=0;j<MAX_LEN;j++)
        {
            if (num[j]>=10)
            {
                num[j+1]=num[j+1]+num[j]/10;
                num[j]=num[j]%10;

            }
        }

    }
    i=MAX_LEN-1;
    while (num[i]==0)
    i--;
    for (;i>=0;i--)
    cout << num[i];
    return 0;

}


int main()
{
    int n, ans[101], len, t;
    memset(ans, 0, sizeof(ans));
    ans[0] = 1;
    len = 0;

    cin >> n;

    for (int i = 1; i <= n; ++i)
    {
        t = 0;
        for (int j = 0; j <= len; ++j)
        {
            ans[j] *= 2;
            ans[j] += t;
            if (ans[j] >= 10)
            {
                       t = 1;
                       ans[j] -= 10;
            }
            else
            {
                t = 0;
            }
        }
        ans[len + 1] += t;
        if (ans[len + 1] != 0) ++len;
    }
    for (int i = len; i >= 0; --i)
      cout << ans[i];
    return 0;
}


int main(){
    int array[1000],i,j,add=0,head,n;
    scanf("%d",&n);
    array[0]=1;
    head=1;
    for (i=0;i<n;i++)
    {
        for (j=0;j<head;j++)
        {
        array[j]=add+array[j]*2;
        add=0;
        if (array[j]>=10)
        {
         add=array[j]/10;
         array[j]=array[j]%10;
         if (j+1==head)
         {
         array[head]=add;
         add=0;
         head++;
         break;
         }
        }}
    }
    for (i=head-1;i>=0;i--)
        printf("%d",array[i]);
    return 0;
}


int main(int argc, char* argv[])
{
   double n,i,k=1;
   scanf("%lf",&n);
   if(n==0){
	   printf("1");
   }else{
	   for(i=0;i<n;i++){
           k=2*k;
	   }
       printf("%.0lf",k);
   }
	return 0;
}


int main()
{
	int n , len = 1;
	int num [50]  = { 0 }, *p = num , carry = 0;
	num [ 0 ] = 1;
	cin >> n;
	while ( n -- )
	{
		p = num;
		carry = 0;
		while ( p < num + len )
		{
			*p *= 2;
			*p += carry;
			carry = 0;
			while ( *p > 9 )
			{
				carry ++;
				*p -= 10;
			}
			p ++;
		}
		if ( carry )
		{
			len ++;
			*p = carry;
		}
	}
	if ( *p == 0 )
		p --;
	while ( p >= num )
	{
		cout << *p;
		p --;
	}
	return 0;
}


int result[ 50 ] = { 1 } ;

void power2( int n ) ;

int main()
{
	int n ;

	cin >> n ;

	power2( n ) ;

	return 0 ;
}

void power2( int n )
{
	int i , j = 0 ;

	for( i = 0 ; i < 50 ; i ++ )
		result[ i ] = result[ i ] * 2 ;

	for( i = 0 ; i < 50 ; i ++ )
		if( result[ i ] >= 10 )
		{
			result[ i + 1 ] = result[ i + 1 ] + result[ i ] / 10 ;
			result[ i ] = result[ i ] % 10 ;
		}

	if( n == 1 )
	{
		i = 50 - 1 ;

		while( result[ i ] == 0 )
			i -- ; //???????0??

		for( ; i >= 0 ; i -- )
			cout << result[ i ] ; //??????

		cout << endl ;

		return ;
	}

	else
	{
		if( n == 0 )
		{
			cout << 1 ;
			return ;
		}
		else
			power2( n - 1 ) ;
	}
}


int main()
{
	char answer[100];
	for(int i=0; i<100; i++) answer[i]='0';
	answer[0]='1';
	int num;
	cin>>num;

	int flag=0;
	while(num>0)
	{
		for(int i=0; i<=80; i++)
		{

			answer[i]=answer[i]+answer[i]-48;
			if(flag==1)
			{
				flag=0;
				answer[i]++;
			}
			if(answer[i]>'9')
			{
				flag=1;
				answer[i]=answer[i]-10;
			}

		}
		num--;
	}
	int i=80;
	while(answer[i]=='0')
	{   i--;

	}
	for(int j=i; i>=0; i--)
	{

		cout<<answer[i];
	}
	cout<<endl;
	return 0;
}


/* Name        : ??2?N??
 * Version     : 1.0
 * Date        : 2013-01-11
 * New         :
 * Description :
 * State       : Design
 */
int main()
{
    int Num[35]={1},Jinwei[35]={0};
    int N=0;
    cin>>N;
    for (int k=0;k<N;k++)
    {
        for (int i=0;i<33;i++)
        {
            Num[i]=Num[i]*2+Jinwei[i];
            if (Num[i]>9) Num[i]=Num[i]-10,Jinwei[i+1]=1;
            else Jinwei[i+1]=0;
        }
    }
    for (int i=34,Begin=0;i>-1;i--)
    {
        if (Num[i]!=0||Begin==1) cout<<Num[i],Begin=1;
    }
    return 0;
}


int main()
{
    void fun ( int[] );
    int num[1000], i, n;
    cin >> n;
    memset( num, 0, sizeof(num) );
    num[0] = 1;
    for ( i = 1; i <= n; i++ )
        fun ( num );
    int *p = NULL;
    for ( p = num + 999; *p == 0; p-- );
    for ( ; p >= num; p-- )
        cout << *p;
    return 0;
}
void fun ( int num[] )
{
     int *p = NULL;
     for ( p = num; p < num + 1000; p++ )
         *p = 2 * *p;
     for ( p = num; p < num + 1000; p++ )
         if ( *p > 9 )
         {
              *p = *p - 10;
              *( p + 1 ) = *( p + 1 ) + 1;
         }
}


int main(int argc, char* argv[])
{
	int n;
	double s=2;
	scanf("%d",&n);
	int i;
	if(n==0){
		s=1;
	}
	if(n==1){
		s=2;
	}
	if(n>=2){
	  for(i=2;i<=n;i++){
		  s=s*2;
	  }
	}
	printf("%.0lf",s);
	return 0;
}


int main(){
    char ANS[MAX];
    memset(ANS,0,sizeof(ANS));
    ANS[0]='1';
    ANS[1]='\0';
    int N;
    cin>>N;

    for(int i=1;i<=N;i++){
        int LEN=strlen(ANS);
        int g=0,h=0,k;

        for(k=0;g||k<LEN;k++){
            int mk=0;
            if(k<LEN) mk=ANS[k]-'0';
            h=mk*2+g;
            g=h/10;
            ANS[k]=h%10+'0';
        }

        ANS[k]='\0';
    }
    for(int i=0;i<strlen(ANS);i++) cout<<ANS[strlen(ANS)-i-1];

    return 0;
}


/*
 * 3.cpp
 *
 *  Created on: 2011-12-31
 *      Author: 2011
 */

int main()
{
	int n;
	cin >> n;
	int i, j, k;
	char ans[1000];
	int tans[1000];
	ans[0] = 1 + '0';
	ans[1] = '\0';
	for (i = 0; i < n; i++) {
		int len = strlen(ans);
		for (j = 0; j < len; j++) {
			tans[j] = (ans[j] - '0') * 2;
		}
		int carry = 0;
		for (j = 0; j < len; j++) {
			int carrytem = tans[j] / 10;
			tans[j] = (tans[j] + carry) % 10;
			carry = carrytem;		}

		if (carry == 1) {
			tans[j] = 1;
			j++;
		}

		for (k = 0; k < j; k++) {
			ans[k] = tans[k] + '0';
		}
		ans[j] = '\0';
	}
	int lentem = strlen(ans);
	for (i = lentem - 1; i >= 0; i--)
		cout << ans[i];
	return 0;
}


int main()
{
 char word[100],answord[100];
  gets(word);
  int len=strlen(word);
  int i=0,anslen=0;
  answord[0]=word[0];
  anslen++;
  for(i=1;i<len;i++)
  {
   if(word[i]==' '&&word[i-1]==' ')
    continue;
   else
    answord[anslen++]=word[i];
  }
  answord[anslen]='\0';
  puts(answord);
  return 0;
}


int main()
{
	char str[301];
	char *p = NULL, *q = NULL, *r = NULL;
	int count;
	cin.getline(str,101);
	int a = strlen(str);
	p = str;
	while(*p != '\0')
	{
		count = 0;
		if(*p == ' ')
		{
			for(r = p; *r == ' '; r++)
				count++;
			for(;r < str + 4 * a; r++)
				*(r - count + 1) = *r;
		}
		p++;
	}
	cout << str << endl;
	return 0;
}


/*
 * GUOLV.cpp
 *
 *  Created on: 2010-11-19
 *      Author: 10211
 */

int main(){
	char a[101];
	cin.getline(a,101);
	int la;
	la=strlen(a);
	for(int i=0;i<la;i++){
		if(a[i]==' ')
			if(a[i+1]==' '){
				for(int j=i;j<la;j++)
					a[j]=a[j+1];
				la--;
				i--;
			}

	}
	for(int i=0;i<la;i++)
	cout<<a[i];
	return 0;
}


int main(){
  char str[101],str1[101];
  int i,n,m,e;
  gets(str);
  n=strlen(str);
  m=0;
  for(i=1;i<=n;i++){
    if(str[i]==' '&&str[i-1]==' ')
    continue;
    else{
    str1[m]=str[i];
    m++;
  }
} printf("%c",str[0]);
  puts(str1);
  return 0;
}


int main()
{
	int i,p,n;
	char ori[101],tra[101];
	gets(ori);
	n=strlen(ori);
	tra[0]=ori[0];
	p=1;
	for(i=1;i<=n;i++)
	{
		if(ori[i]!=' '||ori[i-1]!=' ')
		{
			tra[p]=ori[i];
			p=p+1;
		}

	}
	printf("%s",tra);

	return 0;
}


int main()
{
	char a[200];
	cin.getline(a,200);
	int l,i,flag=0;
	l=strlen(a);
	for(i=0;i<l;i++)
		if(flag==0)
		{
			cout << a[i];
			if(a[i]==' ')
				flag=1;
		}
		else
			if(a[i]!=' ')
			{
				flag=0;
				i--;
			}
			cout << endl;
}


int main()
{
   char *p,str[110];
   int len,i;
   p=str;
   gets(str);
   len=strlen(str);
   for(i=0;i<len;i++)
   {
     if(i==0)
	    cout<<*(p+i);
	 else
	 {
		 if((*(p+i)==' ' && *(p+i-1)!=' ') || (*(p+i)!=' '))
		 cout<<*(p+i);
		 else continue;
	 }
   }
   return 0;
}


int main ()
{
    char string[105];
    gets (string);
    int l,i,j;
    l=strlen (string);
    for (i=0;i<l;i++)
    {
        if (string[i]==' ' && string[i+1]==' ')
        {
            for (j=i;j<l;j++)
            {
                string[j]=string[j+1];
            }
            i=i-1;
        }
    }
    printf ("%s",string);
    getchar ();
    getchar ();
}


int main(int argc, char* argv[])
{
	int i,j,k;
	char str[101];
	gets(str);
	for(i=0;str[i]!='\0';i++)
	{
		if(str[i]==' ')
		{
			if(str[i+1]==' ')
			{
				for(j=i+1;;j++)
				{
					if(str[j]!=' ')
					{
						i=j;
						break;
					}
                    str[j]='0';
				}
			}
		}
	}
	for(k=0;str[k]!='\0';k++)
	{
		if(str[k]=='0')
			continue;
		else
			printf("%c",str[k]);
	}
	return 0;
}


void main()
{
    int i,n;
    char str[101];
    for(i=0;;i++)
    {
        str[i]=getchar();
        if(str[i]=='\n')break;
    }
    n=i;
    for(i=0;i<n;i++)
    {
        if(i==0)putchar(str[i]);
        else if(str[i]==' '&&str[i-1]!=' '||str[i]!=' ')putchar(str[i]);
    }
}


int main()
{
    char string[200];
    gets(string);
    int n,i,j;
    n=strlen(string);
    for(i=0;i<n;i++)
    {
                    while(string[i]==' '&&string[i+1]==' ')
                    {
                                    for(j=i+1;j<n;j++)
                                    {
                                          string[j]=string[j+1];
                                    }
                    }

}

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

                    if(string[i]=='\0')
                    break;
                     printf("%c", string[i]);
    }
    return 0;
}


int main()
{
	char a[101];
	cin.getline(a,101);
	int length = strlen(a);
	char *p = a;
	int flag = 0;
	for(int i = 1 ; i<=length ; i++ , p++)
	{
		if(*p!=' ')
		{
			cout<<*p ;
			flag = 0 ;
		}
		if((*p==' ')&&(flag==0))
		{
			cout<<*p ;
			flag = 1 ;
		}
	}
	return 0 ;
}


int main()
{
	char mystring[101];
	gets(mystring);
	char * p=mystring;
	for (;*p!='\0';p++)
	{
		if (p==mystring) cout<<*p;
		else if (*p!=' ') cout<<*p;
		else if (*(p-1)!=' ') cout<<*p;
	}
	return 0;
}


int main() {
char a[101] ;
gets(a);
char b=a[0];
for(int i=0;a[i];i++){
if((b==' ')&&(a[i]==' ')){
continue;
}else{
printf("%c",a[i]);
b=a[i];
}
}
printf("\n");
return 0;
}


int main(){
	char zfc[100];
	gets(zfc);
	int n;
	n=strlen(zfc);
	int i;
	printf("%c",zfc[0]);
	for(i=1;i<n;i++){
		if(zfc[i]!=' '){
			printf("%c",zfc[i]);
		}else if(zfc[i]==' '&&zfc[i-1]!=' '){
			printf("%c",zfc[i]);
		}
	}
	return 0;
}


int main()
{
	char str[100 +1];
	int i , j , flag ,length ,l;
	flag = 0;

	gets(str);
	length = strlen(str);
	for(i = 0 ; i <= length - 1; i ++)
	{
		if(str[i] == ' ')
		{
			if(flag == 1)
			{
				for( j = i ; j <= length - 1 ; j ++)
					str[j - 1] = str[j];
				length --;
				i --;
			}
			else
				flag = 1;
		}
		else
			flag = 0;
	}
	for(i = 0 ; i <= length - 1; i ++)
		printf("%c",str[i]);
	return 0;
}


int main()
{
	char a[101],b[101];
	int i,c;
	gets(a);
	c=strlen(a);
	for(i=0;i<c;i++)
	{
		if(a[i]!=' ')
			printf("%c",a[i]);
		else if(a[i-1]!=' ')
			printf(" ");
	}
	return 0;
}


int main()
{
	char blabla[5000];
	int len,i;
	gets(blabla);
	len=strlen(blabla);
	for(i=0;i<len;i++)
	{
		switch (blabla[i])
		{
		case ' ':
			if(i!=0&&blabla[i-1]!=' ')
				printf("%c",blabla[i]);
			break;
		default:
			printf("%c",blabla[i]);
			break;
		}
	}
	printf("\n");
	return 0;
}


int main()
{
    char c[100];
    cin.getline(c,100);
    int n = strlen(c);
    int i = 0;
    do
    {
        if ( c[i] != ' ' )
        {
                cout << c[i] ;
                //cout << i << endl ;
                i++ ;
        }
        else
        {
            cout << c[i] ;
            do
            {
                 i = i + 1 ;
            }while ( c[i] == ' ') ;
        }
    }while ( i <= n - 1) ;
    cout << endl ;
    return 0 ;
}


int main(){
	char str[101];
	gets(str);
	int len=strlen(str),i;
	for(i=0;i<len;i++)
	{
		if(str[i]==' '&&str[i+1]==' ')
			continue;
		else
			cout<<str[i];
	}
	cout<<endl;
	return 0;
}


int main()
{
	int i,j=0,k=0;
	char string[100],word[100][100];
	gets(string);
	for(i=0;i<strlen(string);i++)
	{
		if(string[i]!=' ')
		{
			word[j][k]=string[i];
			k++;
		}
		else
		{
			word[j][k]='\0';
			if(string[i+1]!=' ')
		{
			j++;
			k=0;
		}
		}
	}
	word[j][k]='\0';
	for(i=0;i<j;i++)
	{
		printf("%s ",word[i]);
	}
	printf("%s\n",word[j]);
	return 0;
}


int main()
{
	char sen[110] , sen2[110];;
	int len , cnt = 0;
	cin.getline(sen,110);
	len = strlen(sen);
	for(int i = 0 ; i < len ; i++)
		if(sen[i] != ' ' || (sen[i] == ' ' && sen[i+1] != ' '))
		{
			sen2[cnt] = sen[i];
			cnt++;
		}
	for(int k = 0 ; k < cnt ; k++)
		cout << sen2[k];
	return 0;
}


int main()
{
	char words[200][30],input[10000];
	int len,i=0,j=0,k;
	gets(input);
	len = strlen(input);
	for(k = 0;k <= len;k++)
	{
		if(input[k] == ' ' )
		{
			if(j == 0)
				continue;
			words[i++][j] = '\0';
			j = 0;
		}
		else
			words[i][j++] = input[k];
	}
	for(k = 0;k <= i;k++)
	{
	if(k!=i)
	{printf("%s ",words[k]);}
	else
		printf("%s\n",words[k]);
	}
	return 0;
}


int main()
{
  char str[100],tru[100];
  int i,j,t,counter;
  cin.getline(str,100);
  for(i=0,t=0;str[i]!='\0';i++,t++)
  {
    if(str[i]!=' ')
		tru[t]=str[i];
	else
	{   counter=0;
	    if(str[i+1]!=' ')
		    tru[t]=str[i];
		else
		{
		    for(j=i;str[j]==' ';j++)
			  counter++;
			tru[t]=str[i];
			i=i+counter-1;
		}
	}
  }
  tru[t]='\0';
  cout<<tru;
}


int main()
{
	char a[101];
	cin.getline(a,101);
	int l = strlen(a);
	int flag = 1;
	for(int i = 0; i < l; i++)
	{

		if(a[i] != ' ')
		{
			cout << a[i];
			flag = 0;
			continue;
		}
		else if(flag == 0)
		{
			cout << a[i];
			flag = 1;
			continue;
		}
			else if(flag == 1) continue;
	}
	return 0;
}


void main()
{
	int len,i,j;
	char line1[101]={'\0'},line2[101]={'\0'};
	gets(line1);
	len=strlen(line1);
	for(i=0;line1[i]==' ';i++);
	line2[0]=line1[i];
	i++;
	for (j=0;i<len;i++)
	{
		if (line1[i]==' ' && line2[j]==' ')
			continue;
		else
		{
			j++;
			line2[j]=line1[i];
		}
	}
	len=strlen(line2);
	if (line2[len-1]==' ')
		line2[len-1]='\0';
	printf("%s",line2);
}


int main()
{
	int c;
	char getline[MAX];
	int i=0;
	int ex=IN;
	int line=0;
	while ((c=getchar())!='\n')
	{
		if (c!=' ')
		{
			ex=IN;
			getline[i]=c;
			++i;
		}
		else if ((c==' ')&&(ex==IN))
		{
			getline[i]=c;
			++i;
			ex=OUT;
		}
		else if ((c==' ')&&(ex==OUT))
			ex=OUT;
	}
	getline[i] = 0;

	printf("%s", getline);

	//for (i=0;i<=line;++i)
		//putchar(getline[i]);

}


/*
 * 1.cpp
 *
 *  Created on: 2011-1-8
 *      Author: 10033
 */

int main(){
	char str[150];
	int i,j,nstr;
	cin.getline(str,150);
	nstr=strlen(str);
	for(i=0;i<nstr-1;i++)
		while(str[i]==' '&&str[i+1]==' ')
			for(j=i+1;j<nstr;j++)
				str[j]=str[j+1];
	cout<<str<<endl;
	return 0;
}


int main ()
{
	char str[100];
	char *p;
	int i,flag=0;
	cin.getline (str,100);
	for (i=0;i<strlen(str);i++)
	{
		p=str+i;
		if (*p==' ')
			flag++;
		else
			flag=0;
		if (flag==0||flag==1)
			cout << *p;
	}
	return 0;
}


int main()
{
	char str[100];
	int i=0,flag = 0;
	gets(str);
//	cout<<str;

	while(str[i]!='\0')
	{
		if(str[i]!=' ')
		{
			cout<<str[i];
			i++;
			continue;
		}
		if(str[i]==' '&&flag==0)
		{
			if(str[i+1]==' ')
				flag=1;
			cout<<str[i];
		}
		else
		{
			if(str[i]==' '&&flag==1)
			{
				if(str[i+1]!=' ')
					flag=0;
			}
		}
		i++;
	}
	cout<<endl;
	return 0;
}


int main()
{
	char str[101],*p;
	gets(str);
	p=str;
	do
	{
		if (*p!=' ')
		{
			cout << *p;
			p++;
		}
		else
		{
			if (*(p+1)==' ')
				p++;
			else
			{
				cout << *p;
				p++;
			}
		}
	} while (*p!='\0');
	cout << endl;
	return 0;
}


int main()
{
    char string[100];
    gets(string);
    int i,j;
    int num;
    int count=0;
    num=strlen(string);
    for(i=1;i<num;i++)
    {
                    if(string[i]==' '&&string[i-1]==' ')
                    {
                                    for(j=i;j<num;j++)
                                    {
                                    string[j]=string[j+1];
                                    }
                                    count++;
                                    string[num-count]='\0';
                                    i=i-1;
                    }

    }
    puts(string);
    getchar();
    getchar();
    return 0;
    }


int main()
{
    char str[122];
    gets(str);
    char *p=NULL;
    for(p=str;*p;p++)
    {
      if(*p==' ')
      {
         while(*p==' ')
          {
            p++;
          }
          p--;
          cout<<*p;
      }
      else cout<<*p;
    }
      int ss;cin>>ss;
      return 0;
}


int main()
{
	char str[100][100];
	int i,j;
	for(i=0; ;i++)
	{
		cin>>str[i];
		if(cin.get()=='\n')
			break;
	}
	for(j=0;j<i;j++)
		cout<<str[j]<<" ";
	cout<<str[i];
	cout<<endl;
	return 0;
}


int main()
{
    char str[102];
	char *p;
	p=str;
	gets(str);
	int c=strlen(str);
	for(p=str;p<str+c-1;p++ )
	{
	  if(*p==' '&&*(p+1)==' ')continue;
	  if(*p==' '&&*(p+1)!=' '){cout<<' ';continue;}
	  if(*p!=' '){cout<<*p;}

	}
	cout<<*p;
	return 0;
}


int main(int argc, char* argv[])
{
	char s[101],pre;
	int i;

	gets(s);
	pre='-';

	for(i=0;s[i]!='\0';i++)
	{
		if(s[i]!=' ')
			printf("%c",s[i]);
		else if(pre!=' ')
			printf(" ");
		pre=s[i];
	}

	return 0;
}


int main()
{
	char str[200];
	int i;
	for(i=0;i<200;i++)
	{
		*(str+i)='a';
	}
	gets(str);
	for(i=0;i<strlen(str);i++)
	{
		if(*(str+i)!=' ')
		{
			cout<<*(str+i);
		}
		else
		{
			if(*(str+i+1)!=' ')
			{
				cout<<*(str+i);
			}
		}
	}
	cout<<endl;
	return 0;
}


int main ()
{
	char str[100] ;
	int i , j , flag = 0 ;
	cin.getline(str,100) ;
	for ( i = 0 ; ; i++ )
	{
		if ( *(str+i) == ' ' && flag == 1 )
		{
			for ( j = i ; ; j++ )
			{
				*(str+j) = *(str+j+1) ;
				if ( *(str+j) == '\0' ) break ;
			}
			i-- ;
		}
		if ( *(str+i) == ' ' ) flag = 1 ;
		else flag = 0 ;
		if ( *(str+i) == '\0' ) break ;
	}
	cout << str << endl ;
	return 0 ;
}


main()
{
      char str[10000];
      gets(str);
      int lenth,count=0;
      lenth=strlen(str);
      for(int i=0;i<lenth;i++)
      {
                          if(str[i]==' ')
                          count++;
                          else count=0;
                          if(count<2)
                          printf("%c",str[i]);
      }
      getchar();
      getchar();
      return 0;
}


int main()
{
  char a[101] ;
  cin.getline( a ,101 );
  char *p;
  p = a ;
  int i ;
  int len = strlen(a) ;
  for( i = 0 ; i <= len - 1 ;i ++ )
  {
    if( p[i] != ' ')
    cout << p[i] ;
    else if ( (p[i -1] !=' ')&&( p[i] == ' '))
    cout <<" ";
  }
  cout << endl ;
  return 0 ;

}


/*
 * 1.cpp
 *
 *  Created on: 2011-1-8
 *      Author: Administrator
 */
int main(){
	char string[101];
	cin.getline(string,101);
	int i,j,lenth = strlen(string);
	for(i=0;i<lenth;i++){
		if(string[i]=='\0')  break;
		if(string[i]==' '){
			j=i;
			while(true){
				if(string[j+1]!=' ')  break;
				j++;
			}
			int l=j-i;
			for(j=i+1;j<lenth-l;j++){
				string[j]=string[j+l];
			}
			string[j]='\0';
		}
	}
	cout<<string<<endl;
	return 0;
}


int main ()
{
	int i = 0, j, l;
	char str[150] = {0};
	gets ( str );
	l = strlen( str );
	while ( str[i] != '\n' )
	{
		while ( str[i] != ' ' )
		{
			if ( str[i] == '\0' )
			{
				cout << endl;
				return 0;
			}
			cout << str[i];
			i++ ;
		}
		cout << " " ;
		while ( str[i] == ' ' )
		{
			if ( str[i] == '\n' )
			{
				cout << endl;
				return 0;
			}
			i++;
		}
	}
	return 0;
}


int main()
{
	int m=0,i;
	char str[100];
	char *p=NULL;
	gets(str);
	p=str;
	for ( i=0;i<strlen(str);i++)
		{
			if ( *p == ' ' && m == 1 );
			else
				cout << *p;
			if ( *p == ' ' )
				m=1;
			else
				m=0;
			*p++;
		}
	return 0;
}


//
//  main.cpp
//  hw
//
//  Created by ? ? on 12-12-16.
//  Copyright (c) 2012? ? ?. All rights reserved.
//

int main(int argc, const char * argv[])
{
    char str[LEN];
    gets(str);
    int len=strlen(str),k;
    for (int i=0; i<len; i+=k) {
        k=1;
        if (str[i]!=' ') {
            cout<<str[i];
        }
        else
        {
            cout<<" ";
            while (str[i+k]==' ') {
                k++;
            }
        }
    }
   return 0;
}


int main(){
    int i;
	char str[101];
	gets(str);
	printf("%c",str[0]);
	for(i=1;i<strlen(str);i++){
		if(str[i]!=' '){
			printf("%c",str[i]);
		}else if(str[i-1]!=' '){
			printf(" ");
		}else{
			continue;
		}
	}
	printf("\n");
}


int main()
{
	char a[100],b[100];
	cin.getline(a,100);
	int n;
	n = strlen(a);
	int flag = 0;
	int i,j=0;
	for(i=0;i<n;i++)
	{
		if(a[i]!=' ')
		{
                           flag =0;
			b[j] = a[i];
			j++;
		}
		if((a[i]==' ')&&(flag==0))
		{
			b[j] = a[i];
			j++;
			flag = 1;
		}
		else
			continue;
	}
	int m;
	m = j;
	for(j=0;j<m;j++)
		cout<<b[j];
	return 0;
}


int main()
{
	char c;
	c = getchar();
	while (c != '\n')
	{
		if (c == ' ')
		{
			cout << " ";
			while (c == ' ')
				c = getchar();
		}
		cout << c;
		c = getchar();
	}
	return 0;
}


/*
 * qmcy0501.cpp
 *
 *  Created on: 2011-1-8
 *      Author: Administrator
 */
int main()
{
	char a[101];
	cin.getline(a,101);
	int i=0,j,m;
	while(true)
	{
		if(a[i]=='\0')
		{
			break;
		}
		else if(a[i]!=' ')
		{
			i++;
			continue;
		}
		else if(a[i]==' '&&a[i+1]!=' '&&a[i-1]!='\0')
		{
			i++;
			continue;
		}
		else
		{
			for(j=1;j<strlen(a);j++)
			{
				if(a[i+j]!=' ')
				{
					break;
				}
			}
			for(m=i+1;m<strlen(a)-j+2;m++)
			{
				a[m]=a[m+j-1];
			}
			i++;
		}
	}
	cout<<a<<endl;
	return 0;
}


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

int main()
{
	char str[101];

	cin.getline(str,101);

	int len = strlen(str);

	char*p = str;
	char*m;

	int i = 0;
	int t = 0;

	for(i = 0;i <= len;i++ )
	{
		if( *p == ' ' && *(p + 1) == ' ' )
		{
			m = p;

			for( t = i;t <len;t++ )
			{
				*p = *(p + 1);
				p++;
			}
			len--;
			i--;
			p = m;
			continue;
		}
		p++;
	}

	cout << str;

	return 0;
}


int main()
{
	char word[100];
	int i, len, flag = 0;
	cin.getline(word, 100);
	len = strlen(word);
	for (i = 0; i < len; i++)
	{
		if (word[i] != ' ')
		{
			cout << word[i];
			flag = 1;
		}
		else if (flag == 1)
		{
			cout << " ";
			flag = 0;
		}
	}
	return 0;
}


int main(){
char zfc[1000],cs[1000];
int n,e,j=0,i=0,a;
gets(zfc);
n=strlen(zfc);
while(i<n){
    e=0;
    cs[j]=zfc[i];
    if(zfc[i]==' '){
        for(a=i+1;a<n;a++){
            if(zfc[a]==' '){ e++; continue;  }
            else{  break; }
        }
        i=i+e; }
    j++;  i++; }
    cs[j]='\0';
printf("%s",cs);
return 0;
}


int main()
{
    char w[100];
    int sentencelength,i,c=0;
	gets(w);
    sentencelength=strlen(w);

    for (i=1;i<sentencelength;i++)
	{
        if (w[c]== ' '&&w[i]==' ')
            continue;
        else
		{
            c++;
            w[c]=w[i];
		}
	}
	w[++c]='\0';
    puts(w);
    return 0;
}


int main(){
    char sz[100];
    int i,n,x;
   gets(sz);
n=strlen(sz);
for(i=0;i<n-1;i++){
    if(sz[i]==' '){
        if(sz[i+1]==' '){
            continue;
        }
        else{
            printf(" ");
        }
    }
    else{
        printf("%c",sz[i]);
    }
}
printf("%c",sz[n-1]);
return 0;
}


int main()
{
	char a[101],i;
	gets(a);
	for(i=0;i<strlen(a);i++)
	{
		if(a[i]!=' ')
		{
          printf("%c",a[i]);
		  continue;
		}
		else
		{
			printf(" ");
			while(a[i+1]==' ')
			 {
				 i=i+1;
			 }
		}
	}
	return 0;
}


int main()
{
  char test[100];
  int len , i , j;
  cin.getline(test , 100);
  len = strlen(test);
  for (i = 0 ; i <= len - 1 ; i++)
  {
      if ((test[i] == ' ')&&(test[i - 1] == ' '))
      {
          for (j = i ; j <= len - 2 ; j++)
          {
              test[j] = test[j + 1];
          }
          len--;
          i--;
      }
  }
  for (i = 0 ; i <= len - 1 ; i++)
  {
      cout << test[i];
  }
  cout << endl;
  return 0;
}


int main()
{
	char str[300][100];
	int i, l, n;
	for (i = 0;;i++)
	{
		scanf("%s",str[i]);
		if (str[i][0] == '\0')
			break;
		l = strlen(str[i]);
		if (i == 0)
		{
			printf("%s",str[i]);
		}
		else printf(" %s",str[i]);
	}

	return 0;
}


int main()
{
    char str[101];
    cin.getline(str,100);
    for(int i=0;i<strlen(str)-1;i++)
    {
            if(str[i]!=' ')  cout<<str[i];
            else  if((str[i]==' ')&&(str[i+1]!=' '))
            {
                          cout<<str[i];
            }
            else  continue;
    }
    cout<<str[strlen(str)-1]<<endl;
    return 0;
}


int main()
{
	int i,count=0,weizhi[100];
	char zf[200];
	gets(zf);
	for(i=0;i<strlen(zf);i++)
	{
		if(zf[i]==' ');
		{
			weizhi[count]=i;
		}
	}
	for(i=0;i<strlen(zf);i++)
	{
		if(zf[i]!=' ')
		{
			printf("%c",zf[i]);
		}
		else if(zf[i]==' ')
		{
			printf(" ");
			while(1)
			{
				if(zf[i+1]==' ')
				{
					i++;
				}
				else
				{
					break;
				}
			}
		}
	}
	return 0;
}


main()
{
     char string1[100],string2[100];
     gets(string1);
     int l=strlen(string1);
     int i,j,count=0;
     for(i=0;i<100;i++)
        string2[i]='\0';
     for(i=0;i<l;i++)
     {
        if(string1[i]!=32)
        {
         string2[count]=string1[i];
         count++;
         }
        else
        {
           string2[count]=string1[i];
           count++;
           for(j=i+1;string1[j]==32;j++);
           i=j-1;
        }
     }
     printf("%s",string2);
     getchar();
     getchar();
}


int main(int argc, char* argv[])
{
int q=0,i,j;
char tra[1000],yaode[1000];
gets(tra);
for(i=0,j=0;i<1000;i++)
if(tra[i]!=' ')
{
		yaode[j]=tra[i];
	    j++;
		q=0;
	}
	else
		if(tra[i]==' '&&q==0){
			yaode[j]=tra[i];
			q++;
			j++;
		}
		else
			if(tra[i]=='.'){
				yaode[j]=tra[i];
				break;
			}
			printf("%s",yaode);

	return 0;
}


int main(){
	char str[101];
	int len,i,u;
	gets(str);
	len=strlen(str);
	for(i=len-1;i>0;i--){
		if(str[i]==' '&&str[i-1]==' '){
			for(u=i;u<=len;u++){
				str[u]=str[u+1];
			}
		}
	}
	puts(str);
	return 0;
}


int main()
{
	char str[101];
	int i, j, num, a;
	cin.getline (str, 101);
	num = strlen(str);
	for (i = 0; i < num; i++)
	{
		a = 0;
		if (str[i] == '\0')
			break;
		if (str[i] == ' ')
		{
			for (j = i; j < num; j++)
			{
				if (str[j] != ' ')
					break;
				a++;
			}
			for (j = i + 1; j < num; j++)
				str[j] = str[j + a - 1];
		}
	}
	cout << str << endl;
	return 0;
}


int main()
{
	int ls,i,word,num;
	char s[100],s1[100][100];
	gets(s);
	ls=strlen(s);
	word=0;
	num=0;
	for(i=0;i<ls;i++)
	{
		if(s[i]!=' ')s1[word][num++]=s[i];
		else{
			while(s[i]==' ')i++;
			i--;
			s1[word][num]='\0';
			word++;
			num=0;
		}
	}
	for(i=0;i<=word;i++)
	{
	printf("%s",s1[i]);
	if(i!=word)printf(" ");
	}

        return 0;
}


int main()
{
	int i=0;
	char c;
    while((c=getchar())!='\n')
	{
     if(c==' ')
	 {
		 if(i==0)
		 {
			 putchar(c);
		     i++;
		 }
	 }
	 else
	 {
		 putchar(c);
	     i=0;
	 }
	}
	return 0;
}


int main(int argc, char* argv[])
{
char string[101];
gets(string);
int i,word=1;
for(i=0;i<strlen(string);i++){
	if(string[i]!=' ') word=1;
if(word==1) printf("%c",string[i]);
if(string[i]==' ')
	word=0;}

	return 0;
}


int main()
{
	char tmp[102]={0},*p=tmp+1,prev;
	gets(tmp+1);
	prev=tmp[0];
	do{
		if(prev!=' '||prev!=*p)
			putchar(*p);
		prev=*p++;
	}while(*p);
	putchar('\n');

	return 0;
}


/*
 * 1.cpp
 *
 *  Created on: 2011-1-8
 *      Author: 10040
 */

int main(){
	char str[225];
	cin.getline(str, 225);
	int len = strlen(str);\
	int i=1;
	while(i<len){
		if(str[i]==' ' && str[i-1]==' '){
			for(int j=i; j<len-1; j++){
				str[j] = str[j+1];
			}
			len--;
			continue;
		}
		i++;
	}
	str[len]=0;
	cout << str << endl;

	return 0;
}


int main(){
	char s[101];
	cin.getline(s,101);
	int l=strlen(s);
	for(int i=0;i<l;i++){
		if(s[i]!=' '){
			cout<<s[i];
			if(i<l-1&&s[i+1]==' ')
				cout<<' ';
		}
	}
	return 0;
}


int main()
{
	char m[102];
	cin.getline(m,102);
	int len=strlen(m);
	for(int i=0;i<len;i++)
	{
		if(m[i]==' ')
		{
			if(m[i-1]!=' ')
				cout<<m[i];
		}
		else
			cout<<m[i];
	}
	cout<<endl;
	return 0;
}


int main()
{
	char str[101]={0};
	const char temp=' ';
	int x=0,i=0,j=0,count=0;
	cin.get(str,101);
	x=strlen(str);
	for(i=1;i<=x-3;i++)
	{
		if(str[i]==temp&&str[i+1]==temp)
		{
			for(j=i;j<=x-1;j++)
			{
				str[j]=str[j+1];
			}
			i=i-1;
		}
	}
	cout<<str;
	return 0;
}


int main ()
{
	char a[100];
	cin.getline ( a,100 );
	int l=strlen (a);
	for ( int i=0; i<l; i++ )
		{
			if ( a[i]!=' ' )
			cout<<a[i];
			else
			{
				cout<<' ';
				while (1)
				{
					if ( a[i+1]!=' ' )
					{
						cout<<a[i+1];
						i=i+1;
						break;
					}
					else
					{
						i++;
						continue;
					}
				}
			}
		}
			return 0;
}


int main()
{
	char a[100];
	char c;
	int i=0;
	//i????
	while (cin.get(c))
	{
		if (c=='\n')
			break;
		else
		{a[i]=c;
		i=i+1;}
	}

	int j=0;
	int count=0;
	//count????????
	for (j=0;j<=i;j++)
	{
		if (j==i)
			break;
		if (a[j]!=' ')
		{
			cout<<a[j];
			count=0;
		}
		if (a[j]==' '&&count==0)
		{
			count=count+1;
			cout<<a[j];
		}
		if (a[j]==' '&&count==1)
		{
			count=1;
		}

	}

	return 0;
}

//while(c=getchar( ))


int main()
{
	char string[101];
	int i;
	gets(string);
	printf("%c",string[0]);
	for(i=1;(string[i])!='\0';i++)
	{
		if(string[i]!=' ')  printf("%c",string[i]);
		else
		{
			if(string[i-1]!=' ')   printf(" ");
		}
	}
	return 0;
}


int main()
{
    char zfc[1000],cs[1000];
memset(zfc,0,1000);
memset(cs,0,1000);
int y,e=0,j=0,i=0;
gets(zfc);
    y=strlen(zfc);
while(i<y){
e=0;
cs[j]=zfc[i];
if(zfc[i]==' '){
for(int a=i+1;a<y;a++){
if(zfc[a]==' '){
e++;
continue;
}
else{
break;
}
}
i=i+e;
}
j++;
i++;
}
cs[j+1]='\0';
printf("%s",cs);
return 0;
}


int main()
{
char* str;
int i,l;
str = (char *)malloc(1000 * sizeof(char));
gets(str);
l=strlen(str);
for(i=0;i<l;i++,str++)
{
	if(*str==' '&&*(str+1)==' ') i=i;
	else

		printf("%c",*str);

	}
return 0;
}


int main()
{
	char test[MAX_LENGTH];
	cin.getline(test,MAX_LENGTH);
	for (int i=0;test[i]!=0;i++)
	{

		if (test[i]==' ')
		{
			while (true)
			{
				i++;
				if (test[i]!=' ')  //????,???????
				{
					cout<<' ';//??????
					break;//????
				}
			}
		}
		cout<<test[i];
	}

	return 0;
}


int main()
{
    char str[101],a[101];
    int n,i,j,k;
    gets(str);
    n=strlen(str);
    j=0;

    for (i=0;i<n;i++)
    {
        if (str[i]!=' ')
            printf("%c",str[i]);
            if (str[i]==' ')
            {
                if (str[i+1]!=' ')
                    printf(" ");
                }
    }
    return 0;
}


int main()
{
	char a[101],*p_a=NULL;
	gets(a);
	p_a=a;

	int flag=1;

	while(p_a<(a+strlen(a)))
	{
		if(flag==1)
			{
				cout<<*p_a;
				if(*p_a==' ')
					flag=0;
				*p_a++;
				continue;
		   }
		else
		{
			if(*p_a!=' ')
			{
				flag=1;
				cout<<*p_a;
			}
				*p_a++;
				continue;

		}
	}
	cout<<endl;

	return 0;
}


int main()
{
	char str[101];
	cin.getline(str, 100);
	char result[101];
	char * p = str;
	int flag = 1; // shifirst
	int i;
	for (i = 0;* p != '\0'; p++)
	{
		if (* p != ' ')
		{
			result[i++] = * p;
			flag = 1;
		}
		else if (flag)
		{
			flag = 0;
			result[i++] = * p;
		}
	}
	result[i] = '\0';
	cout << result << endl;
	return 0;
}


int main()
{
	char a[101];
	int len,i,signal;
	gets(a);
	len=strlen(a);
	signal=0;
	for(i=0;i<len;i++)
	{
		if(a[i]==' ' && signal==0)
		{
			printf(" ");
			signal=1;
		}
		else if(a[i]!=' ')
		{
			printf("%c",a[i]);
			signal=0;
		}
	}
	printf("\n");
	return 0;
}


int main()
{
	char str[101];
	int i,j,k=0;
	cin.getline(str,101);
	char *p=NULL;
	p=str;
	for(i=0;i<strlen(str);i++)
	{
		if(*(p+i)==' '&&*(p+i+1)==' ')
		{
			for(j=i+1;j<strlen(str)-1;j++)
				*(p+j)=*(p+j+1);
			i--;
			k++;
		}
	}
	for(i=0;i<strlen(str)-k;i++)
	    cout<<str[i];
	return 0;
}


/*
 * ???????.cpp
 *
 *  Created on: 2011-1-8
 *      Author: lenovo
 */
int main()
{
	char a[60];
	while (true)
	{
		int i=0;
	    if (!(cin.get(a[i]))) break;

	    if (a[i]==' ')
	    	{
	    	   while (true)
	    	   {
	    		   cin>>a[i+1];
	    		   if (a[i+1]!=' ')
	    		   {
	    			   cout<<' '<<a[i+1];
	    			   break;
	    		   }
	    		   i++;
	    	   }
	    	}
	    else
	    	cout<<a[i];
	    i++;
	}
	return 0;
}


int main()
{
 char a[101];
 cin.getline(a,101);
 for(int i = 0; i < strlen(a); ++i)
 {
  if(a[i] != ' ')
  {
   if(i == strlen(a)) cout << a[i];
   else
   if(a[i+1] == ' ')
   cout << a[i] << " ";
   else
   cout << a[i];
  }
 }
 //while(1);
 return 0;
}


int main()
{
	char x[100][10];
	int i=0;
	while(cin>>x[i])
	{
		if(cin.get()=='\n')break;
		i++;
	}
	for(int j=0;j<i;j++)
		cout<<x[j]<<' ';
	cout<<x[i]<<endl;
	return 0;
}


int main ()
{
	char word[100];
	char output[100];
	int i = 0, flag = 0;
	int p = 0;
	cin.getline(word, 100);
	for (; word[i] != '\0'; i++)
	{
		if (flag == 1 && word[i] == ' ')
		{
			continue;
		}
		if (word[i] != ' ')
			flag = 0;
		else
			flag = 1;
		output[p++] = word[i];
		output[p] = '\0';
	}
	cout << output << endl;
	return 0;
}


int main()
{
	char str[101],word[101][30];
	int i,x,y,len;
	gets(str);
	len=strlen(str);
	x=y=0;
	for(i=0;i<=len;i++)
	{

		if(str[i]==' '||str[i]==','||str[i]=='.')
		{
			if(y==0)continue;
			else{
			word[x][y]='\0';
			x++;
			y=0;
			}
		}
		else word[x][y++]=str[i];
	}
	printf("%s",word[0]);
	for(i=1;i<=x;i++)

	printf(" %s",word[i]);

}


int main()
{
	char zfc[101];
	gets(zfc);
		for(int j=0;j<=99;j++)
		{
			while(zfc[j]==zfc[j+1] && zfc[j]==' ')
			{
				for(int i=j;i<=99;i++)
				{
					zfc[i]=zfc[i+1];
				}
			}
		}
		printf("%s",zfc);
		return 0;
}


int main()
{
	char s[101];
	int leng,i,j,sum=0;
	cin.getline(s,101);
	leng=strlen(s);
	for(i=0;i<leng-sum;i++)
		if(s[i]==' '&&s[i+1]==' ')
			{
				sum++;
				for(j=i;j<leng-sum;j++)
					s[j]=s[j+1];
				i=i-1;
			}
	for(i=0;i<leng-sum;i++)
		cout<<s[i];
	return 0;
}


int main()
{
	char danci[50][100];
	char sentence[101];
    int i, k, n, len;
    k=0; n=0;
	gets(sentence);
    len = strlen(sentence);
    for(i = 0; i < len; i++){
	    if(sentence[i] != ' '){
		   danci[n][k] =sentence[i];
		   k++;
		}
		else if(sentence[i] == ' '&&sentence[i-1] == ' ')
		{
			n=n;
			k=0;
		}
		else if(sentence[i]==' '&&sentence[i-1]!=' '){
		  danci[n][k] ='\0';
		  n++;
		  k= 0;
		}
}
danci[n][k] = '\0';
for(i=0;i<n;i++)
{
	printf("%s ",danci[i]);
}
printf("%s",danci[i]);

	return 0;
}


int main()
{
	/*char str[101];
	gets(str);
	int i, isfirst;
	for(i=0; str[i]!=NULL; i++)
	{
		if(str[i] != ' ')
		{
			printf("%c", str[i]);
			isfirst = 1;
		}
		else
		{
			if(isfirst)
			{
				printf(" ");
				isfirst = 0;
			}
		}
	}*/
	char str[101];
	gets(str);
	putchar(str[0]);
	int i;
	for(i=1; str[i]!=NULL; i++)
	{
		if(str[i] != ' ')
			putchar(str[i]);
		else if(str[i] != str[i-1])
			putchar(' ');
	}
	return 0;
}


int main(){
 char aa[1024];
 char *p = NULL;
 memset(aa, 0x00, sizeof(aa));
 gets(aa);
 p = &aa[strlen(aa) - 1];
 while(' ' == *p--)
 {
  p[1] = '\0';
 }
 p = aa;
 while(' ' == *p++);
 p--;
 strcpy(aa, p);
 while(NULL != (p = strstr(aa, "  ")))
 {
  strcpy(p, &p[1]);
 }
printf("%s\n", aa);
 return 0;
}


int main()
{
	char str[200];
	cin.getline(str,200);
	int i,flag=1;
	for(i=0;str[i]!='\0';i++)
	{
		if(str[i]==' '&&flag==1)
		{
			cout<<str[i];
			flag=0;
		}
		else if(str[i]!=' ')
		{
			cout<<str[i];
			flag=1;
		}
		else ;
	}
	cout<<endl;
	return 0;
}


int main() {
char a[101];
int i,n,b,j;
gets(a);
n=strlen(a);
for(i=0;i<n;i++){
if(a[i]==' '){
if(a[i+1]==' '){
continue;}else{printf("%c",a[i]);}
}else{printf("%c",a[i]);}}
return 0;
}


int main()
{
	char m[1000];
	int i,flag=0,len;
	cin.getline(m,1000);
	len=strlen(m);
	for(i=0;m[i]!='\0';i++)
	{
		if(m[i]==' ')
		{
			if(flag==0)
			{
				continue;
			}
			else
			{
				flag=0;
				cout<<m[i];
			}
		}
		else
		{
			flag=1;
			cout<<m[i];
		}
	}
	cout<<endl;
	return 0;
}


/**
  *file  ???????
  *author ???
  *date   12.7
  *function		???????????????????????????????????
*/
int main()
{
	char a[100],*p = NULL, *q = NULL;
	int lena, spacenum, deletenum = 0;
	cin.getline(a,100);
	lena = strlen(a);
	for(p = a; p < a + lena; p++)
	{
		if(*p != ' ')
		{
			spacenum = 0;
		}
		else
		{
			spacenum++;
			if(spacenum > 1)
			{
				deletenum++;
				for(q = p; q < a + lena - deletenum; q++)
				{
					*q = *(q+1);
				}
				p--;
			}
		}
	}
	for(p = a; p < a + lena - deletenum; p++)
	{
		cout << *p;
	}
	cout << endl;
	return 0;
}


int main()
{
	char a[101];
	int b[101];
	int lenth,i;
	char c=' ';
	gets(a);
	lenth=strlen(a);
	for(i=0;i<lenth;i++)
	{
		b[i]=1;
	}
	for(i=0;i<lenth;i++)
	{
		if(a[i]==c&&a[i-1]==c)
			b[i]=0;
	}
	for(i=0;i<lenth;i++)
	{
		if(b[i]==1)
			printf("%c",a[i]);
	}
	return 0;
}


int main()
{
	char string[100];
	int n=0,m=0,len;
	cin.get(string,100,'\n');
	len=strlen(string);
	while(n<len)
	{
		if(string[n]==' ')
		{
			if(string[n-1]==' ')
			{
				len=len-1;
				for(int i=n;i<len;i++)
					string[i]=string[i+1];
				string[len]='\0';
				n--;
			}
		}
		n++;
	}
	cout<<string<<endl;
	return 0;
}


int main()
{
	char word[100];
	int len, i;
	cin.getline(word, 100);
	len = strlen(word);
	for (i = 0; i < len; i++)
	{
		if (word[i] == ' ')
		{
			cout << " ";
			while (word[i] == ' ')
				i++;
		}
		cout << word[i];
	}
	return 0;
}


int main()
{
    char c;
    int i;
    while((c=getchar())!='\n')
    {
        if(c!=' ')
        {
            cout<<c;
            i=0;
            continue;
        }
        while(c==' ')
        {
            i=i+1;
            if(i>=2) break;
            cout<<c;
        }
    }
    return 0;
}