semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
	char c[105]={0};
	cin>>c;
	int i,s,p;
	s=strlen(c);
	int a[105]={0};
	int b[105]={0};
	for(i=0;i<s;i++)
		a[i]=c[i]-48;
	if(s==1)
	{
		cout<<0<<endl;
		cout<<a[0];
	}
	else if((s==2)&&(10*a[0]+a[1]<13))
	{
		cout<<0<<endl;
		cout<<(10*a[0]+a[1]);
	
	}
	else if((s==2)&&(10*a[0]+a[1]==13))
	{
		cout<<1<<endl;
		cout<<0;
	
	
	
	}
	else 
	{
		if(10*a[0]+a[1]>13)
		{
			b[0]=(10*a[0]+a[1])/13;

			p=(10*a[0]+a[1])%13;
			for(i=1;i<s-1;i++)
			{
				b[i]=(p*10+a[i+1])/13;
				p=(p*10+a[i+1])%13;
			}

			for(i=0;i<s-1;i++)
				cout<<b[i];
			cout<<endl;
			cout<<p;


		}
		else
		{
			b[0]=(100*a[0]+10*a[1]+a[2])/13;
			p=(100*a[0]+10*a[1]+a[2])%13;
			for(i=1;i<s-2;i++)
			{
				b[i]=(p*10+a[i+2])/13;
				p=(p*10+a[i+2])%13;
			}
			for(i=0;i<s-2;i++)
				cout<<b[i];
			cout<<endl;
			cout<<p;










		}





	}


	return 0;

}
int main()
{
	char str[101];
	int num[101],i,temp,result[101];
	cin>>str;

	for(i=0;i<101;i++)
		result[i]=num[i]=-1;
	for(i=0;str[i]!=0;i++)
		num[i]=str[i]-'0';
	i=0;
	temp=0;
	while(num[i]!=-1)
	{
		temp=temp*10+num[i];
		result[i]=temp/13;
		temp=temp%13;
		i++;
	}
	for(i=0;result[i]==0;i++);
	if(result[i]==-1) cout<<0;
	else
	{
		for(;result[i]!=-1;i++)
			cout<<result[i];
	}
	cout<<endl<<temp;
	return 0;
}
int step=0,length=0,a=0;
int sang[101]={0};
void buqi(int num1[101],int num2[101])
{
	int i;
	num2[0]=1;
	num2[1]=3;
	num2[2]=0;
	if(num1[0]>num2[0]||(num1[0]==num2[0]&&num1[1]>=num2[1])) i=1;
	else
	{
		a++;
		num2[0]=0;
		num2[1]=1;
		num2[2]=3;
		//cout<<a<<endl;
	}
}
void qingling(int num3[101],int num6[101])
{
	int i,j;
	for(i=0;i<length;i++)
	{
		if(num3[i]!=0)
			break;
	}
	for(j=0;j<length-i;j++)
		num3[j]=num3[j+i];
	for(j=length-i;j<length;j++)
		num3[j]=0;
	length=length-i;
	//cout<<length<<endl;
	if(num6[0]!=0)
		a=a+i-1;
	else a=a+i-2;
	//cout<<a<<endl;
}
void jianfa(int num4[101],int num5[101],int i)
{
	int j;
	while(true)
	{
		for(j=i-1;j>=0;j--)
		{
			if(num4[j]>=num5[j])
			{
				num4[j]=num4[j]-num5[j];
				//cout<<num4[j]<<" ";
			}
			else 
			{
				num4[j-1]=num4[j-1]-1;
				num4[j]=num4[j]+10;
				num4[j]=num4[j]-num5[j];
				//cout<<num4[j]<<" ";
			}
		}
		//cout<<endl;
		if(num5[0]==1)
		{
			if(num4[0]>num5[0]||(num4[0]==num5[0]&&num4[1]>=num5[1])) j=j;
			else break;
		}
		else 
		{
			if(num4[0]>num5[0]||num4[1]>num5[1]||(num4[1]==num5[1]&&num4[2]>=num5[2])) j=j;
			else break;
		}

		step++;
	}
}
int main()
{
	char str1[101]={'\0'};
	int num1[101]={0},num2[101]={0};
	int i,weishu,biaoji=0,j;
	cin>>str1;
	length=strlen(str1);
	weishu=length;
	for(i=0;i<length;i++)
	{
		num1[i]=str1[i]-'0';
	}
	while(true)
	{
		step=0;
		if(length==1)
			break;
		buqi(num1,num2);
		if(length==2&&num2[0]==0)
		{
			num1[0]=num1[0]*10+num1[1];
			sang[a]=0;
			break;
		}
		else
		{
			jianfa(num1,num2,length);
			biaoji=0;
			for(i=0;i<weishu;i++)
			{
				if(num1[i]!=0)
				{
					biaoji=1;
					break;
				}
			}
			sang[a]=step+1;
			//cout<<a<<" "<<sang[a]<<" "<<endl;
			if(biaoji==1)
			{
				qingling(num1,num2);
			}	
			else break;
		}
		a++;
	}
	if(weishu>1)
	{
		for(i=0;i<weishu-1;i++)
		{
			if(sang[i]!=0)
				break;
		}
		if(i==weishu-1)
			cout<<sang[0];
		else
		{
			for(j=i;j<weishu-1;j++)
				cout<<sang[j];
		}
	}
	else cout<<sang[0];
	cout<<endl;
	cout<<num1[0]<<endl;
		return 0;
}
int main()
{
    char a[100];
    int l,i,r=0,m,q[100];
    scanf("%s",a);    
    l=strlen(a);
    if(l==1){
		printf("0\n");
		printf("%d",(int)(a[0]-'0'));
		}
	else if(l==2){
		m=(int)(a[0]-'0')*10+(int)(a[1]-'0');
		printf("%d\n%d",m/13,m%13);
		}
	else{
		for(i=0;i<l;i++){
		q[i]=(r*10+(int)(a[i]-'0'))/13;
		r=(r*10+(int)(a[i]-'0'))%13;
		}
	for(i=0;i<l;i++){
		if(i==0||(i==1&&q[i]==0)) continue;		
		else{
			if(i<l-1) printf("%d",q[i]);
			else if(i=l-1) printf("%d\n",q[i]);
			}
		}	
	printf("%d",r);
    }
    scanf("%d",&m);
    return 0;
}
int main()
{
        int l,i,j,tem,carry;
        char input[110];
        int in[110],out[110];
        scanf("%s",input);
        l=strlen(input);
        for(i=0;i<l;i++)
                in[i]=input[i]-'0';
        carry=in[0];
if(l==1){printf("0\n%d",in[0]);return 0;}
        for(i=1;i<l;i++)
        {
                tem=10*carry+in[i];
                out[i-1]=tem/13;
                carry=tem%13;
        }
        if(out[0]!=0)
        {
                printf("%d",out[0]);
                for(i=1;i<l-1;i++)
                  printf("%d",out[i]);
                printf("\n");
        }
        else if((out[0]==1||out[0]==0)&&l-1<2) printf("%d\n",out[0]);
        else if(out[0]==0&&l-1>1)
        {
                for(i=1;i<l-1;i++)
                        printf("%d",out[i]);
                printf("\n");
        }
                
        printf("%d",carry);
        return 0;
}
int main()
{
    char a[100];
    int i,l,d,x,m,r[100],p[100],s[100];
    scanf("%s",a);
    l=strlen(a);
    for(i=0;i<l;i++)
    {
      s[i]=a[i]-'0';
    }
    r[0]=s[0]%13;
    p[0]=s[0]/13;
    for(i=1;i<l;i++)
    {
     r[i]=(s[i]+r[i-1]*10)%13;
     p[i]=(s[i]+r[i-1]*10)/13;
    }
    if(l>2)
 {   
    for(i=0;i<3;i++)
    {
     if(p[i]==0&&p[i+1]!=0)
     d=i;
    }
     for(i=(d+1);i<l;i++)
     {
     printf("%d",p[i]);
     }
 }   
     if(l<=2)
 {
     x=s[0];
     for(i=1;i<l;i++)
     {
      x=s[i]+x*10;
     }
     m=x/13;
     printf("%d",m);
 }
    printf("\n");
    printf("%d",r[l-1]); 
    getchar();
    getchar();
}
char a[1000]={0},b[1000]={0},c[1000]={0};
int la,lb,lc;

