semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main(){
	int i,j,k,l,count,mid,judge,re[110];
	char num[110],fra[110];
	count=-1;
	scanf("%s",num);
	l=strlen(num);
	for(i=0;i<l;i++){
		fra[i]=num[i];
	}
	judge=(num[0]-'0')*10+(num[1]-'0');
//	for(i=0;i<l;i++){
//		printf("%c\n",fra[i]);
//	}
	for(i=0;i<l-1;i++){
		mid=(fra[i]-'0')*10+(fra[i+1]-'0');
		count++;
		re[count]=mid/13;
		if(count==0&&re[count]==0){
			re[0]=10000;
		}
		fra[i+1]=mid%13+'0';
	}
	for(i=0;i<l-1;i++){
		if(re[i]==10000&&i==0){
			continue;
		}
		printf("%d",re[i]);
	}
	if(l<2){
		judge=0;
	}
	if(l>2||(l==2&&judge>12)){
		printf("\n%d",fra[l-1]-'0');
	}else if(l==1||(l==2&&judge<13)){
		printf("0\n");
		if(l==1){
			printf("%c",num[0]);
		}else if(l==2){
			printf("%d",judge);
		}
	}
	return 0;
}
int main(){
	char origin[101];
	gets(origin);
	char result[100];
	int i;
	int a;
	int b;
	a=strlen(origin);
	if(a<2){
		result[0]='0';
		result[1]='\0';
		b=(origin[0]-'0')%13;
		puts(result);
		printf("%d", b);
	}
	else if(((a==2)&&((origin[0]-'0')*10+(origin[1]-'0'))<13)){
        result[0]='0';
		result[1]='\0';
		b=((origin[0]-'0')*10+(origin[1]-'0'))%13;
		puts(result);
		printf("%d", b);

	}
	else{
	
	b=((origin[0]-'0')*10+(origin[1]-'0'))%13;
	int m;
	if((origin[0]-'0')*10+(origin[1]-'0')>=13){
	   m=((origin[0]-'0')*10+(origin[1]-'0'))/13;
	   result[0]=m+'0';
	   for(i=2;i<a;i++){
		m=(b*10+(origin[i]-'0'))/13;
		result[i-1]=m+'0';
		b=(b*10+(origin[i]-'0'))%13;
	   }
    result[i-1]='\0';
	puts(result);
	printf("%d", b);
	}
	else{
        for(i=2;i<a;i++){
		m=(b*10+(origin[i]-'0'))/13;
		result[i-2]=m+'0';
		b=(b*10+(origin[i]-'0'))%13;
		}
    result[i-2]='\0';
	puts(result);
	printf("%d", b);
	}
	}
	
	return 0;
}
int main()
{
    char number[100];
    char quotient[100]={' '};
    cin >> number;
    int r=0;
    int i;
    for (i=0;number[i]!='\0';i++)
    {
        quotient[i]=(r*10+(number[i]-'0'))/13+'0';
        r=(r*10+(number[i]-'0'))%13;
    }
    int len=strlen(quotient);
    if (atoi(number)<13)
    {
        cout << "0" << endl;
    }
    else
    {
    if (quotient[1]!='0')
    {
        cout << quotient[1] ;
    }
     for (i=2;i<=len-1;i++)
    {
         cout << quotient[i];
    }
    cout << '\n';
    }
    cout << r << '\n' ;

    return 0;
}
/*???????
 * thirteen.cpp
 *
 *  Created on: 2013-12-23
 *      Author: Administrator
 */
