semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
	char a[100],b[100];
	int i,temp,lengtha,lengthb;
	scanf("%s",a);
	lengtha=strlen(a);
	for(i=0;i<100;i++)
	{
		b[i]='\0';
	}
	if(lengtha>2)
	{
		if(10*(a[0]-'0')+a[1]-'0'>=13)
		{
			temp=10*(a[0]-'0')+a[1]-'0';
			for(i=0;i<lengtha-1;i++)
			{
				if(i!=lengtha-2)
				{
					b[i]=temp/13+'0';
					temp=10*(temp%13)+a[i+2]-'0';
				}
				else
				{
					b[i]=temp/13+'0';
					temp=temp%13;
				}
			}
		}
		else 
		{
			temp=100*(a[0]-'0')+10*(a[1]-'0')+a[2]-'0';
			for(i=0;i<lengtha-2;i++)
			{
				if(i!=lengtha-3)
				{
					b[i]=temp/13+'0';
					temp=10*(temp%13)+a[i+3]-'0';
				}
				else
				{
				b[i]=temp/13+'0';
				temp=temp%13;
				}
			}
		}
	printf("%s\n",b);
	printf("%d",temp);
	}
	else if(lengtha==1)
	{
	printf("0\n");
	printf("%c",a[0]);
	}
	else if(lengtha==2)
	{
		if(10*(a[0]-'0')+a[1]-'0'>=13)
		{
			printf("%d\n",(10*(a[0]-'0')+a[1]-'0')/13);
			printf("%d",(10*(a[0]-'0')+a[1]-'0')%13);
		}
		else
		{
			printf("0\n");
			printf("%d",10*(a[0]-'0')+a[1]-'0');
		}
	}
return 0;
}
main()
{
      char a[100];
      int c=0,l=0,i=0,j=0,d=0;
      int b[100]={0},f[100]={0};
      scanf("%s",a);
      l=strlen(a);
      //printf("%d",l);
      for(i=0;i<l;i++)    b[i]=a[i]-'0';
      //for(i=0;i<l;i++)    printf("%d",b[i]); 
      d=b[0];
      if(l>2)
      {
          for(i=1;i<=l-1;i++)
		  {
		  	  c=b[i];
		  	  d=c+d*10;
		  	  if(d>=13)
		  	  {
		  	  	  f[i-1]=d/13; 
		  	      d=d%13; 
			  } 
			  else    
			  f[i-1]=0;
			  if(i==l-1)    
			  j=d;   
		  }
		  if (f[0]!=0)
          printf("%d",f[0]);
          for (i=1;i<l-1;i++)    
		  printf("%d",f[i]); 
          printf("\n%d",j);    
      }
      else if(l==2)
	  { 
	      c=b[0]*10+b[1];
		  printf("%d\n%d",c/13,c%13); 
	  }
	  else     printf("0\n%d",b[0]);

}
int main ()
{
	char a[1000];
	int result[1000], remainder, x[1000] = {0}, k, b[1000], i;
	cin.getline ( a, 999 );
	memset ( result, 0, sizeof ( result ) );
	memset ( b, 0, sizeof ( b ) );
	for ( i = 0; a[i] != '\0'; i++ )
	{
		x[i] = a[i] - '0';
	}
	if ( i == 1 )
	{
		cout << '0' << endl << x[0];
	}
	else if ( i == 2 && ( 10 * x[0] + x[1] < 13 ) )
	{
		cout << '0' << endl << 10 * x[0] + x[1];
	}
	else
	{
		for ( i = 1; a[i] != '\0'; i++ )
		{
			b[i] = ( 10 * x[i - 1] + x[i] ) / 13;
			x[i] = ( 10 * x[i - 1] + x[i] ) % 13;
			k = i;
		}
		remainder = x[k];
		for ( i = k; i >= 1; i-- )
		{
			if ( b[i] < 10 )
			{
				result[i] = b[i];
			}
			else
			{
				result[i] = b[i] % 10;
				result[i - 1] = result[i - 1] + b[i] / 10;
			}
		}
		if ( result[1] != 0 )
			cout << result[1];
		for ( i = 2; i <= k; i++ )
		{
			cout << result[i];
		}
		cout << endl << remainder;
	}
	return 0;
}
//****************************************
//*??:   ??13     ** 
//*??: ???      		    **
//*???2011  11 08              **
//****************************************
int main()
{
	char number[101];
	int a[101], lenth;
	int b[101] = {0} ;
	int  i , j , s;
	s = 0;
	cin >> number;
	lenth = strlen(number);
	for( i = 0 ; i <= lenth - 1 ; i ++)
		a[i] = number[i] - '0';

	for( i = 0 ; i <= lenth - 1 ; i ++)
	{
		s = s * 10 + (a[i] % 13);
		b[i] = s  / 13 ; 
		s = s % 13;
	}
	for( i = 0 ; i <= lenth - 1 ; i ++)
		if(b[i] != 0 ) break;
    
	if( i >= lenth)
		cout << 0;
    else
	{
		for( j = i ; j <= lenth - 1 ; j ++)
		cout << b[j];
	}
		cout << endl;
		cout << s << endl;
	
		return 0;
}
/*
 * yuesefuwenti.cpp
 *
 *  Created on: 2012-12-8
 *      Author: wenjun
 */
