semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main(){
    int a,b,c,d,e,f;
	int A=1;
	int i,j;
	int s[200][6],Q[200];
	for(i=0;i<A;i++){
		for(j=0;j<6;j++){
		   scanf("%d",&s[i][j]);
		}
		if(s[i][0]+s[i][1]+s[i][2]+s[i][3]+s[i][4]+s[i][5]==0){
		    
			break;
		}else{
		  A++;
		}
	}
    for(i=0;i<A;i++){
	   a=s[i][0];
	   b=s[i][1];
	   c=s[i][2];
	   d=s[i][3];
	   e=s[i][4];
	   f=s[i][5];
       
       Q[i]=((d+11-a)*3600)+((59-b)*60)+((60-c))+(60*e)+(f);
	
	
	}
    for(i=0;i<A-1;i++){
	   printf("%d\n",Q[i]);
	
	
	}
return 0;



}
int main(){
	int sz[100][6];
	int a,b,c,d,e,f,g,h,i,j,k,l=0;
	int m=0,n=0,t=0;
	for(i=0;i<100;i++){
		scanf("%d %d %d %d %d %d",&sz[i][0],&sz[i][1],&sz[i][2],&sz[i][3],&sz[i][4],&sz[i][5]);
		if(sz[i][0]==0&&sz[i][1]==0&&sz[i][2]==0&&sz[i][3]==0&&sz[i][4]==0&&sz[i][5]==0){
			break;}
			l++;
	}
	for(i=0;i<l;i++){

		//if(sz[i][3]<=12&&sz[i][3]>=sz[i][0]){
		//	t=3600*(sz[i][3]-sz[i][0])+sz[i][4]*60+sz[i][5]-sz[i][1]*60-sz[i][2];
	//	printf("%d\n",t);
	//	return 0;}
	//	if(sz[i][3]<sz[i][0]){
		m=12*3600-sz[i][0]*3600-sz[i][1]*60-sz[i][2];
		n=3600*sz[i][3]+60*sz[i][4]+sz[i][5];
		printf("%d\n",m+n);}
		//t=0;
	//	m=0;
		//n=0;
	
		return 0;
}
int main(){
	int a,b,c,d,e,f,y;
	while(1){
		scanf("%d %d %d %d %d %d",&a,&b,&c,&d,&e,&f);
		if(a==0){
			break;
		}
		d=d+12;
		if(e>=b&&f>=c){
			y=(d-a)*3600+(e-b)*60+f-c;
		}else if(e>=b&&f<=c){
			y=(d-a)*3600+(e-b-1)*60+60+f-c;
		}else if(e<=b&&f>=c){
			y=(d-a-1)*3600+3600+(e-b)*60+f-c;
		}else if(e<=b&&f<=c){
			y=(d-a-1)*3600+3600+(e-b-1)*60+60+f-c;
		}
		printf("%d\n",y);
	}
	return 0;

}
int main(){
int a,b,c,d,e,f,i,sum;
for(i=1;i++;){
scanf("%d%d%d%d%d%d",&a,&b,&c,&d,&e,&f);
if(d==0)   {break;}
else {
sum=60-c+f+(60-b-1)*60+e*60+(12+d-a-1)*3600;
printf("%d\n",sum);
}
}
return 0;
}
int main()
{
int a[6],i,j,time;
while(a[0]!=0)
{
for(j=0;j<=5;j++)
{
cin>>a[j];
if(a[0]==0)
return 0;}
cout<<(a[3]+12)*60*60+a[4]*60+a[5]-a[0]*60*60-a[1]*60-a[2]<<endl;
}

return 0;
}
int main()
{
      int a,b,c,d,e,f,i,m=1,sz[10000];
      while(m!=0)
{ scanf("%d%d%d%d%d%d",&a,&b,&c,&d,&e,&f);
if(a==0&&b==0&&c==0&&d==0&&e==0&&f==0)
break;
else{
sz[m]=12*3600-a*3600-b*60-c+d*3600+e*60+f;
m++;
}

}
for(i=1;i<m;i++)
{
   printf("%d\n",sz[i]);
}
return 0;
}
int main()
{
	int a,b,c,d,e,f,m1,m2,m;
	while(1){
		scanf("%d%d%d%d%d%d",&a,&b,&c,&d,&e,&f);
		if(a!=0){
			m2=f+e*60+(d+12)*60*60;
			m1=c+b*60+a*60*60;
			m=m2-m1;
			printf("%d\n",m);
		}
		else
			break;
	}
	return 0;
}
int main()
{
	char *a;
	int i,*symbol;
	a=(char*)malloc(30*sizeof(char));
	gets(a);
	symbol=(int*)malloc(strlen(a)*sizeof(int));
	for(i=0;a[i]!=0;i++)
	{
		if((*(a+i)=='1')||(*(a+i)=='2')||(*(a+i)=='3')||(*(a+i)=='4')||(*(a+i)=='5')||(*(a+i)=='6')||(*(a+i)=='7')||(*(a+i)=='8')||(*(a+i)=='9')||(*(a+i)=='0'))
		{
			*(symbol+i)=1;
			printf("%c",*(a+i));
		}
		else
		{
			*(symbol+i)=0;
			if(*(symbol+(i-1))==1)printf("\n");
		}
	}
	free(a);
	free(symbol);
	return 0;
}
int main()
{
	char a[31];
	int b[31]={0};
	int i,j,l;
	gets(a);
	l=strlen(a);
	for(i=0;i<l;i++)
		if(a[i]<='9'&&a[i]>='0')
          b[i]=1;
		for(j=0;j<l;j++)
		{
			if(b[j]==1)
				cout<<a[j];
			else
				cout<<endl;
		}

   return 0;
}
int main()
{
   char str[50];
   int n;
   int i;
   cin.getline(str,50);                            //?????
   for(n=0;str[n]!='\0';n++);                      //???????
   for(i=0;i<n;i++)
   {
	if(str[i]>=48&&str[i]<=57)                     //???????????
    cout<<str[i];
    else if((str[i]<48||str[i]>57)&&(str[i+1]>=48&&str[i+1]<=57))   //??????????????????????
    cout<<endl;
   }


return 0;
}
/*-----------------------------------------*\
|? ? ?   ?????                 	    |
|? ?      ????	                    |
|? ? ? ??2010 ? 12 ? 09 ?		    |
|? ?      ?1000012758		            |
\*-----------------------------------------*/ 
int main()
{
	char text[50];//??????
	char *p;
	p = text;//??????
	gets(p);//??
	for (; *p != 0; p++)
		if (*p < '0' || *p > '9')
			*p = 0;//???????????
	*p = 1;//????
	p = text - 1;//????
	while (*(++p) != 1)
		if (*p != 0)//?????
			cout << *p;
		else if (*(p + 1) != 0)//???????????
			cout << endl;
		return 0;
}
int main()
{
	int i,m=0;
	char *p=NULL;
	char c[31];
	gets(c);
	p=c;
	for ( i=0;i<strlen(c);i++)
		{
			if ( *p >= '0' && *p <= '9')
				{
					cout << *p;
					m=1;
				}
			else if ( m == 1 )
				{
					cout << endl;
					*p;
					m=0;
				}
			*p++;
		}
	cout << endl;

	return 0;
}
int main()
{
    int b,j=0;
    char *p,*q;
    char a[30],c[30];
    gets(a);//???????? 
    b=strlen(a);//???? 
    p=a;
    q=c;
    for(int i=0;i<30;i++)//??????????? 
    *(q+i)=':';
    for(int i=0;i<b;i++)
    {
      if(isdigit(*(p+i))!=0)//????????? 
      {
        *(q+j)=*(p+i);
        j=j+1;
      }
      if((isdigit(*(p+i))!=0)&&(i==b-1))//?????????????????? 
      cout<<atoi(c)<<endl;
      if(i>0)
      {
        if((isdigit(*(p+i))==0)&&(isdigit(*(p+i-1))!=0))//??????????????? 
        {
          cout<<atoi(c)<<endl;
          j=0;//??????? 
          for(int k=0;k<30;k++)
          *(q+k)=':';
        }
      }
    }
    return 0;
}
main()
{
      char a[30];
      int c,i,j;
      gets(a);
      c=strlen(a);
      for(i=0;i<c;i++)
      {
            if((a[i]-'0'>=0)&&(a[i]-'9'<=0))
            {
                printf("%c",a[i]);
            }
            else
            {
                if(i>=1)
                {
                        if((a[i-1]-'0'>=0)&&(a[i-1]-'9'<=0))
                        printf("\n");
                }
            }              
      }
      getchar();
      
}
int main()
{
	char c[31],num[30];
	int i,n1[30],n2[30],k=0,l,j,m;
	gets(c);
	l=strlen(c);
	for(i=0;i<l;i++)
	{			
		if((c[i]>47&&c[i]<58)&&(c[i-1]<48||c[i-1]>57))
		{
			n1[k]=i;                  //????
		}
		if((c[i]>47&&c[i]<58)&&(c[i+1]<48||c[i+1]>57))
		{
			n2[k]=i;                  //????
			k++;
		}
		
	}
	for(i=0;i<k;i++)
	{
			for(m=0;m<30;m++)
			{num[m]='\0';}
		for(j=n1[i];j<=n2[i];j++)
		{
			num[j-n1[i]]=c[j];
		}
		printf("%s\n",num);
	}
	return 0;
}
void main()
{
	int i,l,k=0,j;
	char *p,*a;
	a=calloc(30,sizeof(char));
	p=a;
	gets(p);
	l=strlen(p);
	for(i=0;i<l;i++)
	{
		if(*(p+i)>=48&&*(p+i)<=57&&k==2) printf("\n");
		if(*(p+i)>=48&&*(p+i)<=57) {printf("%c",*(p+i));k=1;}
		else k=2;
	}
}
int main()
{
	int i,l,k;
	char zfc[31];
	gets(zfc);
	l=strlen(zfc);
	for(i=0;i<l;i++){
		if(zfc[i]=='-'){
			printf("\n");
			for(k=i+1;k<l;k++){
				if((zfc[k]=='1')||(zfc[k]=='2')||(zfc[k]=='3')||(zfc[k]=='4')||(zfc[k]=='5')||(zfc[k]=='6')||(zfc[k]=='7')||(zfc[k]=='8')||(zfc[k]=='9')||(zfc[k]=='0')){
					i++;
				}else{
					break;
				}
			}
		}
		if((zfc[i]=='1')||(zfc[i]=='2')||(zfc[i]=='3')||(zfc[i]=='4')||(zfc[i]=='5')||(zfc[i]=='6')||(zfc[i]=='7')||(zfc[i]=='8')||(zfc[i]=='9')||(zfc[i]=='0')){
		printf("%c",zfc[i]);
		}else{
			printf("\n");
			for(k=i+1;k<l;k++){
				if(zfc[k]!='0'&&zfc[k]!='1'&&zfc[k]!='2'&&zfc[k]!='3'&&zfc[k]!='4'&&zfc[k]!='5'&&zfc[k]!='6'&&zfc[k]!='7'&&zfc[k]!='8'&&zfc[k]!='9'){
				i++;
				}else{
					break;
				}
			}
		}
	}
	return 0;
}
int main()
{
			char s[40],f[40];
			cin.getline(s,40);
			char *p;
                        int i,t;
			p=s;
                        i=0;
			while (*p!='\0')
					{
						while (*p>=48&&*p<=57) {f[i]=*p;i++;p++;}
						while ((*p<48||*p>57)&&(*p!='\0')) p++;
						if (*p=='\0') break;
                                                f[i]=' ';i++;
					}
					for(t=0;t<i;t++)
			{
                         if (f[t]!=' ') 
                               cout<<f[t];
                         else cout<<endl;
                        }
                        return 0;
}
void main()
{
     char *str;
	 int i=0;
     str=(char*)calloc(100,sizeof(char));
     gets(str);
     while(*(str+i)!='\0')
	 {	 
		 if((*(str+i)<=57&&*(str+i)>=48)&&(*(str+i+1)>57||*(str+i+1)<48))
			 printf("%c\n",*(str+i));
		 if((*(str+i)<=57&&*(str+i)>=48)&&(*(str+i+1)<=57&&*(str+i+1)>=48))
			 printf("%c",*(str+i));
		 i=i+1;
	 }
}
void main()
{
	char str[30],*a;
	a=str;
	gets(str);
	for(;a<str+30;a++)
	{
		if((*a>='0')&&(*a<='9'))
		{printf("%c",*a);
		a++;
		break;}
	}
	for(;a<str+30;a++)
	{
		if(((*a>='0')&&(*a<='9'))&&((*(a-1)>='0')&&(*(a-1)<='9')))
			printf("%c",*a);
		else if(((*a>='0')&&(*a<='9'))&&((*(a-1)<'0')||(*(a-1)>'9')))
		{
			printf("\n");
			printf("%c",*a);
		}
	}
}
int main()
{
	char str[30];
	char *p;   //:????
	gets(str);
	p=str;  //:????

	for (int i=0;i<strlen(p)-1;i++)  //:????
	{
		if ( *(p+i)>=48 && *(p+i)<=57 && (*(p+i+1)<48 || *(p+i+1)>57) )  //:?????????????????
			cout<<*(p+i)<<endl;
		else if (*(p+i)>=48 && *(p+i)<=57 && (*(p+i+1)>=48 && *(p+i+1)<=57) )
			cout<<*(p+i);
	}
	if (*(p+strlen(p)-1)>=48 && *(p+strlen(p)-1)<=57)  //:?????????
		cout<<*(p+strlen(p)-1);
	cout<<endl;
	return 0;
}
int main()
{
	char in[31];
	int out[30];
	int i,j,k,l=0,flag1,flag2;
	cin.getline(in,31);
	for(i=0;i<30;i++)//???
	{out[i]=0;}
	for(i=0;i<31;i++)//???????
	{
		if(in[i]>='0'&&in[i]<='9')//???????
		{
			flag1=i;
			for(j=i;j<31;j++)
			{
				if(!(in[j]>='0'&&in[j]<='9'))//????????
				{	
					flag2=j-1;
					i=j;
					break;
				}
			}
			for(k=flag2;k>=flag1;k--)//?????
			{
				
				out[l]=out[l]+(in[k]-'0')*(int)pow(10.0,(double)(flag2-k));
				
			}
			l++;
		}
	if(in[i]=='\0')
		break;
	}
	for(i=0;i<l-1;i++)
		cout<<out[i]<<endl;
	cout<<out[l-1];
	return 0;
}
int main()
{
    char a[40];
    int i=0;
    cin.getline(a,40);
    while(a[i]!='\0')
    {
       if((a[i]-'0')>=0&&(a[i]-'0'<=9)) cout<<a[i];
       else
       {
           if((a[i+1]-'0')>=0&&(a[i+1]-'0'<=9)) cout<<endl;
       }
       i++;
    }
    return 0;
}
int main()
{
    char input[31];
    int i;    


    for(i = 0; i < 31; i ++)
        input[i] = '\0';

    gets(input);

    for(i = 0; i < 30; i ++)
        if(input[i] >= '0' && input[i] <= '9')
        {
           
            printf("%c", input[i]);
			
        }
        else
        {
            printf("\n");
        }

        return 0;
}
int main ()
{
	char str[50] ;
	int i ;
	cin.getline(str , 50) ;
	for (i = 0 ; str[i] != '\0' ; i ++)
	{
		if (str[i] >= 48&&str[i] <= 57)
		{
			cout << str[i] ;
		}
		else 
		{
			if (str[i - 1] >= 48&&str[i - 1] <= 57)
			{
				cout << endl ;
			}
		}
	}
	cout << endl ;
	return 0 ;
}
int main(){
    int n,i,j,l,o=0,k=0,p=0;
    char a[100],b[100][10]={' '},c[100][10]={' '};
    gets(a);
    l=strlen(a);
    for(i=0;i<l;i++){
        if(a[i]>='0'&&a[i]<='9'){
            b[o][k++]=a[i];
            }
        if(!(a[i]>='0'&&a[i]<='9')){
            o++;
            k=0;
            }
        }
    for(i=0;i<=o;i++){
        if(strcmp(b[i]," ")!=-1) printf("%s\n",b[i]);
        //printf("%d\n",strcmp(b[i]," "));
        }
    
    
   
    
    
    
    scanf("%d",&i);
    return 0;
    }