int main()
{
	char istr[101],istr1[101];
	int len=0,left=0,a=0,i=0,count=0;
	while(cin.getline(istr,101)){
		count=0;
		len=strlen(istr);
	    for(i=0;i<len;i++){
	    	a=left*10+istr[i]-'0';
	    	left=a%13;
	    	istr1[i]=a/13+'0';
	    }
	    istr1[i]='\0';
	    for(i=0;i<len;i++){
	    	if(istr1[i]!='0'||count!=0){
	    		cout<<istr1[i];
	    		count=1;
	    	}
	    }
	    if(count==0)cout<<"0";
	    cout<<endl;
	    cout<<left<<endl;
	    cin.get();
	}
	return 0;
}
int main()
{
	char a[105];
	int b[105] = {0};
	int i, j = 0, t = 0, k, res, remain;
	cin >> a;
	for(i = 0;a[i] != '\0';i++)
	{
		if((a[i + 1]) == '\0')
		{
			t = (t * 10) + a[i] -'0';
			res = t / 13;
			b[j] = res;
			j++;
			remain = t - res * 13;
			break;
		}
		else
		{
			t = (t * 10) + a[i] - '0';
			res = t / 13;
			if((res == 0) && (b[0] == 0))
				continue;
			else
			{
			    b[j] = res;
				j++;
			}
			t = t - res * 13;
		}
	}
	for (i = 0; i < j; i++)
	    cout << b[i];
	cout << endl;
	cout << remain;

    return 0;
}
int main()
{
	char a[300],b[300];
	int i,j=0,m,n,k;
	gets(a);
	if(strlen(a)==1)
	printf("0\n%s",a);
	else{
	 m=10*(a[0]-'0');
	for(i=1;i<strlen(a)-1;i++)
	{
	   m+=a[i]-'0';
	   if(m<13)
	   {
			if(i!=1)
			printf("0");
	        m=m*10+(a[i+1]-'0');
	        i+=1;
	   }
		n=m/13;
		printf("%d",n);
		m=m%13*10;
	}
	if(i==strlen(a))
	{
		printf("\n%d",m);
	}
	else
	{
		m+=a[i]-'0';
		if(m>=13)
		{
		n=m/13;
		printf("%d",n);
		m=m%13;
		printf("\n%d",m);
	    }
	    else
	    {
			printf("0");
			printf("\n%d",m);
		}
	}
}
	return 0;
}
int main()
{
    char a[1000];
    int len, i, b[1000] = {0};
    cin.getline(a, 1000);
    len = strlen(a);
    for (i = 0; i < len; i++)
    {
        b[i] = a[i] - '0';     //????????????
    }
    for (i = 0; i < len; i++)
    {
        b[i + 1] = b[i] % 13 * 10 + b[i + 1];
        b[i] = b[i] / 13;
    }
    i = 0;
    while(1)
    {
        if (b[i] != 0)
            break;
        i++;
    }
    if (i == len)             //????0?
        cout << '0' << endl;
    else
    {
    for (; i < len; i++)
        cout << b[i];
        cout << endl;
    }
    cout << b[i] / 10;      //i ??? i+1
    return 0;
}
int main()
{
     int n;
	 char a[100];
     int b[100]={0},i,m,r;
	 gets(a);
     n=strlen(a);
     for(i=0;i<n;i++)
     {
         b[i]=a[i]-'0';
	 }
	 m=b[0]*10+b[1];
	 r=m%13;
	 if(n==1) printf("%d\n%d",0,b[0]);
	 else if(n==2) printf("%d\n%d",m/13,r);
	 else{ if(m/13!=0) printf("%d",m/13);
	 for(i=2;i<n;i++)
	  {
	     m=r*10+b[i];
	     r=m%13;
         printf("%d",m/13);
	  
	  }
	  
	  printf("\n");
	  printf("%d",r);}
	  return 0;
}
int main()
{
	char a[101];
	int i, l, num[101], temp[101], t;
	while (cin.getline(a,101))
	{
		l = strlen(a);
		for (i = 0; i < l; i++)
			num[i] = a[i] - '0';
		temp[0] = 0;
		if (l == 2 && 10 * num[0] + num[1] < 13)
		{
			cout << 0 << endl << 10 * num[0] + num[1] << endl;
			return 1;
		}
		if (l == 1)
		{
			cout << 0 << endl << num[0] << endl;
			return 1;
		}
		for (i = 1; i < l; i++)
		{
			num[i] += 10 * num[i - 1];
			temp[i] = num[i] / 13;
			num[i] %= 13;
		}
		t = num[i - 1];
		for (i = 0; i < l; i++)
			if (temp[i] != 0)
				break;
		for (; i < l; i++)
			cout << temp[i];
		cout << endl << t << endl;
	}
	return 0;
}
//********************************
//*?????13   **
//*?????? 1200012837 **
//*???2012.11.12  **
//********************************