int main ()
{
	char a[110];
	int *p;
	int b[110],x,len;
	while(cin>>a){
		len=strlen(a);
	for(int i=0;i<len;i++)
		b[i]=a[i]-'0';
	//for(int i=0;i<len;i++)
		//	cout<<b[i];
	x=0;
	for(int i=0;i<len;i++)
	{
		b[i]=10*x+b[i];
		x=b[i]%13;
		b[i]=b[i]/13;

	}
	int k=0;
	while(b[k]==0)
		k++;
	if(k==len)  cout<<"0";
	for(int i=k;i<len;i++)
		cout<<b[i];
	cout<<endl;
	cout<<x<<endl;
    }
	return 0;
}
main()
{
int len,i,P=0;
int panel=0;
char a[100];
int b[100];
int p[100];

scanf("%s",a);
len=strlen(a);

for(i=0;i<=len-1;i++)
                   {
                   b[i]=a[i]-'0';
                   //printf("%d",b[i]);
                   }
for(i=0;i<=len-1;i++)
                   {
                   panel=10*panel+b[i];
                   p[i]=panel/13;
                   if(p[i]!=0)
                   P=1;
                   panel=panel-p[i]*13;
                   if(P==0)
                              continue;
                   else
                       printf("%d",p[i]);
                   }
if(P==0)
printf("0");
printf("\n%d",panel);

}
int main()
{
    int l,i,c;
    char a[200]={'\0'};
    char b[200]={'\0'};
    scanf("%s",a);
    l=strlen(a);
    if(l>=3)
    {
        if(((a[0]-'0')*10+a[1]-'0')>=13)
        {
            b[0]=((a[0]-'0')*10+a[1]-'0')/13+'0';
            c=((a[0]-'0')*10+a[1]-'0')%13;
            for(i=1;i<l-1;i++)
            {
                b[i]=(c*10+a[i+1]-'0')/13+'0';
                c=(c*10+a[i+1]-'0')%13;
            }
        }
        if(((a[0]-'0')*10+a[1]-'0')<13)
        {
            b[0]=((a[0]-'0')*100+(a[1]-'0')*10+a[2]-'0')/13+'0';
            c=((a[0]-'0')*100+(a[1]-'0')*10+a[2]-'0')%13;
            for(i=1;i<l-2;i++)
            {
                b[i]=(c*10+a[i+2]-'0')/13+'0';
                c=(c*10+a[i+2]-'0')%13;
            }
        }
    }
    if(l==2)
    {
        b[0]=((a[0]-'0')*10+a[1]-'0')/13+'0';
        c=((a[0]-'0')*10+a[1]-'0')%13; 
    }
    if(l==1)
    {
        b[0]='0';
        c=a[0]-'0';
    }
    printf("%s\n",b);
    printf("%d",c);
    getchar();
    getchar();
}
int main()
{
	char a[200] = {0}, b[200] = {0}, c[3] = {0};
	int num;
	cin >> a;
	int i, j, k, l = strlen(a), r;
	if (l == 1)
	{
		cout << 0 << endl << a[0];
		return 0;
	}
	for (i = 0; i < l - 1; i++)
	{
		num = 0, r = 0;
		memset(c, 0, sizeof(c[0]) * 3);
		if (i != 0)
			c[0] = a[i - 1];
		else
			c[0] = '0';
		c[1] = a[i];
		c[2] = a[i + 1];
		num = atoi(c);
		b[i + 1] = num / 13 + '0';
		r = num - (b[i + 1] - '0') * 13;
		if (r > 9)
		{
			a[i] = '1';
			a[i + 1] = r % 10 + '0';
		}
		else
		{
			a[i] = '0';
			a[i + 1] = r + '0';
		}
	}
	int p = 0;
	for(i = 1; i < l; i++)
	{
		if (b[i] != '0')
			p = 1;
		if (p == 1)
			cout << b[i];
	}
	if (p == 0)
		cout << 0;
	cout << endl << r;
	return 0;
}
int main()
{
	int a[101],num,i,temp=0;
	char c;
	for(i=0;i<=100;i++)
	{
		scanf("%c",&c);
		if(c=='\n')
		{
			num=i;
			break;
		}
		a[i]=c-'0';
	}
	if(num>2)
	{
		for(i=0;i<num-2;i++)
		{
			temp=a[i]*100+a[i+1]*10+a[i+2];
			printf("%d",temp/13);
			temp=temp%13;
			a[i+1]=(temp-temp%10)/10;
			a[i+2]=temp%10;
		}
		printf("\n%d\n",temp);
	}
	if(num==2)
	{
		temp=10*a[0]+a[1];
		printf("%d\n%d\n",temp/13,temp%13);
	}
	if(num==1)
	{
		printf("0\n%d\n",a[0]);
	}
	return 0;
}
int main()
{
	char a[100];
	int ans[100] = {0};
	cin >> a;
	int t = a[0] - '0', c = 0, d = 0;
	for (int i = 1; a[i] != 0; i++)
	{
		ans[i] = (10 * t + (a[i] - '0')) / 13;
		t = (10 * t + a[i] - '0') % 13;
		c++;
	}
	if (ans[1] == 0 && ans[2] != 0)
	{
		for (int i = 2;i <= c; i++)
		{
			cout << ans[i];
		}
		cout << endl;
	}
	else if (ans[1] == 0 && ans[2] == 0) cout << 0 << endl;
	else 
	{
		for (int i = 1;i <= c; i++)
		{
			cout << ans[i];
		}
		cout << endl;
	}
	cout << t << endl;
	return 0;
}
main()
{
      char a[100];
      int i,count=0,shang[100],yu=0,q=0,h=0,t[100];
      for(i=0;i<100;i++)
      {
                        a[i]='\0';
                        shang[i]=0;
                        t[i]=0;
      }
      scanf("%s",a);
      for(i=0;i<100;i++)
      {
                        if(a[i]=='\0')break;
                        count++;
      }
      for(i=0;i<count;i++)
      {
                             q=(a[i]-'0')+yu*10;
                             shang[i]=q/13;
                             yu=q-13*shang[i];
      }
      if(shang[0]==0)
      {
                     for(i=0;i<100;i++)
                     {
                                    t[i]=shang[i];
                     }
                     for(i=0;i<99;i++)
                     {
                                    shang[i]=t[i+1];
                     }
                     if(shang[0]!=0)
                     {
                                    for(i=0;i<count-1;i++)
                                    {
                                           printf("%d",shang[i]);
                                    }
                     }
                     else
                     {                      
                                            for(i=0;i<100;i++)
                                            {
                                                              t[i]=0;
                                            } 
                                            for(i=0;i<100;i++)
                                            {
                                                              t[i]=shang[i];
                                             }
                                             for(i=0;i<99;i++)
                                             {
                                                              shang[i]=t[i+1];
                                             }
                                             if(shang[0]!=0)
                                             {
                                                            for(i=0;i<count-2;i++)
                                                            {
                                                                   printf("%d",shang[i]);
                                                            }
                                             }
                                             else
                                             printf("0");
                     } 
                                             
      }
      else
      {
          for(i=0;i<count-1;i++)
          {
                                printf("%d",shang[i]);
          }
      }
      printf("\n%d",yu);
      }