//****************************************************************************************
//*  ??????? 																	 *
//*  ????????????????30???????????????????????    *
//*  ???????					   													 *
//*  ???2010?12?8?															     *
//****************************************************************************************
int main()
{
	char str[31];										//?????
	int num, i, p = 0;									//????
	cin.getline (str, 31);								//?????
	num = strlen(str);									//????????
	for (i = 0; i < num; i++)							//?????????
	{
		if ((*(str + i) >= '0') && (*(str + i) <= '9'))
		{
			if (p > 0)
			{
				cout << endl;
				p = 0;
			}
			cout << *(str + i);
		}
		else 
			p++;
	}
	return 0;
}
/*
 *??? 
 *2010 - 12 - 9 
 *?????3 - ???? 
 */ 
int main()
{
    char str[31];
    cin.getline ( str, 31 );
    char *p = NULL;
    int flag = 0, first = 1 ;//flag?????????????????0;first??????????????? 
    for ( p = str; *p != '\0'; p++ )
    {
        if ( *p <= '9' && *p >= '0' )//????? 
        {
             if ( flag == 0 )//?????? 
             {
                  if ( first == 1 )//?????????? 
                  {
                     cout << *p;//????????? 
                     first = 0;
                  }
                  else//?????????????? 
                      cout << endl << *p;
             }
             else//?????????? 
                 cout << *p;
             flag = 1;//???? 
        }
        else//???? 
            flag = 0;//?? 
    }
    return 0;
}
int main()
{
	char str[30];
	char *p;   //:????
	gets(str);
	p=str;  //:????

	for (int i=0;i<strlen(p)-1;i++)  //:????
	{
		if ( p[i]>=48 && p[i]<=57 && (p[i+1]<48 || p[i+1]>57) )  //:?????????????????
			cout<<p[i]<<endl;
		else if (p[i]>=48 && p[i]<=57 && (p[i+1]>=48 && p[i+1]<=57) )
			cout<<p[i];
	}
	if (p[strlen(p)-1]>=48 && p[strlen(p)-1]<=57)  //:?????????
		cout<<p[strlen(p)-1];
	cout<<endl;
	return 0;
}
int main()
{
	char s[100],a[100];
	int nege,deci,k,i,r,x;
	gets(s);
	x=strlen(s);
	nege=1;
	deci=1;
	r=-1;
	for (i=0;i<=x;i++)
	{	
		if (s[i]=='-') nege=0;
		if (s[i]=='.'&&r>-1) deci=0;
		if (!((s[i]<='9'&&s[i]>='0')||(s[i]=='-')||(s[i]=='.'))) 
		{
			nege=1;
			deci=1;
			r=-1;
		}
		if ((s[i]<='9'&&s[i]>='0')&&(nege&&deci))
		{
			r++;
			a[r]=s[i];
			if (!((s[i+1]<='9'&&s[i+1]>='0')||(s[i+1]=='.')))
			{
				if (r==0) printf("%c\n",a[0]);
				else
				{
					k=-1;
					do
					{
						k++;
					}
					while (a[k]=='0');
					for(;k<=r;k++)
						printf("%c",a[k]);
					printf("\n");
					nege=1;
					deci=1;
					r=-1;
				}
			}
		}
	}
	return 0;
}
int main()
{
   char a[40];
   char *p=a;
   cin.get(a,40);
   for(;*p!='\0';p++)
   {
	  if(*p>='0'&&*p<='9')
	  {
		  for(;*p>='0'&&*p<='9';p++)
			  cout<<*p;
		  cout<<endl;
	  }
   }
   return 0;
}
void main()
{
	char *p=(char*)malloc(31*sizeof(char));
	gets(p);
	for(;*p!='\0';p++)
	{if(*p>47&&*p<58)printf("%c",*p);
		if((*(p-1)>47&&*(p-1)<58)&&(*p<48||*p>57))
			printf("\n");}
}
main()
{
    char str[31];
    gets(str);
    int n;
    n=strlen(str);
    for(int i=0;i<n;i++)
    {
        if(str[i]>='0'&&str[i]<='9')
            printf("%c",str[i]);
        else
        {
            printf("\n");
            for(;str[i]<'0'||str[i]>'9';i++)
            {}
            i--;
        }
    }
    getchar();
}
/*
 * ????1206.cpp
 * ??????
 * ?????2012-12-16
 * ????????????
 */