int main()
{
	int i, q = 0, r, len;
	char n[110];
	cin >> n;
	len = strlen(n);
	if(len > 1)
	{
		q = ((n[0] - '0') * 10 + (n[1] - '0')) / 13;
		r = ((n[0] - '0') * 10 + (n[1] - '0')) % 13;//???????????0
		if(q != 0 || len == 2)
			cout << q;
		for(i = 1;i < len - 1;i++)//??????i?<len-1?
		{
			q = (r * 10 + (n[i+1] - '0')) / 13;//??
			r = (r * 10 + (n[i+1] - '0')) % 13;//???

			cout << q;
		}
		cout << endl;
		cout << r << endl;
	}
	else
	{
		cout << '0' << endl;
		cout << n[0] << endl;
	}

	return 0;
}
int main()
{
    int a[110], b[110], c, i, j, k;
    char st[110];


    gets(st);
    for(i=0; st[i]!='\0'; i++)
    {
        a[i] = st[i] - '0';
    }
    a[i] = -1;
    for(i = 0; a[i] != -1; i++)
    {
        b[i+1] = -1;
        if(a[i] < 13)
        {
            b[i]=0;
            if(a[i+1] != -1) a[i+1] += a[i]*10;
            continue;
        }
        else
        {
            b[i] = a[i]/13;
            if(a[i+1] != -1)
                a[i+1] += (a[i]%13)*10;
            else
                a[i] = a[i]%13;
        }
    }
    c = a[i-1];
    for(k=0; b[k]==0; k++);
    if(b[k] == -1 ) printf("0");
    else
    for(i=k; b[i]!=-1; i++)
        printf("%d", b[i]);
    printf("\n%d\n", c);
    return 0;
}
int main()
{
	char c[100];
	int f,num,s=0;
	int i;

	gets(c);

	f=c[0]-48;
	for(i=1;c[i]!=0;i++)
	{
		num=f*10+c[i]-48;
		if(num/13==0&&s==0)
		{
			f=num%13;
		}
		else
		{
			printf("%d",num/13);
			f=num%13;
			s=1;
		}
	}
	if(s==0)
		printf("0");
	printf("\n%d\n",f);
	return 0;
}
int main()
{
   char beichushu[200];
   gets(beichushu);
   int i=0,a,b,x=0,l;
   a=(beichushu[0]-'0')/13;
   b=(beichushu[0]-'0')%13;
   l=strlen(beichushu);
   if(l==1)
     printf("%d\n%d",(beichushu[0]-'0')/13,(beichushu[0]-'0')%13);
   if(l==2)
     printf("%d\n%d",((beichushu[0]-'0')*10+beichushu[1]-'0')/13,((beichushu[0]-'0')*10+beichushu[1]-'0')%13);
   if(l>2)
    {
       for(i=0;beichushu[i+1]!='\0';i++)
      {
        b=(b%13)*10+beichushu[i+1]-'0';
        x=x+1;
        a=b/13;
        if(a==0&&x==1)
          continue;
        else
          printf("%d",a);                                
      } 
        printf("\n%d",b%13); 
    }
   getchar();
   getchar();  
}
int main(void)
{
char ori[101],temp[4],res[100];
int i=1,t,s;
scanf("%s",ori);
temp[0]=ori[0];temp[1]=ori[1];temp[2]='\0';
if(atoi(temp)<13)
{
if(atoi(temp)<10)
{
printf("0\n%d\n",atoi(temp));
return 0;
}
temp[2]=ori[2];temp[3]='\0';
i=2;
}
t=atoi(temp);
for(s=i;ori[i]!='\0';i++)
{
res[i-s]=t/13+'0';
temp[0]=ori[i+1];temp[1]='\0';
if(ori[i+1]=='\0')
t=t%13;
else
t=(t%13)*10+atoi(temp);
}
if(i==s)
{
res[0]='0';
i++;
}
res[i-s]='\0';
printf("%s\n%d\n",res,t);
return 0;
}
main()
{
      char a[2000]; int d,c[2000],n,b[2000],f=0;
   scanf("%s",a);
int i=0; while (a[i]!='\0') {c[i]=a[i]-'0'; i++;}
n=i;
  d=c[0];
    for(int i=1;i<n;i++)
    {
            b[i]=(d*10+c[i])/13;
            d=(d*10+c[i])%13;
            }
        for(int i=1;i<n;i++)
        {
                if(b[i]!=0) {
                            f=i;
                            break;} 
                } 
                int j=0; 
  for(int i=f;i<n;i++,j++)       
  a[j]=b[i]+'0';a[j]=0;if (f==0) {a[0]='0'; a[1]=0;}
//      for(int i=0;a[i]!='\0';i++) printf("%c",a[i]);
     printf("%s",a);
       printf("\n");
      printf("%d",d);
}
main()
{
      char c[100];
      int answer[100];
      int a,j=1,i=0,p,q,m,l;
      scanf("%s",&c);
      a=strlen(c);
      if(a==1){
               printf("0\n");
               printf("%d",c[0]-'0');
               }
      else{
           while(j<a){
                      if(j==1)
                         p=c[j-1]-'0';
                      q=c[j]-'0';
                      m=10*p+q;
                      if(m<=12&&j==1&&a<=2){
                                            printf("0\n");
                                            printf("%d",m);
                                            break;
                                            }
                      else{
                           if(m<=12&&a>2&&j==1){
                                                m=100*p+q*10+(c[j+1]-'0');
                                                j=j+1;
                                                }
                           answer[i]=m/13;
                           p=m%13;
                           i=i+1;
                           }
                      j=j+1;
                      }
           for(l=0;l<i;l++)
              printf("%d",answer[l]);
           if(a!=2||(a==2&&i!=0))
              printf("\n%d",p);
           }
}
//******************************************
//*?????13.cpp                       **
//*??: ??     1100012808              **
//*???2011.11.08                       **
//******************************************
int main()  //???
{        //?????
    int s[101] = {0}, N[101] = {0}, y, i, j;
    char str[101];    //????????
    cin >> str;    //?cin????????
    for (i = 0; i < strlen(str); i++)
	N[i] = str[i] - '0';    //????????????
    if (strlen(str) != 1)    //?????????????
    {
	for (i = 0; i < strlen(str) - 1; i++)
	{
            s[i] = (N[i] * 10 + N[i + 1]) / 13;   //???????????
	    y = (N[i] * 10 + N[i + 1]) % 13;
	    N[i + 1] = y;
	}	
        if (strlen(str) >= 3)
        {
	    if (s[0] != 0)   //???s[0]???0
	        cout << s[0] ;  //???0???
	    for (i = 1; i < strlen(str) - 2; i++)
                cout << s[i] ;
	    cout << s[strlen(str) - 2] << endl;
        }
        else    //????????????
	    cout << s[0] << endl;
        cout << y << endl;
    }
    else 
    {
	cout << "0" << endl ;
	cout << N[0] << endl ; 
    }
    return 0;
}    //?????
char c[101]={'\0'},s[100]={'\0'};//c?????s???
int yu=0;int l;//?????
int main()
{
	void shang(int,int);
	cin>>c;
	for(l=0;c[l]!='\0';l++);
	shang(0,0);
	int i,j;
	if(s[1]=='\0')
		cout<<s[0];
	else if(s[0]=='0'&&s[1]=='0'&&s[2]=='\0')
		cout<<0;
	else
	{
	for(i=0;;i++)
		if(s[i]!='0') break;
	for(j=i;s[j]!='\0';j++)
		cout<<s[j];
	}
	cout<<endl;
	cout<<yu;
	return 0;
}
void shang(int sw,int k)//??????????????????,???????????
{
	if(k<l)
	{
	int chu;//????????????
	chu=yu*10+(c[k]-'0');
	k++;
	while(chu<13)
	{
		if(k==l)
			break;
		chu=chu*10+(c[k]-'0');
		k++;
		s[sw]='0';sw++;
	}
	s[sw]=chu/13+'0';
	sw++;
	yu=chu%13;
	shang(sw,k);
	}
}
int main()
{
	char s[101];
	int a[101]={0},b[101]={0},n,i,j,k,t,m,x;
	scanf("%s",s);
	k=strlen(s);
	for(i=0;i<k;i++)
	{
		a[i]=s[i]-48;
	}
	if(k==1)
	{
		printf("%d\n",0);
		printf("%d\n",a[0]);
	}
	else if(k==2)
	{
		if((a[1]+a[0]*10)>=13)
		{
		    printf("%d\n",(a[0]*10+a[1])/13);
			printf("%d\n",(a[1]+a[0]*10)%13);
		}
		else
		{
			printf("%d\n",0);
			printf("%d\n",a[0]*10+a[1]);
		}
	}
	else
	{
		t=0;
		for(i=0,m=0;i<k;i++)
		{
			b[m]=(t*10+a[i])/13;
			t=(t*10+a[i])%13;
			m++;
		}
		for(i=0;i<n;i++)
		{
			if(b[i]==0&&b[i+1]!=0)
			{
				x=i;
				break;
			}
		}
		for(j=x+1;j<m;j++)
		{
			printf("%d",b[j]);
		}
		printf("\n");
		printf("%d\n",t);
	}
}
/*
*8-3
*??? 1200012851
*??13
*2012.11.13
**/
int main()
{
	char str[100];//??????????str
	int result[100];//??????result
	int i, len, r;//??????i,?????len,??r
	cin.getline (str, 100);//?????
	len = strlen(str);//??????
	if (len == 1)//?????????
	{
		r = str[0] - '0';
		cout << "0" << endl << r << endl;
	}
	else
	{
		if (len == 2)//?????????
		{
			r = ((str[0] - '0') * 10 + (str[1] - '0')) % 13;
			cout << ((str[0] - '0') * 10 + (str[1] - '0')) / 13 << endl << r << endl;
		}
		else//?????????
		{
			r = (str[0] - '0') * 100 + (str[1] - '0') * 10 + (str[2] - '0');//??????
			result[2] = r / 13;
			r = r % 13;
			cout << result[2];
			for (i = 3; i < len; i++)//?????????????
			{
				r = (r * 10 + str[i] - '0');
				result[i] = r / 13;
				r = r % 13;
				cout << result[i];
			}
			cout << endl;
			cout << r << endl;
		}
	}
	return 0;
}
main()
{
char s[100];
int a[100],b[100]={0},c[100];
int m,i,t,k;
scanf("%s",s);
m=strlen(s)-1;
for(i=0;i<=m;i++)
{
  a[i]=s[i]-'0';
}
if(m==0)
  printf("0\n%d",a[0]);
else if(m==1)
{
    t=a[0]*10+a[1];
  printf("%d\n%d",(t-t%13)/13,t%13);
}
else if(m==2)
{
    t=a[0]*100+a[1]*10+a[2];
  printf("%d\n%d",(t-t%13)/13,t%13);
}
else
{
  b[0]=a[0]*100+a[1]*10+a[2];
  c[0]=(b[0]-b[0]%13)/13; 
  for(i=1;i<=m;i++)
     {
       b[i]=(b[i-1]%13)*10+a[i+2];
       c[i]=(b[i-1]-b[i-1]%13)/13;  
     }
  for(i=1;i<m;i++)
    printf("%d",c[i]);
  printf("\n");
  printf("%d\n",b[m-2]%13);  
}
}
//****************************************
//*???chuyi13                           **
//*????? 1100013004              **
//*???2011.11.8                   **
//****************************************
int main()
{
    char yu[500];
    int j = 0, r = 0, i = 0, chu[500] ={0};
    cin >> yu;
    for (r = 0; yu[r] != 0; r++)
    {
        chu[r] = (i * 10 + yu[r] - '0') / 13;     
         i = ((i * 10) + yu[r] - '0') % 13;     
    }
    
    if (r == 1 ) cout << chu[0] << endl << i << endl;
    else if (r == 2 && chu[1] == 0) cout << chu[0] << endl << i <<endl; 
    else
    {
    while (chu[j] == 0 && j <= 1) j++;      
    for (; j < r; j++)
        cout << chu[j];   
        cout << endl;
        cout << i<<endl;
    }
	return 0;
}
int main()
{
     char s[101];
     int a[101]={0};
     int b[101];
	 int i,j;
	 int length;
	 int x;
	 int k;

     gets(s);
     length=strlen(s);
     for(i=0;i<length;i++)
     {
         a[i]=s[i]-'0';
     }
     if(length==1)
     {
         printf("0\n");
         printf("%d",a[0]);
     }
     else
     {
     for(i=0;i<length-1;i++)
     {
         if(i==0)
         {
             k=10*a[i]+a[i+1];
         }
         else
         {
             k=100*a[i-1]+10*a[i]+a[i+1];
         }
		 if(k>=13)
         {
             //printf("***%d***%d\n",k,i);
             b[i]=(k)/13;
			 a[i+1]=(k%13)%10;
			 a[i]=(k%13)/10;
         }
         else
         {
             x=k;
             //printf("***%d***%d\n",x,i);
			 do
             {
                 b[i]=0;
                 if(i==length-2)
                 {
                     b[length-1]=0;
                     break;
                 }
                 x=10*x+a[i+2];
                 //printf("***%d***%d\n",x,i);
				 i++;
             }
             while(x<13);
             b[i]=x/13;
             a[i+1]=(x%13)%10;
			 a[i]=(x%13)/10;
         }
     }
	 if(b[0]!=0||length==2)
	 {
	     printf("%d",b[0]);
	 }

	 for(i=1;i<length-1;i++)
	 {
		 printf("%d",b[i]);
	 }
	 printf("\n");
	 if(a[length-2]!=0)
	 {
	     printf("%d",a[length-2]);
	 }
	 printf("%d",a[length-1]);
     }
     return 0;
}
int main()
{
   int n,l;//l is he length of the characters
   int sum;
   char a[100]={0};
   char b[100]={0};    
   scanf("%s",a);
   l=strlen(a);
   for(n=0;n<=l-1;n++)
   {a[n]=a[n]-'0';}
   a[l]='\0';
   if(l==1)
      printf("0\n%d",a[0]);
   else if(l==2&&a[0]*10+a[1]<13)
      printf("0\n%d",a[0]*10+a[1]);
   else if(l==2&&a[0]*10+a[1]>=13)
     {
      sum=a[0]*10+a[1];
      printf("%d\n%d",sum/13,sum%13);
     }
   else if(l>2&&a[0]*10+a[1]<13)
     {
     sum=a[0]*10+a[1];
     for(n=0;n<=l-3;n++)
       {
         sum=sum*10+a[n+2];
         b[n]=sum/13;
         sum=sum%13;
       }
    for(n=0;n<=l-3;n++)
       b[n]=b[n]+'0';
    b[l-2]='\0';
    printf("%s\n%d",b,sum);
   } 
   else
   {
       sum=a[0];
       for(n=0;n<=l-2;n++)
       {
          sum=sum*10+a[n+1];
          b[n]=sum/13;
          sum=sum%13;
       }
       for(n=0;n<=l-2;n++)
       {
           b[n]=b[n]+'0';               
       }
       b[l-1]='\0';
       printf("%s\n%d",b,sum);
   }
   //getchar();
   //getchar();
}
main()
{
    int m,i;
    int len,mod,ans;
    int a[100],b[100]={10};
    char str[MAX+1];
    scanf("%s",str);
    len=strlen(str);
    for(i=0;i<len;i++)
    {
        a[i]=str[i]-'0';
    }
    if(len==1)
    {printf("0\n");printf("%s",str);}
    else
    if(len==2)
    {if(a[0]*10+a[1]<13)
    {printf("0\n");printf("%s",str);}
    else
    {m=a[0]*10+a[1]; ans=m/13; mod=m%13;
    printf("%d\n",ans);printf("%d",mod);}}
    else
    {
    if((a[0]*10+a[1])>=13)
    {
        for(i=0;i<len-1;i++)
        {
            m=a[i]*10+a[i+1]; ans=m/13; mod=m%13;
            if(ans==0)
            a[i+1]=a[i]*10+a[i+1];
            else
            {b[i]=ans; a[i+1]=mod;}
        }
    for(i=0;i<len-1;i++)
    printf("%d",b[i]);
    printf("\n");
    printf("%d",mod);
    }
    else
    {
        for(i=0;i<len-1;i++)
        {
            m=a[i]*10+a[i+1]; ans=m/13; mod=m%13;
            if(ans==0)
            a[i+1]=a[i]*10+a[i+1];
            else
            {b[i]=ans; a[i+1]=mod;}
        }
        for(i=1;i<len-1;i++)
        printf("%d",b[i]);
        printf("\n");
        printf("%d",mod);
    }
    }
}
main()
{
      char a[100];
      int n,i,b[100];
      int e,f;
      scanf("%s",a);
      n=strlen(a);
      if(n>=3)
      {e=a[0]-'0';
      f=a[1]-'0';
      e=e*10+f;
      f=e/13;
      b[0]=f;
      e=e%13;   
      for(i=2;i<=n-1;i++)
      {
      f=a[i]-'0';
      e=e*10+f;
      f=e/13;
      b[i-1]=f;
      e=e%13;         //yushu//
      }
      if(b[0]==0)
      {for(i=1;i<=n-2;i++)
      printf("%d",b[i]);
      printf("\n");
      printf("%d",e);}
      else
      {for(i=0;i<=n-2;i++)
      printf("%d",b[i]);
      printf("\n");
      printf("%d",e);}}
      else
      {if(n==1)
      {e=a[0]-'0';
      printf("0\n");
      printf("%d",e);}
      if(n==2)
      {e=a[0]-'0';
      f=a[1]-'0';
      e=e*10+f;
     if(e<=12)
     {printf("0\n");
     printf("%d",e);}
     else
     {f=e/13;
     e=e%13;
     printf("%d\n",f);
     printf("%d",e);  }
           }}

      


      getchar();
      getchar();
      getchar();
      getchar();
      getchar();
      getchar();
      getchar();
      getchar();
      getchar();
      getchar();
      getchar();
      }