void zl()
{
	for (int i=lb;i>=1;i--)
	{
		if (b[i]<48)
		{
			b[i]=b[i]+10;
			b[i-1]=b[i-1]-1;
		}
	}
}

int main ()
{
    while (1)
    {
        b[1]=getchar();
        if (b[1]==-1)
        break;
        /*for (int i=2;i<=999;i++)
        {
            a[i]=getchar ();
            if (a[i]==10)
            {
                la=i-1;
                break;
            }
        }*/
        for (int i=2;i<=999;i++)
        {
            b[i]=getchar ();
            if (b[i]==10)
            {
                lb=i-1;
                break;
            }
        }
		b[0]=48;
        if (b[1]==49&&b[2]<=50)
        {
            lc=lb-2;
            for (int i=1;i<=lc;i++)
            {
                int f=100*(b[i]-48)+10*(b[i+1]-48)+(b[i+2]-48);
                switch (f/13)
                {
                    case 0 :c[i]=0+48;break;
                    case 1 :c[i]=1+48;b[i+1]=b[i+1]-1;b[i+2]=b[i+2]-3;break;
                    case 2 :c[i]=2+48;b[i+1]=b[i+1]-2;b[i+2]=b[i+2]-6;break;
                    case 3 :c[i]=3+48;b[i+1]=b[i+1]-3;b[i+2]=b[i+2]-9;break;
                    case 4 :c[i]=4+48;b[i+1]=b[i+1]-5;b[i+2]=b[i+2]-2;break;
                    case 5 :c[i]=5+48;b[i+1]=b[i+1]-6;b[i+2]=b[i+2]-5;break;
                    case 6 :c[i]=6+48;b[i+1]=b[i+1]-7;b[i+2]=b[i+2]-8;break;
                    case 7 :c[i]=7+48;b[i+1]=b[i+1]-9;b[i+2]=b[i+2]-1;break;
                    case 8 :c[i]=8+48;b[i]=b[i]-1;b[i+1]=b[i+1]-0;b[i+2]=b[i+2]-4;break;
                    case 9 :c[i]=9+48;b[i]=b[i]-1;b[i+1]=b[i+1]-1;b[i+2]=b[i+2]-7;break;
                }
				zl ();
            }
        }
        else
        {
            lc=lb-1;
            for (int i=0;i<=lc-1;i++)
            {
				int f;
				f=100*(b[i]-48)+10*(b[i+1]-48)+(b[i+2]-48);
                switch (f/13)
                {
					case 0 :c[i+1]=0+48;break;
					case 1 :c[i+1]=1+48;b[i+1]=b[i+1]-1;b[i+2]=b[i+2]-3;break;
                    case 2 :c[i+1]=2+48;b[i+1]=b[i+1]-2;b[i+2]=b[i+2]-6;break;
                    case 3 :c[i+1]=3+48;b[i+1]=b[i+1]-3;b[i+2]=b[i+2]-9;break;
                    case 4 :c[i+1]=4+48;b[i+1]=b[i+1]-5;b[i+2]=b[i+2]-2;break;
                    case 5 :c[i+1]=5+48;b[i+1]=b[i+1]-6;b[i+2]=b[i+2]-5;break;
                    case 6 :c[i+1]=6+48;b[i+1]=b[i+1]-7;b[i+2]=b[i+2]-8;break;
                    case 7 :c[i+1]=7+48;b[i+1]=b[i+1]-9;b[i+2]=b[i+2]-1;break;
                    case 8 :c[i+1]=8+48;b[i]=b[i]-1;b[i+1]=b[i+1]-0;b[i+2]=b[i+2]-4;break;
                    case 9 :c[i+1]=9+48;b[i]=b[i]-1;b[i+1]=b[i+1]-1;b[i+2]=b[i+2]-7;break;
                }
				zl ();
            }
        }
        /*for (int i=1;i<=la+1;i++)
        putchar (a[i]);*/
        for (int i=1;i<=lc;i++)
        putchar (c[i]);
		if (lc==0)
		cout <<"0"<<endl;
        putchar (10);
        cout <<(10*(b[lb-1]-48)+(b[lb]-48))<<endl;
    }
    return 0;
}
int main()
{
    char setline[400];
    int an[400],res[400];
    while(cin>>setline)
    {
        int i,j,k,len,len2;
        memset(an,0,400);
        memset(res,0,400);
        len=strlen(setline);


        for(i=0;i<len;i++)
        {
            an[i]=setline[i]-'0';
        }


        res[0]=an[0]/13;
        for(i=0;i<len-1;i++)
        {
            res[i+1]=((an[i]%13)*10+an[i+1])/13;//cout<<(an[i]%13)*10+an[i+1]<<' ';
            an[i+1]=(an[i]%13)*10+an[i+1];

        }
        len2=an[len-1]%13;
        if(len==1) cout<<0;
        else if(len==2&&an[1]<13) cout<<0;
        else
        {i=0;
        while(res[i]==0) i++;
        for(i;i<len;i++)
        cout<<res[i];}
        cout<<endl<<len2<<endl;

        //for(i=0;i<len;i++) cout<<an[i]<<" ";
    }
    return 0;
}
int main()
{
	char integral[120],divide[120];
	int mod;
	int i;
	int int1,int2;
	int len,lendivide;
	scanf("%s",integral);
	len=strlen(integral);
	int1=(int)(integral[0]-'0');
	int2=(int)(integral[1]-'0');
	if (len==1)
	{
		printf("0\n");
		printf("%d\n",int1);
	}
	if (len==2 && int1*10+int2<13)
	{
		printf("0\n");
		printf("%d\n",int1*10+int2);
	}
	if ((len==2 && int1*10+int2>=13) ||(len>2))
	{
	lendivide=((int1*10+int2)<13)? len-2:len-1;
	if (lendivide==len-1)
	{
		for (i=0;i<lendivide;i++)
		{
			if (i==0)
			{
				divide[i]=(char)(((int)(integral[i]-'0')*10+(int)(integral[i+1]-'0'))/13+48);
				mod=((int)(integral[i]-'0')*10+(int)(integral[i+1]-'0'))%13;
			}
			else
			{
				divide[i]=(char)((mod*10+(int)(integral[i+1]-'0'))/13+48);
				mod=(mod*10+(int)(integral[i+1]-'0'))%13;
			}
		}
	}
	if (lendivide==len-2 && lendivide!=0)
	{
		for (i=0;i<lendivide;i++)
		{
			if (i==0)
			{
				divide[i]=(char)(((int)(integral[i]-'0')*100+(int)(integral[i+1]-'0')*10+(int)(integral[i+2]-'0'))/13+48);
				mod=((int)(integral[i]-'0')*100+(int)(integral[i+1]-'0')*10+(int)(integral[i+2]-'0'))%13;
			}
			else
			{
				divide[i]=(char)((mod*10+(int)(integral[i+2]-'0'))/13+48);
				mod=(mod*10+(int)(integral[i+2]-'0'))%13;
			}
		}
	}
	divide[lendivide]='\0';
	printf("%s\n",divide);
	printf("%d\n",mod);
	}
	return 0;
}
int main(){
    char a[101];
    int b[102],c[101];
    b[0]=0;
    gets(a);
    for(int i=1;i<=strlen(a);i++){
            b[i]=a[i-1]-48;
            c[i]=(b[i-1]*10+b[i])/13;
            b[i]=(b[i-1]*10+b[i])%13;
            }
    if(strlen(a)==1||(strlen(a)==2&&c[2]==0))
    printf("0");
    else{
    if(c[2]>0)
    printf("%d",c[2]);
    for(int i=3;i<=strlen(a);i++){
    printf("%d",c[i]);
}
}
    printf("\n%d",b[strlen(a)]);
    return 0;
}
main()
{
      char c[100];
      int x,y,z;
      scanf("%s",c);
      int L=strlen(c);
      int a=0;
      int i,k;
      if(L==1)
      {
      printf("%d\n",a);
      printf("%c",c[0]);
      }
      else if(L==2&&(c[0]=='1')&&c[1]<'3')
      {
      printf("%d\n",a);
      printf("%c%c",c[0],c[1]);
      }
      else 
      { 
           if((c[0]=='1')&&c[1]<'3')
      {
          x=c[0]-'0';
          y=c[1]-'0';
          z=(x*100+y*10+c[2]-'0')/13;
          printf("%d",z);
          a+=((x*100+y*10+c[2]-'0')%13)*10;
       for(i=3;i<L;i++)
      {
                       a+=c[i]-'0';
                       k=a/13;
                       printf("%d",k);
                       a=(a%13)*10;
      }
      printf("\n%d",a/10);
      }
      else
       {
                  x=c[0]-'0';
                  y=(x*10+c[1]-'0')/13;
                  printf("%d",y);
                  a+=((x*10+c[1]-'0')%13)*10;
      
      for(i=2;i<L;i++)
      {
                       a+=c[i]-'0';
                       k=a/13;
                       printf("%d",k);
                       a=(a%13)*10; 
      }
      printf("\n%d",a/10);
      }
}
}
int main()
{
	char str[101];
	int num[100], i, sum, rem = 0;
	cin.getline(str,101);
	for(i = 0; str[i] != '\0'; i++)
	{
		num[i] = str[i] - '0';
	}
	rem = num[0];
	for(i = 1; str[i] != '\0'; i++)
	{
		sum = rem * 10 + num[i];
		if (i != 1 || sum > 12)
			cout << sum / 13;
		rem = sum % 13;
	}
	if (i == 1 || (i == 2 && sum <= 12))
		cout << '0';
	cout << endl;
	cout << rem << endl;
	return 0;
}
int main()
{
char s[100];
int num[100],quo[100];
int l,i,x,r;
    scanf("%s",s); 
    l=strlen(s);
    for (i=0;i<l;i++) num[i]=s[i]-48;
    for (i=0;i<100;i++) quo[i]=0;
    if (l>2)
    {
      if (num[0]*10+num[1]>=13)
      {
        quo[0]=(num[0]*10+num[1])/13;
        r=(num[0]*10+num[1])%13;
        for (i=2;i<l;i++)
        {
          quo[i-1]=(r*10+num[i])/13;
          r=(r*10+num[i])%13;
        }
        for (i=0;i<=l-2;i++) printf("%d",quo[i]);
        printf("\n"); 
        printf("%d\n",r);
      }    
      else 
      {
        quo[0]=(num[0]*100+num[1]*10+num[2])/13;
        r=(num[0]*100+num[1]*10+num[2])%13;
        for (i=3;i<l;i++)
        {
          quo[i-2]=(r*10+num[i])/13;
          r=(r*10+num[i])%13;
        }
        for (i=0;i<=l-3;i++) printf("%d",quo[i]);
        printf("\n"); 
        printf("%d\n",r);    
       }
     }
     if (l==2)
     {
       quo[0]=(num[0]*10+num[1])/13;
       r=(num[0]*10+num[1])%13;
       printf("%d\n",quo[0]);
       printf("%d\n",r);             
     }
     if (l==1)
     {
       quo[0]=num[0]/13;
       r=num[0]%13;
       printf("%d\n",quo[0]);
       printf("%d\n",r);    
     }
     getchar();
     getchar();     
}
int main()
{
	int i_shu[100] = {0}, shang[100] = {0};
	int i, len, yu = 0, k = 0;
	char c_shu[100];
	gets(c_shu);
	len = strlen(c_shu);

	for (i = 0; i < len; i++)
		i_shu[i] = c_shu[i] - '0';

	for (i = 0; i < len; i++)
	{
		yu = yu * 10 + i_shu[i];
		shang[i] = yu / 13;
		yu = yu % 13;
	}
	
	if (len <= 2)
		cout << shang[1];
	else
	{
		for (i = 0; shang[i] == 0; i++)
			k++;
		for (i = k; i < len; i++)
			cout << shang[i];
	}
	cout << endl << yu << endl;
	return 0;
}
int main(){
char a[103];
int bcs[100];
int shang[100];
int len,yu,dq,i;
gets(a);
len=0;
for(i=0;a[i]!='\0';i++){
bcs[i]=a[i]-'0';
len++;
}
if(len==1){
yu=bcs[0];
printf("0\n");
printf("%d",yu);
}
else{
for(i=0;i<len-1;i++){
if(i==0){
dq=bcs[i]*10+bcs[i+1];
}else{dq=10*yu+bcs[i+1];}
shang[i+1]=dq/13;
yu=dq%13;
}
for(i=1;i<=len-1;i++){
if(shang[i]==0&&i==1&&len!=2)
continue;
if(i==len-1)
printf("%d\n",shang[i]);
else
printf("%d",shang[i]);
}
printf("%d\n",yu);}
scanf("%d",&i);
}
main()
{
      int a,b,c,d,e,i;
      char f[1000];
      char g[1000];
      scanf("%s",f);
      a=strlen(f);
      if (a==1)
      {
               printf("0\n");
               printf("%s",f);
      }
      else
      {
      for (i=0;i<a;i++)
      {
          f[i]=f[i]-'0';
      }
      b=f[0];
      for (i=0;i<a-1;i++)
      {
          b=b*10+f[i+1];
          g[i]=b/13;
          b=b%13;
      }
      if (g[0]==0 && a>2)
      {
                  for (i=0;i<a-1;i++)
                  {
                      g[i]=g[i+1];
                  }
                  g[i-1]='\0';
                  for (i=0;i<a-2;i++)
                  {
                      g[i]=g[i]+'0';
                  }
      }
      else if (g[0]==0 && a<=2)
      {
           g[0]=0+'0';
           g[1]='\0';
      }
      else
      {
          g[a-1]='\0';
          for (i=0;i<a-1;i++)
          {
              g[i]=g[i]+'0';
          }
      }
      printf("%s\n",g);
      printf("%d\n",b);
      }
      getchar ();
      getchar ();
}
int main()
{
	char a[105];
	char b[105];
	int i;
	int x,l,n;
	for(i=0;i<105;i++)
		a[i]='\0';
	for(i=0;i<105;i++)
		b[i]='\0';

	gets(a);
	if((l=strlen(a))==1)
	{
		printf("0\n");
		printf("%d\n",a[0]-48);
	}
	else if((l=(strlen(a)))==2)
	{	
		x=10*(a[0]-48)+(a[1]-48);
		if(x<C)
		{
			printf("0\n");
			printf("%d\n",x);
		}
		else
		{
			printf("%d\n",(x-(x%C))/C);
			x=x%C;
			printf("%d\n",x);
		}

	
	}

	else
	{
	  for(i=0,n=0;a[i+2]!='\0';i++)
	  { 
		 if(i==0)
		 {
			x=10*(a[i]-48)+(a[i+1]-48);/*printf("%d\n",x);*/
			while(x<C)
			{
				i++;
				x=10*x+(a[i+1]-48);/*printf("%d %d\n",i,x);*/
			}
			b[n]=(x-(x%C))/C+'0';
			n++;
			x=x%C;
		 }
		 else
		 {
		    x=10*x+(a[i+1]-48);
			while(x<C)
			{
				b[n]='0';
				n++;
				i++;
				x=10*x+(a[i+1]-48);
			}
			b[n]=(x-(x%C))/C+'0';
			n++;
			x=x%C;
		 }
		
	  }
	//printf("%d\n",i);
	if(i==(l=(strlen(a)-1)))
	{
		puts(b);
		printf("%d\n",x);
	}
	else if(i==(l=(strlen(a)-2)))
		{
			x=10*x+(a[strlen(a)-1]-48);
			if(x<C)
			{
				b[n]='0';
				puts(b);
				printf("%d\n",x);
			}
			else
			{
				b[n]=(x-(x%C))/C+'0';
				puts(b);
				x=x%C;
				printf("%d\n",x);
			}
		}
	}

	return 0;
	

}
int main()
{
	char dividend[100], result[100];
	int i, remainder, len, temDivid, flag = 0;
	cin >> dividend;
	len = strlen(dividend);
	for (i = 0, temDivid = dividend[0] - '0'; i < len - 1; i++)
	{
		result[i] = temDivid / DIVISOR + '0';
		remainder = temDivid % DIVISOR;
		temDivid = remainder * 10 + (dividend[i + 1] - '0');
	}
	result[i] = temDivid / DIVISOR + '0'; // ????i = len????dividend[i + 1]??????len=1??????
	remainder = temDivid % DIVISOR;
	result[i + 1] = '\0';
	for (i = 0; result[i] == '0';)
		i++;
	if (result[i] == '\0')
		cout << 0 << endl << remainder << endl;
	else
		cout << result + i << endl << remainder << endl;
	return 0;
}
main()
{
      char a[100],b[100];
      int c,len,d,e,f[100];
     scanf("%s",a);
     len=strlen(a);
     if (len==1)
     {printf("0\n");printf("%d",a[0]-'0');}
     else
{if (len==2 && ((a[0]-'0')*10+a[1]-'0')<13)
     {printf("0\n");printf("%d",((a[0]-'0')*10+a[1]-'0'));}
     else
{
     for(c=0;c<=len-1;c++)
     {
     f[c]=a[c]-'0';
     }
     for(c=0;c<=len-2;c++)
     { 
       d=f[c]/13;
       b[c]=d+'0';
       e=f[c]%13;
       f[c+1]=f[c+1]+e*10;
     }
      d=f[len-1]/13;
       b[len-1]=d+'0';
       e=f[len-1]%13;
      if (b[0]!='0')
       printf("%s\n",b);
      else 
          {if (b[1]!='0')
        { for(c=0;c<=len-1;c++)
         {
         b[c]=b[c+1];
         }
         b[len-1]=0;
        printf("%s\n",b);
        } 
        else 
        { for(c=0;c<=len-2;c++)
         {
         b[c]=b[c+2];
         }
         b[len-1]=0;
         b[len-2]=0;
        printf("%s\n",b);
        } 
        printf("%d",e);}
        
}
}
     
      }