int main() {
	char s[31], *p = NULL; //????
	cin.getline(s, 31); //????
	for (p = s; p < s + strlen(s); ++p) {
		if (*p > 47 && *p < 58)
			cout << *p; //???????
		else {
			cout << endl;
			while (*(p + 1) < 48 || *(p + 1) > 57)
				++p;
		} //?????????????????????
	}
	return 0; //????
}
int main()
{
	char a[31];
	int i, j, count;
	cin.getline(a, 31);
	count = 0;
	for(i = 0; ; i++)
	{
		if(a[i] == '\0')
		{
			for(j = i - count; j < i; j++)
				cout << a[j];
			cout << endl;
			break;
		}
		if(a[i] <= '9' && a[i] >= '0')
			count++;
		if((a[i] > '9' || a[i] < '0') && (a[i - 1] <= '9' && a[i - 1] >= '0'))
		{
			for(j = i - count; j < i; j++)
			{
				cout << a[j];
			}
			cout << endl;
			count = 0;
		}
	}
		return 0;
}
/*
 * pointer1.8.cpp
 *
 *  Created on: 2013-12-8
 *      Author: st
 *      ?? - ??(12-4) ????

?? POJ 2910
??
?????????????30????????????????????????????????????????

????
?????,?????30

????
???????????,??????. (??????)

????
123*456U17960? 302tab5876

????
123
456
17960
302
5876

??
??????????gets(c)
 *
 */