int main()
{
   char a[110];
   char b[110];
   cin>>a;
   int k=strlen(a);
   if(k==1)
	   cout<<0<<endl<<a<<endl;
   else
   {
	   for(int i=0;i<k;i++)
	   a[i]=a[i]-48;
   int sum=0;
   sum=10*a[0]+a[1];
   b[0]=sum/13+48;
   sum=sum%13;
   a[0]=sum/10;
   a[1]=sum-10*a[0];
   for(int i=0;i<k-2;i++)
   {
   sum=100*a[i]+10*a[i+1]+a[i+2];
   b[i+1]=sum/13+48;
   sum=sum%13;
   a[i+1]=sum/10;
   a[i+2]=sum-10*a[i+1];
   }
   if(b[0]==48)
	  { 
		  if(k==2)
			  cout<<'0';
		  else  for(int i=1;i<k-1;i++)
		   cout<<b[i];
   }
   else
	  {
		  for(int i=0;i<k-1;i++)
		   cout<<b[i];
   }
   cout<<endl;
   cout<<a[k-1]+10*a[k-2]<<endl;
   }
   return 0;
}
//
// ????3.cpp
// ?????13 
// ?????? 1200012943
// ??:2012.11.15
//
int main()
{
	int i, r = 0;
    char num[100];
	int quotient[100];
    cin >> num;  //??????

    for (i = 0; num[i] != '\0'; i++)  //???????????
	{
		quotient[i] = (r * 10 + num[i] - '0') / 13;  //???
        r = (r * 10 + num[i] - '0') % 13;  //????
	}
	if (num[1] == '\0' || num[2] == '\0' && num[0] - '0' == 1 && num[1] - '0' < 3)
		cout << 0;
	else if(quotient[1] == 0)
		{
			for (i = 2; num[i] != '\0'; i++)
				cout << quotient[i];
		}
	else
		{
			for (i = 1; num[i] != '\0'; i++)
				cout << quotient[i];
		}
	cout << endl;
	cout << r << endl; 
    return 0;
}
int main ()
{
	char a[100];
	cin.getline(a,100);
	int num,j,i=0,x;
  	int b[100];
	int r[100];
	r[0]=a[0]-'0';
	while(a[i]!='\0')
	{
		num=r[i]*10+a[i+1]-'0';
		r[i+1]=num%13;
		b[i]=num/13;
		i++;
	}
	for(j=0;j<=i-2;j++)
	{
		if(b[j]!=0)
			break;
	}
	if(j==i-1)
	{cout<<0;}
	else
	{x=j;
	for(j=x;j<=i-2;j++)
	{
		cout<<b[j];
	}
	}
	cout<<'\n'<<r[i-1]<<endl;
	return 0;
}
main()
{
      int n,j;
      char a[100],c[100],f[100];
      int b[100];
      gets(a);
      n=strlen(a);
      for(j=0;j<n;j++)
      b[j]=a[j]-'0';
      int x;
      x=b[0]*10+b[1];
      if((n==2&&x>=13)||n>=3)
      {
                     int d,e;
      e=0;
      for(j=0;j<n;j++)
      {
                      d=e*10+b[j];
                      e=d%13;
                      c[j]=d/13+'0';
                      }
                      c[n]='\0';
      int i,k;
      k=0;
      for(i=0;i<n;i++)
      {
                      if(c[i]!='0'||i>=2)
                      {
                                 f[k]=c[i];
                                 k++;
                                 }
                                 f[k]='\0';
                      }
                      puts(f);
                      printf("%d",e);
                      }
      if(n==2&x<13) 
      {
                    printf("0\n");printf("%d",x);
                    }
      if(n==1)
      {
              printf("0\n");printf("%d",b[0]);
              }
      
      getchar();getchar();getchar();getchar();getchar();getchar();
      }