/*?????13
  ??????
  ???1100012802*/
int main()
{
	char a[100];
	int q[100] = {0},b[100] = {0},i,j;
	cin.getline(a,100);
	for(i = 0;a[i] != '\0';i++)
	{
		q[i] = a[i] - '0';
	}
	for(i = 0;a[i + 1] != '\0';i++)
	{
		q[i + 1] = 10 * q[i] + q[i + 1];
		b[i] = q[i + 1] / 13;
		q[i + 1] = q[i + 1] % 13;
	}
	if(i == 0)
		cout << 0;
	else if(i == 1 || b[0] != 0)
		cout << b[0];
	for(j = 1;j <= i - 1;j++)
		cout << b[j];
	cout << endl << q[i];
	return 0;
}
main()
{
      int i,j,temp,yushu=0;
      char a[105],b[105];
      scanf("%s",a);
      for(i=0;a[i]!='\0';i++)
      {
                             temp=a[i]-'0'+yushu*10;
                             b[i]=temp/13;
                             yushu=temp%13;
      }
      if(b[0]==0)
      {
                 if(b[1]==0)
                 {
                            if(i==1||i==2) printf("0");
                            for(j=2;j<i;j++) printf("%c",b[j]+'0');
                 }
                 else
                 {
                     for(j=1;j<i;j++) printf("%c",b[j]+'0');
                 }
      }
      else
      {
          for(j=0;j<i;j++) printf("%c",b[j]+'0');
      }
      printf("\n%d",yushu);
      
}
main(){
	char s1[100],s2[100]={'\0'},c;
	int a[100]={0},b,k,i,len,l,num;
	gets(s1);
	len=strlen(s1);
	if(len==2&&(10*(s1[0]-'0')+s1[1]-'0')<13) printf("0\n%d",10*(s1[0]-'0')+s1[1]-'0');
	else if(len==1) printf("0\n%d",s1[0]-'0');
	else{
	k=s1[0]-'0';
	for(i=1;i<len;i++){
		b=10*k+s1[i]-'0';
		if(b>=13){
			k=b%13;
			a[i-1]=(b-k)/13;}
		else k=b;
	}
	if((10*(s1[0]-'0')+s1[1]-'0')>=13)
	{
	for(l=0;l<len-1;l++)s2[l]=a[l]+'0';}
	else {
	for(l=0;l<len-2;l++)s2[l]=a[l+1]+'0';}
	puts(s2);
	printf("%d",k);}
	}