int main()
{
	char str[35];
    cin.getline(str,35);
    char *p1,*p2;
    int i;
    p1=str;
    p2=str;
    int m=strlen(str);
    for(i=0;i<m;i++){
    	if((i==m-1)&&(str[m-1]>=48)&&(str[m-1]<=57)){    //?????????
    	    p2=&str[m];                                  //???????????????????p2??????
    	if((*p1!='-')&&(*p1>=48)&&(*p1<=57))
    		while(p1!=p2)
    		 cout<<*p1++;
    	else {
    	      while((*p1<48)||(*p1>57))
    	     	 p1++;
    	      while(p1!=p2)                              //????
    	         cout<<*p1++;
    	      }
    	}
    	else                                             //??????
    		if((((str[i]<48)||(str[i]>57))&&(str[i]!=' '))&&(str[i-1]>=48)&&(str[i-1]<=57)){
    		p2=&str[i];
        if((*p1!='-')&&(*p1>=48)&&(*p1<=57)){            //??????
        	while(p1!=p2)
        		cout<<*p1++;
           cout<<endl;
           p1++;

          }
        else {                                            //????????
        	while((*p1<48)||(*p1>57))
     	      p1++;
        	while(p1!=p2)
        	   cout<<*p1++;
        	   cout<<endl;
        	   p1++;
        }

    	}

    }


}
void main()
{
  char *p;
  int i,n;
  p=(char*)malloc(30*sizeof(char));
  gets(p);
  n=strlen(p);
  for(i=0;i<n;i++) 
  {
	  if((*(p+i)=='0')||(*(p+i)=='1')||(*(p+i)=='2')||(*(p+i)=='3')||(*(p+i)=='4')||(*(p+i)=='5')||(*(p+i)=='6')||(*(p+i)=='7')||(*(p+i)=='8')||(*(p+i)=='9')) printf("%c",*(p+i));
      if(((*(p+i)=='0')||(*(p+i)=='1')||(*(p+i)=='2')||(*(p+i)=='3')||(*(p+i)=='4')||(*(p+i)=='5')||(*(p+i)=='6')||(*(p+i)=='7')||(*(p+i)=='8')||(*(p+i)=='9'))
		  &&(((*(p+i+1)=='0')||(*(p+i+1)=='1')||(*(p+i+1)=='2')||(*(p+i+1)=='3')||(*(p+i+1)=='4')||(*(p+i+1)=='5')||(*(p+i+1)=='6')||(*(p+i+1)=='7')||(*(p+i+1)=='8')||(*(p+i+1)=='9'))==0))
		  printf("\n");
  }
}
int main()
{
	int l, i, j, k;
	 char a[31];
	 cin.getline(a,31);
	 l = strlen(a);
	 j = 0;
	 for (i = 0; i <= l; i++)
		 if( a[i] < '0' || a[i] > '9' || i == l)
		 {
			 for (k = j; k < i; k++)
			 {
				 cout << a[k];
				 if (k == (i - 1))
					 cout << endl;
			 }
			 j = i + 1;
		 }
	 return 0;
}
int main()
{
char str[1000];
while(cin>>str)
{for(int i=0;i<strlen(str);i++)
{
if((str[i]>='0')&&(str[i]<='9')) cout<<str[i];
else cout<<endl;
}
}
return 0;
}
int main()
{
	char word[31];
	int i=0,flag=0,flags=0,j=0;
	int len=0;
	cin.getline(word,31,'\n');
	len=strlen(word);
	for(i=0;i<len+1;i++)
	{
		if(word[0]<'9'&&word[0]>'0')
		{
			if(word[i]>'9'||word[i]<'0')
			{
				if(flag==0)
				{
					for(j=flag;j<flags;j++)
					{
						cout<<word[j];
					}
				}
				else
				{
					for(j=flag+1;j<flags;j++)
					{
						cout<<word[j];
					}
				}
				if(flags-flag>1&&flag>0)
					cout<<endl;
				else if(flags-flag>=1&&flag==0)
					cout<<endl;
				flag=flags;
				flags++;
			}
			else
			{
				flags++;
			}
		}
		else
		{
			if(word[i]>'9'||word[i]<'0')
			{
				for(j=flag+1;j<flags;j++)
				{
					cout<<word[j];
				}
			
				if(flags-flag>1)
					cout<<endl;
				flag=flags;
				flags++;
			}
			else
			{
				flags++;
			}
		}
	}
	return 0;
}
int main()
{
    char str[31];
    int i, j;
    char *p, *q;
    cin.getline(str, 31);
    int len;
    len = strlen(str);
    p = str;
    q = str;
    for(i = 0; i < len; i++)
    {
         if(*p - '0' >= 0 && *p - '0' <= 9)
         {
                p++;
         }
         else
         {
                while(*q != *p)
                {
                        cout << *q++;
                }
                if(*(q - 1) - '0' >= 0 && *(q - 1) - '0'<= 9)
                        cout << endl;
                p++;
                q = p;
         }
    }
    if(*(p - 1) - '0' >= 0 && *(p - 1) - '0' <= 9)
    {
          while(*q != *p)
                cout << *q++;
          cout << endl;
    }
    return 0;
}
int main()
{
	char *str,*p;
	str = (char *)malloc(30*sizeof(char));
	
	gets(str);
	
	for(p=str;*p!='\0';p++){
		if ((*p>'9'||*p<'0')&&(*(p+1)<='9'&&*(p+1)>='0')){
			printf("\n");
		}
		if ((*p)<='9'&&(*p)>='0') printf("%c",*p);
	}
}
int main() {
	char str[31];
	int i,j;
	gets(str);
	for(i=0;str[i]!=0;i++){
		if(str[i]>=48&&str[i]<=57){
			for(j=i;str[j]>=48&&str[j]<=57;j++)
				cout<<str[j];
			cout<<endl;
			i=j;
		}
	}

	return 0;
}
int main()
{
	char a[30];
	gets(a);
	int m=0;
	for(int i=0;i<30;i++)
	{
		if(a[i]>=48&&a[i]<58)
		{
			cout <<a[i];
			m=1;
		}
		else if(m==1)
		{
			cout <<endl;
			m=0;
		}
		else
			continue;
	}
	if(m==1)
		cout <<endl;
	return 0;
}
int check(char x)
{
	if(x=='1'||x=='2'||x=='3'||x=='4'||x=='5'||x=='6'||x=='7'||x=='8'||x=='9'||x=='0')
	{
		return 1;		//1??X???
	}
	else 
	{
		return 0;		//0??X????
	}
}
int main()
{
	char cha[30];
	char chaa[30][30];
	gets(cha);
	int i=0,j=0,k=0,chec;    //chec???????????
	char *pi;
	pi=cha;
	for(;*pi!='\0';pi++)
	{
			chec=check(*pi);
			if(chec==1)
			{
				chaa[i][j]=*pi;
//				printf("%c\n",chaa[i][j]);
				j+=1;
			}
			else if(chec==0)
			{
				chaa[i][j]='\0';
//				printf("%s\n",chaa[0]);
				j=0;
				i+=1;
			}
	}
	chaa[i][j]='\0';
	for(k=0;k<=i;k++)
	{
		if(check(chaa[k][0])==1)
		{
			printf("%s\n",chaa[k]);
		}
	}
	return 0;
}
int main()
{
    char c[31];
    gets(c);
    int i=0,j;
    int a=0,b=0,num=0,len;
    len=strlen(c);
    while (i<=len)
    {
        if ((c[i]<='9')&&(c[i]>='0'))
        {
            if (num==0) a=i;
            b=i;num++;
        }
        else
        {
            if (num>0)
            {
                for (j=a;j<=b;j++)
                {
                    printf("%c",c[j]);
                }
                printf("\n");
                b=i;num=0;
            }
        }
        i++;
    }
    return 0;
}
int main()
{
	char c[31];
	int i;
	gets(c);
	if(c[0]>=48&&c[0]<=57)
	printf("%C",c[0]);
	for(i=1;i<31;i++)
	{
		if(c[i]>=48&&c[i]<=57)
		printf("%c",c[i]);
		else if(c[i-1]>=48&&c[i-1]<=57)
		     printf("\n");
	}
}
void main()
{
	char *c;
	int k=1;
	c=(char*)malloc(30*sizeof(char));
	gets(c);
	for(;*c!='\0';c++)
	{
		if((*c<48)||(*c>57))
		   k=0;
        else if(k==0)
        {
        	printf("\n%c",*c);
        	k=1;
        }
        else
           printf("%c",*c);
	}
}
//* * * * * * * * * * * * * * * * * * * * * * * * 
//*????????                             *
//*????????.cpp                         *
//*?????  1000012839                       *
//*???2010.12.09                             *
//* * * * * * * * * * * * * * * * * * * * * * * * 