main()
{
      char a[101],b[100];
      int c,d,e,f,l,i,j,x,y,z,m,n;
      
      scanf("%s",a);
      l=strlen(a);
      if(l==1)
      {y=a[0]-'0';
      printf("0\n%d",y);}
      else if(l==2)
      {y=(a[0]-'0')*10+a[1]-'0';
      m=y/13;
      n=y%13;
      if (n>=10)
     { n=n-10;
      printf("%c\n1%c",m+'0',n+'0');}
      else
      printf("%c\n%c",m+'0',n+'0');}
      else
      
      
      {
      for(i=1,j=0;i<l;i++,j++)
       {
                      c=(a[i-1]-'0')*10+(a[i]-'0');
                      b[j]=c/13+'0';
                      d=c%13;
                      a[i]=d+'0';
       }
       z=strlen(b);
       
       b[z]='\0';
       if(b[z-1]<'0' || b[z-1]>'9')
       {b[z-1]='\0';
       b[z+1]='\0';}
       if(b[z-2]<'0' || b[z-2]>'9')
       b[z-2]='\0';
       if(b[0]=='0')
       {for(i=0;i<l;i++)
       b[i]=b[i+1];}
       
       printf("%s\n%d\n",b,d);}
       
       
       getchar();
       getchar();
}
int main()
{
    char shuru[1000];
    char shuchu[1000];
    scanf("%s",shuru);
    int i,length,yushu;
    int a[1000][2];
    int shang[1000];
    length=strlen(shuru);
    
    for(i=0;i<length;i++)
    {
        a[i][0]=shuru[i]-'0';                     
    }
    yushu=0;
    int yushu2;
    for(i=0;i<length;i++)
    {
       yushu=yushu*10+a[i][0];                  
       if(yushu>=13)
       {
          yushu2=yushu;
          yushu=yushu%13;
          shang[i]=yushu2/13;      
       }
       else
       {
          shang[i]=0;    
          yushu=yushu;
       } 
    }
     
    if(shang[0]==0&&shang[1]!=0)
    {
       for(i=1;i<length;i++)
       {
         shuchu[i-1]=shang[i]+'0';                            
       }
       shuchu[length-1]='\0';
    }
    else if(shang[0]==0&&shang[1]==0)
    {
       for(i=2;i<length;i++)
       {
         shuchu[i-2]=shang[i]+'0';                            
       }
       shuchu[length-2]='\0';
    }
    else
    {
       for(i=0;i<length;i++)
       {
         shuchu[i]=shang[i]+'0';                            
       }
    }
    shuchu[i-1]='\0';
    int t;
    t=a[0][0]*10+a[1][0];
    if(length==1&&a[0][0]==0)
    {
    char c[2];
    c[0]='0';
    
    printf("%s\n",c); 
    printf("0");
    }
    else if(length==1)
    {
    char c[2];
    c[0]='0';
    
    printf("%s\n",c); 
    printf("%d",yushu);
    }
    else if(t<13&&length==2)
    {
    char c[2];
    c[0]='0';
    
    printf("%s\n",c); 
    printf("%d",yushu);
    }
    else
    {
    printf("%s\n",shuchu); 
    printf("%d",yushu);
    }
    getchar();
    getchar();
}
int main()
{
	int a[100]={0},c[100]={0},b,d=0,i=0,j;
	char str[100]={0};
	scanf("%s",str);
	b=strlen(str);
    if(b==1)
    printf("0\n%c",str[0]);
    else
    {
       a[0]=(str[0]-'0')*10+str[1]-'0';
       if(a[0]<13 && b==2)
       printf("%d",0);
       
	   c[0]=a[0]/13;
	   d=a[0]%13;
	   for(i=1;i<=b-2;i++)
       {
	      a[i]=d*10+str[i+1]-'0';
	      c[i]=a[i]/13;
          d=a[i]%13;
   	   }
	   
       if(c[0]!=0)
	     printf("%d",c[0]);
       for(i=1;i<=b-2;i++)
	     printf("%d",c[i]);
       printf("\n");
	   printf("%d",d);
	  
   }
	
}
int main()
{
	int num[105] = {0}, a[105] = {0}, b = 0, sum, i = 0, n;
	char c;
	while ((c = cin.get()) != '\n')
	{
		num[i] = c - '0';
		i++;
	}
	n = i;
	if (n < 3)
	{
		if (n == 1)
		{
			sum = num[0];
		}
		else
		{
			sum = num[0] * 10 + num[1];
		}
		cout << sum / 13 << endl;
		cout << sum % 13 << endl;
	}
	else
	{
		sum = num[0] * 100 + num[1] * 10 + num[2];
		for (int i = 3; i < n; i++)
		{
			a[i-1] = sum / 13;
			sum = sum % 13 * 10 + num[i];
			b = sum % 13;
		}
		a[n-1] = sum / 13;
		for (int i = n - 1; i > 1; i--)
		{
			a[i-1] += a[i] / 10;
			a[i] = a[i] % 10;
		}
		for (int i = 1; i < n; i++)
		{
			if (a[1] == 0 && i == 1)
				continue;
			cout << a[i];
		}
		cout << endl;
		cout << b << endl;
	}

	return 0;
}
//***********************************************
//???:??13                                 *
//??????                                  *
//??11?14?                                  *
//***********************************************
int main()
{
    int a[100],i,r=0,len;
    char c[100];
    cin.getline(c,100);
    len=strlen(c);
    for(i=0;i<len;i++)
    {
        //????????????a[i]?r? 
        a[i]=(c[i]-'0')+r*10;
        r=a[i]%13;
        a[i]/=13;
    }
    //?????????0????i 
    for(i=0;i<len;i++)
    {
        if(a[i]!=0)
        break;
    } 
    //????0.???????0 
    if(i==len)
    {
        cout<<0<<endl;
        cout<<r;
    } 
    else 
    {
        for(;i<len;i++)
            cout<<a[i];
        cout<<endl;
        cout<<r;
    }
    return 0;
}
int main()
{
    char str1[100];
    int n1[100],s[100];
    int i,n,y;
    scanf("%s",&str1);
    n=strlen(str1);
    for(i=0;i<n;i++)
        n1[i]=str1[i]-'0';
    y=n1[0];
    for(i=1;i<n;i++)
    {
        s[i-1]=(y*10+n1[i])/13;
        y=(y*10+n1[i])%13;
    }
    if(n==1) printf("0\n");
    else{
    if(s[0]==0)
        for(i=1;i<n-2;i++)
            printf("%d",s[i]);
    else
        for(i=0;i<n-2;i++)
            printf("%d",s[i]);
    printf("%d\n",s[n-2]);}
    printf("%d\n",y);
    return 0;
}
//****************************************************
//*  ? ? ?: homework.cpp                          *
//*  ?    ?: ???                                *
//*  ????: 2012?11?10?                        *
//*  ????: ??13                                *
//****************************************************