int main()
{
	char a[100];
	int b[100],c,d,i,e,n;
	scanf("%s",a);
	for(i=0;a[i]!=0;i++)
	{
		b[i]=a[i]-'0';
	}
	c=10*b[0]+b[1];
	n=strlen(a);
	if(n==1)printf("0\n%d",b[0]);
	else
	if(n==2)
	{
		printf("%d\n%d",c/13,c%13);
	}
	else
	{
	if(c<13)
	{
		for(i=2;i<n;i++)
		{
		c=10*c+b[i];
		e=c/13;
		c=c%13;
		printf("%d",e);
		}
	}
	else
	{
		 for(i=2;i<n;i++)
	{
		e=c/13;
		c=c%13;
		c=10*c+b[i];
		printf("%d",e);
	}
	printf("%d",c/13);
	}
	c=c%13;
	printf("\n%d",c);
	}
}
int main ()
{
	char str[101];
	int l, i, num[100],sh[100],r, j;
	cin.getline(str,101);
	l = strlen(str);
	for(i = 0; i<l;i++)
		num[i] = str[i] - '0';
	r = num[0]; sh[0] = 0;
	for(i = 1; i < l;i++)
	{
		sh[i] = (r*10 + num[i])/13;
		r = (r*10 + num[i])%13;
		
	}if(l == 1) cout << "0" << endl;
	else if(l == 2) cout << sh[1] << endl;
	else
	{	i = 0;
	while(sh[i] == 0)i++;


	for(j = i; j < l;j ++)
	cout << sh[j];

	cout << endl;
	}
cout << r;
return 0;
}
int main()
{
 char a[101],b[100];
 int i,x;
 scanf("%s",a);
 if(a[1]=='\0') {printf("0\n");
                 printf("%c\n",a[0]);}                         //printf("%s\n",a);
 else
 {
     if((((a[1]=='1')||(a[1]=='2'))&&(a[2]=='\0'))&&(a[0]=='1'))  {printf("0\n");
                 printf("%s\n",a);}
     else{
 x=10*(a[0]-'0')+(a[1]-'0');              //printf("%d\n",x);
 if(x>=13)
    {
     for(i=0;a[i+1]!='\0';i++)
      {
        x=10*(a[i]-'0')+(a[i+1]-'0');       //printf("%d\n",x);
        b[i]=x/13+'0';                      //printf("%c\n",b[i]);
        a[i+1]=x-13*(b[i]-'0')+'0';         //printf("%c\n",a[i+1]);
      }
      b[i]='\0';
      }
    else
    {
      a[1]=x+'0';                                //printf("x  %d\n",x);  printf("c  %c\n",a[1]);
      for(i=1;a[i+1]!='\0';i++)
      {
       x=10*(a[i]-'0')+(a[i+1]-'0');             // printf("%d\n",x);
       b[i-1]=x/13+'0';                           //printf("%c\n",b[i-1]);
      a[i+1]=x-13*(b[i-1]-'0')+'0';               //printf("%c\n",a[i+1]);
      }
      b[i-1]='\0';
    }
 printf("%s\n",b);
 printf("%c\n",a[i]);
 }}
 getchar();
 getchar();
 getchar();
 return 0;
}