int main()
{
	char str[31];	//	?????str?
	int i, j;	//	??????i,j?
	char *p = NULL;	//	?????

	cin.getline(str, 31);
	p = str;	//	????????????
	i = 0;
	while (str[i] != '\0')
		i++;	//	??i?????????
	for (j = 0; j < i; j++)
	{
		if (*p >= '0' && *p <= '9')
		{
			cout << *p;	//	???????
			if (*(p + 1) < '0' || *(p + 1) > '9')
				cout << endl;	//	?????????????????
		}
		p++;	//	???????
	}
	return 0;
}
int main()
{
    int i,k=0;
	char s[40];
	gets(s);
	for(i=0;i<strlen(s);i++)
	{
		if((s[i]==0||s[i-1]<'0'||s[i-1]>'9')&&(s[i-1]!='-'))
		{
			while((s[i]>='0')&&(s[i]<='9')&&(i<strlen(s)))
			{
				printf("%c",s[i++]);
			}
			printf("\n");
		}
	}
}
int main()
{
 char s[31];
 int i,j,k,l;
 gets(s);
 for(i=0;i<31;i++)
  {if(s[i]>='0'&&s[i]<='9') printf("%c",s[i]);
  if(s[i]>='0'&&s[i]<='9'&&!(s[i+1]>='0'&&s[i+1]<='9')) printf("\n");
}
}
//***********************************************
//*   ????????                                  * 
//*   ??????                                          *
//*   ???12?24?                                     * 
//***********************************************
int main()
{
   char a[35];
   cin.getline(a,32);                             //????? 
   int l=strlen(a);                               //???? 
   int i=0,k=0;
   while(i<l)
   {
      if(a[i]>='0' && a[i]<='9')                  //??????????? 
      {
         int count=1,j=i+1;
         while(a[j]>='0' && a[j]<='9')
         {
            count++;                              //????????? 
            j++;
         }
         for(k=i;k<i+count;k++)
         {
            cout<<a[k];                           //??????? 
         }
         cout<<endl;
         i=i+count;                               //?????i??????? 
      }
      else i++;
   }
   return 0;
}
//??????????
//???
//2012-12-12
int main(){
	char a[40];
	cin.getline(a,40);//?????? 
	int len,i,j=0,k;
	len=strlen(a);//???????
	for(i=0;i<len;i++){//??????????????
		if((a[i]<'0' || a[i]>'9') && a[i]!='-'){//???????????
			a[i]=' ';}
		if(a[i]=='-'){//????????????????
			a[i]=' ';
			for(j=i+1;j<len;j++){
				if(a[j]>='0' && a[j]<='9')
					a[j]=' ';
				else break;
			}
		}
	}
    int x=0,y=0;//????????
	for(i=0;i<len;i++){//??????????
		if(a[i]!=' '){
			cout << a[i];
			x=1;
			continue;}
		if(a[i]==' ' && x==1){//???????????????
			k=i;
			cout << endl;
			break;}
	}
	for(i=k+1;i<len;i++){
		if(a[i]!=' '){//????????
			cout << a[i];
			y=1;//???????????
		}
		if(a[i]==' ' && y==1){//?????????????y?0
			cout << endl;
			y=0;}
	}
	return 0;
}
int main(int argc, char *argv[])
{
  int i,j,n=0;
  char a[30]={'\0'};
  gets(a);
  for(i=0;i<30;i++)
  {
        if(a[i]=='\0')
        break;
        if(a[i]>='0'&&a[i]<='9')
        printf("%c",a[i]);
        if((a[i]>'9'||a[i]<'0')&&(a[i-1]>='0'&&a[i-1]<='9'))        
        printf("\n");
  }
  return 0;
}