int main()
{
	int a[101] = {0}; //??? 
	int b[101] = {0}; //? 
	int num = 0, h = 0, p, len = 0, i = 0; //len?????? 
	char c;
	while((c = getchar()) != '\n' ) //?? 
	{
		len++;
		a[len] = (int) c - 48;
	}
	while (i <= len - 1 ) //?????? 
	{
		i++;
		num = num * 10 + a[i];  
		h++;
		b[h] = num / 13;
		num = num % 13;
	}
	for (i = 1; i <= h; i++) //??????????? 
		if (b[i] != 0) break;
	p = i; 
	for (i = p; i <= h; i++) cout << b[i];
	if (p > h) cout << 0;
	cout << endl;
	cout << num << endl;
	return 0;
}
int main(void)
{
    int i, j=0 ,k=0 ,n,t=0, ok=0;
    char str[MAX], output[MAX];
    gets(str);
    n = strlen(str);


    while ((k<n))
    {
        t = t*10 + (str[k]-'0');
        k++;
            //printf("%d\n",t);
        if(t>13)
        {
            ok=1;
            // putchar(output[j-1]);
        }
        if(ok)
        {   output[j]=('0'+t/13);
            //printf("%d\n",t/13);
            t = t%13;
            j++;
        }


        //printf("%d\n",(str[n]-'0')*10);

        //printf("%d\n",t);
    }
    output[j]='\0';
    if(ok)
    puts(output);
    else
    printf("0\n");
    printf("%d",t);
    return 0;
}
int main()
{
	char a[max],shang[max];
	int yu,i,j,n;
	gets(a);
	n=strlen(a);
	if(n==1)
	{
		printf("0\n");
		printf("%d",a[0]-'0');
		return 0;
	}
	if(n==2)
	{
		if(((a[0]-'0')*10+a[1]-'0')<13)
		{
			printf("0\n");
			printf("%s",a);
		}
		else
		{
			printf("%d\n",((a[0]-'0')*10+a[1]-'0')/13);
			printf("%d",((a[0]-'0')*10+a[1]-'0')%13);
		}
	}
	else
	{
		yu=(a[0]-'0')*10+a[1]-'0';
		if(yu<13)
		{
		    yu=yu*10+a[2]-'0';
		    shang[0]=yu/13;
		    yu=yu%13;
		for(i=3;i<n;i++)
		{
            yu=yu*10+a[i]-'0';
			shang[i-2]=yu/13;
			yu=yu%13;  
        }
        for(i=0;i<n-2;i++)
        printf("%d",shang[i]);
        printf("\n");
        printf("%d",yu);
        }
		if(yu==13)
		{
			shang[0]=1;
			yu=0;
			for(i=2;i<n;i++)
		{
            yu=yu*10+a[i]-'0'; 
			shang[i-1]=yu/13;
			yu=yu%13;  
        }
        for(i=0;i<n-1;i++)
        printf("%d",shang[i]);
        printf("\n");
        printf("%d",yu);
		}
		if(yu>13)
		{
			shang[0]=yu/13;
			yu=yu%13;
			for(i=2;i<n;i++)
		{
            yu=yu*10+a[i]-'0';
			shang[i-1]=yu/13;
			yu=yu%13;  
        }
        for(i=0;i<n-1;i++)
        printf("%d",shang[i]);
        printf("\n");
        printf("%d",yu);
		}
	}
	return 0;
}
int main()
{
	char a[101];
	int i, j, k;
	int b[101], c[101];
	int lenA, yushu, pro;
	cin.getline(a, 101);
	lenA = strlen(a);
	for (i = 0, j = 1; i <= lenA - 1; i++)
	{
		b[j++] = a[j - 1] - '0';
	}
	if ((lenA == 2 && b[1] * 10 + b[2] <= 12) || lenA == 1)
	{
		if (lenA == 1)
			cout << 0 << endl << b[1] << endl;
		else
			cout << 0 << endl << (b[1] * 10 + b[2]) % 13 << endl;
	}
	else
	{
		if ( b[1] * 10 + b[2] >= 13)
		{
			yushu = (b[1] * 10 + b[2]) % 13;
			c[2] = (b[1] * 10 + b[2] - yushu) / 13;
			for (i = 3; i <= lenA; i++)
			{
				pro = yushu * 10 +b[i];
				yushu = pro % 13;
				c[i] = (pro - yushu) / 13;
			}
			for (k = 2; k <= lenA; k++)
			{
				cout << c[k];
			}
			cout << endl;
		}	
		else
		{
			yushu = (b[1] * 100 + b[2] * 10 + b[3]) % 13;
			c[3] = (b[1] * 100 + b[2] * 10 + b[3] - yushu) / 13;
			for (i = 4; i <= lenA; i++)
			{
				pro = yushu * 10 +b[i];
				yushu = pro % 13;
				c[i] = (pro - yushu) / 13;
			}
			for (k = 3; k <= lenA; k++)
			{
				cout << c[k];
			}
			cout << endl;
		}
		cout << yushu << endl;
	}
	return 0;
}
int main ()
{
	char ch[100] = {0};
	char shang[100] = {0};
	cin >> ch;
	int now = 0;
	for ( int i = 0, j = 0; i < strlen(ch); i ++, j ++ )
	{
		now = now * 10 + ch[i] - '0';
		if ( j == 0 && now/13 == 0 ) j--;
		else shang[j] = now/13 + '0';
		now = now%13;
	}
	if ( shang[0] == 0 ) cout << "0" << endl;
	else cout << shang << endl;
	cout << now;
	return 0;
}
int main()
{
    int i,j,k=0,l,b[1000],d[1000],e[1000],m,n;
    char a[1000],c[1000];
    scanf("%s",a);
    l=strlen(a);
    if(l==1)
    printf("%d\n%d",0,a[0]-'0');
    else if(l==2)
    {
         m=a[0]-'0';
         n=a[1]-'0';
         if(m*10+n<13)
         printf("%d\n%d",0,m*10+n);
         else
         printf("%d\n%d",(m*10+n)/13,(m*10+n)%13);
    }
    else
    {
    for(i=0;i<l;i++)
    {
                    e[i]=a[i]-'0';
    }
    if(e[0]*10+e[1]<13)
    {
                       b[k]=(e[0]*100+e[1]*10+e[2])/13;
                       d[k]=(e[0]*100+e[1]*10+e[2])%13;
                       for(i=3;i<l;i++)
                       {
                                       b[k+1]=(d[k]*10+e[i])/13;
                                       d[k+1]=(d[k]*10+e[i])%13;
                                       k=k+1;  
                       }
                       for(j=0;j<=k;j++)
                       {
                                        c[j]=b[j]+'0';
                       }
                       c[l-2]='\0';
                       printf("%s\n%d",c,d[k]);
    }
    else
    {
                      b[k]=(e[0]*10+e[1])/13;
                      d[k]=(e[0]*10+e[1])%13;
                      for(i=2;i<l;i++)
                      {
                                       b[k+1]=(d[k]*10+e[i])/13;
                                       d[k+1]=(d[k]*10+e[i])%13;
                                       k=k+1;  
                      }
                      for(j=0;j<=k;j++)
                       {
                                        c[j]=b[j]+'0';
                       }
                       c[l-1]='\0';
                       printf("%s\n%d",c,d[k]);
    }
}
    getchar();
    getchar();
    getchar();
}
int main()
{
char *p;
int *q,d,n,i,r;
p=(char*)malloc(101*sizeof(char));
q=(int*)malloc(101*sizeof(int));
scanf("%s",p);
n=strlen(p);
if(n==1)
{
printf("0\n");
printf("%d",(p[0]-'0'));
}
else if(n==2&&(((p[0]-'0')*10+p[1]-'0')<13))
{
	printf("0\n");
	printf("%d",((p[0]-'0')*10+p[1]-'0'));
}
else
{
for(i=0,d=((p[0]-'0')*10+p[1]-'0');i<n-2;i++)
{
if(d<13)
{
q[i]=0;
d=(d*10+p[i+2]-'0');
}
else
{
q[i]=d/13;
d=((d-q[i]*13)*10+p[i+2]-'0');
}
}
if(d<13)
{
q[n-2]=0;
r=d;
}
else
{
q[n-2]=d/13;
r=(d-q[n-2]*13);
}
if(q[0]==0)
for(i=1;i<=(n-2);i++)
printf("%d",q[i]);
else
for(i=0;i<=(n-2);i++)
printf("%d",q[i]);
printf("\n");
printf("%d",r);
}
return(0);
}
main()
{
      char a[100];
      int len,i,num[100]={0},t,r;
      scanf("%s",&a);
      len=strlen(a);
      for(i=0;i<len;i++)
               num[i]=a[i]-'0';
      if(num[0]*10+num[1]<13&&len==2)
          printf("%d\n%d",0,num[0]*10+num[1]);
          else if(len==1)
                printf("%d\n%d",0,num[0]);
                else
                
     {      if(num[0]*10+num[1]<13)
               r=num[0]*10+num[1];
           else
              {
                r=(num[0]*10+num[1])%13   ;  
                printf("%d",(num[0]*10+num[1])/13);
              }
      for(i=2;i<len;i++)
         {
            t=(r*10+num[i])/13;
            r=(r*10+num[i])%13;
            printf("%d",t);
         }
      printf("\n");
      printf("%d",r);
      }
}
int main()
{
	int i,j,m,n,a[500];
	char str[100];
	gets(str);
	if(strlen(str)==2&&(str[0]-48)*10+(str[1]-48)<13||strlen(str)==1)printf("0\n%s",str);
	else{
	m=str[0]-48;
	for(i=1;i<strlen(str);i++)
	{
		a[i]=(str[i]-48+10*m)/13;
		m=(str[i]-48+10*m)%13;
	

	}
	i=1;
	while(a[i]==0){
		i++;
	}
	for(;i<strlen(str);i++)
	{
		printf("%d",a[i]);

	}
	

	printf("\n");
	printf("%d",m);
	}


	return 0;
}
int main()
{
	char a[100]={'\0'};
	int b[100],c[100];
	int i,k,p;
	for(i=0;i<100;i++) c[i]=11;
	cin>>a;
	k=strlen(a);
	for(i=0;i<k;i++)
	{
		a[i]=a[i]-48;
		b[i]=a[i];
	}
	if ((k<=2)&&(10*b[0]+b[1])<13) cout<<"0";
	for(i=0;i<k;i=i+1)
	{
			c[i]=(10*b[i]+b[i+1])/13;
			b[i+1]=(10*b[i]+b[i+1])%13;

	}
	for(p=0;c[p]==0;p++);
		while((c[p]>=0)&&(c[p]<10))
		{
			cout<<c[p];
			p++;
		}
		cout<<endl<<b[k-1];
		return 0;
}
int strchange(char s[],int n[])
{
      int i;
      for(i=0;i<strlen(s);i++) n[i]=s[i]-'0';
      return(strlen(s));
}
main ()
{
     int a[101],b[101],c[101],i,j,n,yushu,wei,x,y;
     char s[101];
     for(i=0;i<101;i++) {a[i]=0;b[i]=0;c[i]=0;s[i]='\0';}
     scanf("%s",s);
     n=strchange(s,a);
     if(n==1) printf("%d\n%d",0,a[0]);
     else if(n==2 && a[0]*10+a[1]<13) printf("%d\n%d%d",0,a[0],a[1]);
     else
     {
         x=a[0];y=a[1];
     for(i=0;i<n-1;i++)
     {
          b[i]=(a[i]*10+a[i+1])/13;
          yushu=(a[i]*10+a[i+1])%13;
          a[i+1]=yushu;
     }
     if((x*10+y)>=13) for(i=0;i<n-1;i++) printf("%d",b[i]);
     else for(i=1;i<n-1;i++) printf("%d",b[i]);
     printf("\n%d",yushu);
     }
}