//3.cpp
//?????13
//?????
//???11?12?


int main()
{
	char a[100], b[100];
	int i, j, m, l, yu;
	cin >> a;
	l = strlen(a);
	yu = 0;
	for (i = 0; i < l; i++)
	{
		m = yu * 10 + (a[i] - '0');
		b[i] = m / 13 + '0';
		yu = m % 13;
	}
	j = 0;
	while (b[j] == 48)
	{
		j++;
	}
	if (j == l)
		cout << '0';
	else
		for (i = j; i < l; i++)
			cout << b[i];
	cout << endl;
	cout << yu;
	return 0;
}
int main()
{
	int a[110]={0};
	int i=0;
	char x[2]={'\0'};
	while(true)
	{
		x[0]=getchar();
		if(x[0]=='\n')break;
		a[i]=atof(x);
		i++;
	}
	int n,yu;
	yu=a[0];
	n=i;
	int b[110];
	memset(b,-1,110*sizeof(int));
	if(i==1)b[0]=0;
	for(i=1;i<n;i++)
	{
		int now;
		now=a[i]+10*yu;
		if(now<13){b[i-1]=0;yu=now;}
		else
		{
			b[i-1]=now/13;
			yu=now%13;
		}
	}
	int cow=0;
	while(b[cow]==0)cow++;
	if(b[1]==-1)cow=0;
	for(i=cow;i<n;i++)if(b[i]!=-1)cout<<b[i];
	cout<<endl;
	cout<<yu;
	
	return 0;
	
}
int main()
{
	int i,j,k;
	int shuzu[101],shang[101]={0};
	int fenjie;
	char chuan[101];//????? 
	cin>>chuan;//????? 
	int length=strlen(chuan);//?????? 
	
	for(i=0;i<length;i++)shuzu[i]=chuan[i]-'0';//??????? 
	
	if(length==1)
    {
		      cout<<"0"<<endl<<shuzu[0]<<endl;
	}//????? 
	
	else
    { 		
            	fenjie=shuzu[0]*10+shuzu[1];
            	shuzu[1]=fenjie%13;
            	if(length==2 && fenjie<13)
                {
                             cout<<"0"<<endl;
                             cout<<fenjie;
                }//??13?????? 
            	else
                {
                    if(fenjie>=13)
                    shang[0]=fenjie/13;//????                                                                     	
                	for(i=1;i<length-1;i++)
                    {
                		fenjie=shuzu[i]*10+shuzu[i+1];
                		shuzu[i+1]=fenjie%13;
                		shang[i]=fenjie/13;
                	}
                	if(shang[0]!=0)cout<<shang[0];
                	for(i=1;i<length-1;i++)cout<<shang[i]; 
                    cout<<endl;
                    cout<<shuzu[i];
                 }//???? 
    }
	return 0;
}
main()
{
    char num[110];
    char shang[110];
    int yushu,i,j,m,n;
    gets(num);
    j=strlen(num);
    yushu=num[0]-'0';
    if(j==1)
    {
        m=num[0]-'0';
        shang[0]=m/13+'0';
        shang[1]='\0';
        yushu=m;
    }
    if(j==2)
    {
        m=(num[0]-'0')*10+num[1]-'0';
        shang[0]=m/13+'0';
        shang[1]='\0';
        yushu=m%13;
    }
    if(j>=3)
    {
        m=yushu*10+num[1]-'0';
        if(m>=13)
        {
        for(i=1;i<=j-1;i++)
        {
            m=yushu*10+num[i]-'0';
            yushu=m%13;
            shang[i-1]=m/13+'0';
        }
        shang[j-1]='\0';
        }
        else
        {
            yushu=yushu*10+num[1]-'0';
            for(i=2;i<=j-1;i++)
            {
                m=yushu*10+num[i]-'0';
                yushu=m%13;
                shang[i-2]=m/13+'0';
            }
            shang[j-2]='\0';
        }
    }

    puts(shang);
    printf("%d",yushu);
}
int main(){
	char a[101];
	int	b[100]={0};
	int i,n,m,x;
	scanf("%s",a);
	n=strlen(a);
	
	
	if(((a[0]-'0')*10+(a[1]-'0'))<13){
		x=(a[0]-'0')*10+a[1]-'0';
		for(i=2;i<n;i++){
		b[i-2]=(x*10+(a[i]-'0'))/13;
		x=(x*10+(a[i]-'0'))%13;
	}
		m=n-2;
	}
	else{
		x=a[0]-'0';
		for(i=1;i<n;i++){
		b[i-1]=(x*10+(a[i]-'0'))/13;
		x=(x*10+(a[i]-'0'))%13;
	}
		m=n-1;
	}
	for(i=0;i<m-1;i++){
		printf("%d",b[i]);
	}
	printf("%d\n",b[m-1]);
	printf("%d",x);
	return 0;
}
int main()
{
	char shu[101];
	int num[101]={0},result[101]={0};
	int i,j,yushu,flag=0;
	cin.getline ( shu,101);
	for( i=0; shu[i] != '\0'; i++ )
	{
	  num[i] = shu [i] - '0' ;
	}
  





		for ( i = 0; shu[i] != '\0'; i++ )
	{
		result[ i ] = num[i] / 13;
		num [i+1] = num [i+1] + ( num[i] % 13 ) * 10;
	}
	yushu = num[i-1] % 13 ;
    

		for ( j=0; shu[j]!='\0';j++ )
	{
		if(result[j] !=0)
		{
        flag=1;
        break;
		}}
		if (flag){

for ( ;shu[j]!='\0'; j++ )
	{
		cout<<result[j];
	}
}
else cout<<"0"<<endl;
cout<<endl<<yushu<<endl;
			return 0;
}