semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main(){
	char N[101],s[100];
	int i,p;
	int j=0,ys=0;
	scanf("%s",N);

	if(strlen(N)==1){
		printf("0\n%s",N);
		return 0;
	}
	

	for(i=0;i<strlen(N)-1;i++){
		if(i==0){
			p=(N[i]-'0')*10+N[i+1]-'0';
		}
		else{
			p=ys*10+N[i+1]-'0';
		}
		ys=p%13;		
		if(i==0&&p/13==0){
			continue;			
		}
		s[j]=p/13+'0';		
		j++;
	}
	s[j]='\0';
	if(j==0){
		s[0]='0';
		s[1]='\0';
	}
	printf("%s\n%d",s,ys);
	return 0;
}
int main()
{
	char N[101];
	int e=1,len,i,j,n[100],shan[100];
	scanf("%s",&N);
	len=strlen(N);
	
	
	for(i=0;i<len;i++)
	{
		n[i]=N[i]-'0';
	}
	if((n[0]*10+n[1])<13)
	{
		e=2;
	}
	for(i=1;i<len;i++)
	{
		if((n[i-1]*10+n[i])/13>0)
		{
			shan[i]=(n[i-1]*10+n[i])/13;
			n[i]=(n[i-1]*10+n[i])%13;
		}
		else 
		{
			for(j=0;;j++)
			{
				if((n[i-1]*10+n[i])/13==0)
				{
					n[i]=n[i-1]*10+n[i];
					shan[i]=0;
			        i++;
				}
				else
				{
					break;
				}
			}
				shan[i]=(n[i-1]*10+n[i])/13;
			    n[i]=(n[i-1]*10+n[i])%13;
		}
	}
	for(i=e;i<len-1;i++)
	{
		printf("%d",shan[i]);
	}
	printf("%d\n",shan[len-1]);
	printf("%d",n[len-1]);
	return 0;
}
int main()
{
   char c[110]={'\0'},s[110]={'\0'},p;
   int y=0,i,j,b;
   cin>>c;
   int z=(c[0]-'0')*10+c[0+1]-'0';
   if(strlen(c)<2)
      cout<<'0'<<endl<<c<<endl;
   else if(strlen(c)==2)
   {
      cout<<atoi(c)/13<<endl<<atoi(c)%13<<endl;     
   } 
   else
   {
       for(i=0;i<strlen(c)-2;i++)
       {
          b=(c[i]-'0')*10+c[i+1]-'0';//??????13 
          if(b>=13)
          {
             s[i]='0'+b/13; 
             c[i+1]='0'+b%13;                                
          }
          else//??13 
          {
             b=(c[i]-'0')*100+(c[i+1]-'0')*10+(c[i+2]-'0');
             s[i+1]='0'+b/13;
             c[i+1]='0'+b%13/10;
             c[i+2]='0'+b%13%10;    
          }                       
       }
       y=c[strlen(c)-1]-'0'; 
       int r;
       if(z>=13)r=strlen(c)-1;
       else r=strlen(c)-2;//???? 
       for(i=0;i<100;i++)
          if(s[i]!='\0')
          {
             
             for(int k=i+1;k<r;k++)
                if(s[k]=='\0')
                   s[k]='0';
             break;
          }
          for(i=0;i<100;i++)
             for(j=0;j<100;j++)
                if(s[j]=='\0')
                {
                   p=s[j];
                   s[j]=s[j+1];
                   s[j+1]=p;              
                }
          for(i=0;i<r;i++)cout<<s[i];
       cout<<endl<<y<<endl;
   }
   return 0;
}
main()
{
    char num[110];
    char shang[110];
    int yushu,i,d,m,n;
    gets(num);
    d=strlen(num);
    yushu=num[0]-'0';
    if(d==1)
    {
        m=num[0]-'0';
        shang[0]=m/13+'0';
        shang[1]='\0';
        yushu=m;
    }
    if(d==2)
    {
        m=(num[0]-'0')*10+num[1]-'0';
        shang[0]=m/13+'0';
        shang[1]='\0';
        yushu=m%13;
    }
    if(d>=3)
    {
        m=yushu*10+num[1]-'0';
        if(m>=13)
        {
        for(i=1;i<=d-1;i++)
        {
            m=yushu*10+num[i]-'0';
            yushu=m%13;
            shang[i-1]=m/13+'0';
        }
        shang[d-1]='\0';
        }
        else
        {
            yushu=yushu*10+num[1]-'0';
            for(i=2;i<=d-1;i++)
            {
                m=yushu*10+num[i]-'0';
                yushu=m%13;
                shang[i-2]=m/13+'0';
            }
            shang[d-2]='\0';
        }
    }

    puts(shang);
    printf("%d",yushu);
    getchar();  getchar();  getchar();  getchar();  getchar();
}
main()
{
      int a[102],p[102],t,i,j,s,q;
      char str[102];
      scanf("%s",&str);
      t=strlen(str);
      for (i=0;i<t;i++)
        {
            a[i]=0;
            p[i]=0;
        }
      for (i=0;i<t;i++)
        {
            a[i]=str[i]-'0';
        }
      s=a[0];
      if(str[1]!='\0'&&!(str[2]=='\0'&&str[0]=='1'&&str[1]<'3'))
       {for (j=0;j<t-1;j++)
        {  s=s*10+a[j+1];
           q=s%13;
           p[j]=(s-q)/13;
           s=q; 
        }
       if(p[0]==0)
       {for(j=1;j<t-1;j++)
         {printf("%d",p[j]);}
       }
       else
       {for(j=0;j<t-1;j++)
         {printf("%d",p[j]);}
       }
       printf("\n");
       printf("%d",q);
       }
      else 
        {printf("0\n");
        printf("%s",str);}
}
main()
{   char  a[101];
   
    char  c[103];
    int i,j,k,l,m,n,len,mod;
   
    k=0;
    for ( j=0;j<103;j++)
    {c[j]='0';}
   
    scanf("%s",a);
    len=strlen(a);
    if(len==1)
    {printf("0\n%d",(a[0]-48)%10);}
    else if(len==2&&(a[0]==49)&&(a[1]-48)<=2)
    {printf("0\n%d",(a[1]-38));}
    else
    {mod=a[0]-48;
         for(i=1;i<len;i++)
    {c[k]=(10*(mod)+a[i]-48)/13+'0';
         mod=(10*(mod)+a[i]-48)%13;
         k++;}
         
         
         
         if(c[0]!=48){for(l=0;l<k;l++)
         {printf("%c",c[l]);}
         printf("\n%d",mod);}
         if(c[0]==48)
         {for(l=1;l<k;l++)
         {printf("%c",c[l]);}
         printf("\n%d",mod);}
    
    }
  



   }
/*
?????13
?????? 1100012895
???2011-11-2
**/


int main()
{
	char num[100]; // ???????????
	int result[100]; // ????????
	
	// ???????
	memset(num,'0',100);
	memset(result,0,100);
	
	int yushu = 0, len, i = 0, j = 0; // yushu??????????,len???????,i?j?????
	
	cin.getline(num,100);
	len = strlen(num);
	
	// ?????????,?????,?????????
	if (len == 1)
	{
		cout << 0 << endl;
		cout << num[0] << endl;
	}
	
	else
	{
		
		yushu = num[0] - '0';
		
		for (i = 0; i <= len - 2; i++)
		{
			result[i] = (yushu * 10 + num[i + 1] - '0') / 13;
			yushu = (yushu * 10 + num[i + 1] - '0') % 13;
		}
		
		if ((result[0] == 0) && len > 2)
			j = 1;
		
		for (j; j < i; j++)
			cout << result[j];
		cout << endl;
		cout << yushu << endl;
	}
	
	return 0;
}
void main()
{
	char n[101];
	char m[101];
	int i,c=0,l,t=0,k=0;
	scanf("%s",n);
	l=strlen(n);
	for(i=0;i<l;i++)
	{
		m[i]=(c*10+n[i]-'0')/13+'0';
		c=(c*10+n[i]-'0')%13;
	}
	for(i=0;i<l-1;i++)
	{
		if(m[i]!='0')
		{
			t = i;
			break;
		}
		else
			t=l-1;
	}
	for(i=t;i<l;i++)
	{
		printf("%c",m[i]);
	}
	printf("\n%d\n",c);
}
main()
{
    int i,l;
    int a[maxl+1]={0},ans[maxl+1]={0};
    char s[maxl+1];
    scanf("%s",s);
    for (i=0;s[i]!='\0';i++)
        a[i]=s[i]-'0';
    l=i;
    for (i=0;i<=l-1;i++)
    {
        a[i+1]=(a[i]%b)*10+a[i+1];
        ans[i]=a[i]/b;
    }
    i=0;
    while ((ans[i]==0)&&(i<=l-1))
    i++;
    if (i==l) printf("0");
    else
    for (;i<=l-1;i++)
      printf("%d",ans[i]);
    printf("\n");
    printf("%d\n",a[l]/10);
}
int main()
{
	char z[101],x[101];
	int a[101],b,c,d,len;
	gets(z);
	len=strlen(z);
    for(b=0;b<=len-1;b++)
	{
		a[b]=z[b]-48;		
	}
	if((len==1)&&(a[0]==8))
	{
		printf("0\n");
		printf("8");
		return 0;
	}
	if((len==2)&&(a[0]==1)&&(a[1]==2))
	{
		printf("0\n");
		printf("12");
		return 0;
	}
	if((a[0]==1)&&(a[1]<3))
	{
		c=a[0]*100+a[1]*10+a[2];
		for(b=2;b<=len-1;b++)
		{
			x[b-2]=c/13+48;
			c=c%13;
			if(b!=len-1)
			{
				c=c*10;
				c+=a[b+1];
			}
		}
		for(b=0;b<=len-3;b++)
		{
			printf("%c",x[b]);
		}
	    printf("\n%d",c);
	}
	else
	{
		c=a[0]*10+a[1];
		//printf("%d",c);
		d=0;
        for(b=1;b<=len-1;b++)
		{
			//printf("%d",c/13);
			if(b==1)
			{
            x[b-1]=c/13+48;
			}
			else x[b-1]=d/13+48;
			if(b==1)
			d=c%13;
			else d=d%13;
			if(b!=len-1)
			{
			    d=d*10;
			    d+=a[b+1];
			}
		}
		for(b=0;b<=len-2;b++)
		{
			printf("%c",x[b]);
		}
	    printf("\n%d",d);
	}
	
	return 0;
}
int main()
{
    char str1[1000];
    int str2[1000]={0};
    int m,n,i,no,a,c;
    no=1;
    scanf("%s",str1);
    a=str1[0]-48;
    if(a<10&&str1[1]=='\0')printf("%c\n%d",'0',a);
    else
    {
     for(i=0;;i++)
     {
                          m=(str1[i]-48)*10+(str1[i+1]-48);
                          str2[i]=m/13;
                          str1[i+1]=m%13+48;
                          if(str1[i+2]=='\0') break;
     }
     c=str1[i+1]-'0';
     n=i+1;
     for(i=0;i<n;i++)
     {
                    if(no==1)
                          {
                                   if(str2[i]==0&&str2[i+1]!=0) continue;
                                   else if(str2[i]==0&&str2[i+1]==0) printf("%d",str2[i]);
                                   else printf("%d",str2[i]);
                                   no=0;
                          }
                    else printf("%d",str2[i]);
     }
     printf("\n");
     printf("%d",c);
    }
    return 0;
}
int main()
{
    char a[100],d[100];
    int  b[100],c[99],m,i,k;
    gets(a); 
    m=strlen(a);
    for (i=0;i<m;i++)
    b[i]=a[i]-'0';
    if(m==1) printf("0");
    if(m==2&&b[0]<2&&b[1]<3)  printf("0"); 
    for(i=0;i<m-1;i++)
    {
                     c[i]=(b[i]*10+b[i+1])/13;
                     k=(b[i]*10+b[i+1])%13; 
                     b[i+1]=k;
    }
    if(c[0]==0)
    {
               for(k=1;k<m-1;k++)
               printf("%d",c[k]);
    }
    else
    {
        for (k=0;k<m-1;k++)
        printf("%d",c[k]);
    }
    printf("\n");
    printf("%d",b[m-1]);
    getchar();
    getchar(); 
}
//********************************************************
//*  ???:3.cpp                                        *
//*  ??????    1200012948                          *
//*  ????: 2012 11 10                                *
//*  ????:??13                                     *
//********************************************************
//??
int main()
{
	char a[100];
	int c, d, e, f, g, i, flag = 0;
	cin >> a;
	//?ascii?????
	if (a[1] == '\0')
	{
		cout << 0 << endl;
		cout << a[0] - '0' <<endl;
	}
	if (a[1] != '\0')
	{c = a[0] - '0'; d = a[1] - '0';
	for (i = 1; a[i] != '\0'; i++)
	{
		e = c * 10 + d;
		f = e / 13;        //??
		g = e % 13;
		//???????0
		if (flag == 0)
		{
			if (f == 0)
			    flag = 1;
			else
			{
				cout << f;
				flag = 1;
			}

		}
		else
		    cout << f;

		c = g;
		d = a[i + 1] - '0';
	}
	if (a[2] == '\0' && (a[0] - '0') * 10 + a[1] - '0' < 13)
		cout << 0;

	cout << endl;
	cout << g << endl;}
//??
	return 0;
}
int main()
{
    int a[110], b[110], c, i, j, k;
    char st[110];

    memset(a, 0, sizeof(a));
    memset(b, 0, sizeof(b));
    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;
}
main()
{
      int a[102]={0},b[102]={0};
      int n,i,t;
      char s[102]; 
      scanf("%s",s);
      n=strlen(s);
      for(i=0;i<=n-1;i++)
      a[i]=s[i]-'0';
      t=0;
      for(i=0;i<=n-1;i++)
      {
          b[i]=(10*t+a[i])/13;
          t=(10*t+a[i])%13;
      }
      if(b[0]==0&&b[1]==0&&b[2]==0)
      {
          if(n==1)
          printf("0\n%d",a[0]);
          else
          printf("0\n%d",10*a[0]+a[1]);
      }
      else
      {
      if(b[1]==0)
      {
          for(i=2;i<=n-1;i++)
          printf("%d",b[i]);
      }
      else
      {
          for(i=1;i<=n-1;i++)
          printf("%d",b[i]);
      }
      printf("\n%d",t);
      }
      }
void main()
{
    char a[100];
	int i,s,k;
	gets(a);
	int b[100],c[100];
	int n=strlen(a);
	for(i=0;i<n;i++)
	{
		b[i]=a[i]-'0';
	}
	if(n==1)
	{
        printf("0\n");
		printf("%d\n",b[0]);
	}
	else if(n==2)
	{
		if((b[0]*10+b[1])>=13)
		{
            k=(b[0]*10+b[1])/13;
			s=b[0]*10+b[1]-13*k;
			printf("%d\n%d\n",k,s);
		}
		else
		{
			k=0;
			s=b[0]*10+b[1];
			printf("%d\n%d\n",k,s);
        } 
	}
	else if(n>=3)
    {
	if(10*b[0]+b[1]>=13)
    {
	    c[0]=(10*b[0]+b[1])/13;
	    s=10*b[0]+b[1]-13*c[0];
	    printf("%d",c[0]);
		for(i=1;i<n-1;i++)
		{
		    if((s*10+b[i+1])<13)
			{
			    
				    c[i]=0;
			        s=s*10+b[i+1];
			}
		    else
			{
				c[i]=(s*10+b[i+1])/13;
				s=s*10+b[i+1]-13*c[i];
			}

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

int num(char c)
{
	int y;
	y=c-'0';
	return y;
}
int main()
{
	char a[100];
	int b[100],c=0,i,n;
	for(i=0;i<100;i++)
	{
		a[i] = '\0';
		b[i] = 0;
	}
	scanf("%s",a);
	n = strlen(a);
	for(i=0;a[i]!='\0';i++)
	{
		if((c*10+a[i]-'0')>=13)
		{
			b[i] = ((c*10+a[i]-'0')-((c*10+a[i]-'0')%13))/13;
			c = (c*10+a[i]-'0')%13;
		}
		else 
		{
			b[i] = 0;
			c =  (c*10+a[i]-'0')%13;
		}
	}
	if(b[1]==0&&b[2]==0)
		printf("0");
	else if(b[1]==0&&b[2]!=0)
		for(i=2;i<n;i++)
			printf("%d",b[i]);
	else
		for(i=1;i<n;i++)
			printf("%d",b[i]);
	printf("\n");
	printf("%d\n",c);
return 0;
}
int main()
{
    char a[100];
    int b[100];
    scanf("%s",a);
    int l,t,i;
    l=strlen(a);
    for (i=0;i<l;i++)
         a[i]=a[i]-'0';
    if (l==1)
       printf ("0\n%d",a[0]);
    else if   ( l==2&&a[0]==1&&a[1]<3)
       printf("0\n%d%d",a[0],a[1]);
    else{ 
    if (a[0]==1&&a[1]<3)
         {
             t=a[0]*10+a[1];
             for (i=1;i<l-1;i++)
             {
                t=t*10+a[i+1];
                b[i-1]=t/13;
                t=t%13;
                }   
             for (i=0;i<l-2;i++)
               printf("%d",b[i]);
             printf("\n%d",t);      
         }
    else 
         {
             t=a[0];
             for (i=0;i<l-1;i++)
             {
                 t=t*10+a[i+1];
                 b[i]=t/13;
                 t=t%13;
             }
             for (i=0;i<l-1;i++)
                printf("%d",b[i]);
             printf("\n%d",t);   
         }
         }
}
int main()
{
	char t;
	int in[100],i=0,an[100];
	t=getchar();
	while(t!=10)
	{
		in[i]=t-'0';
		i++;
		t=getchar();
	}
	int j=2,n=0,temp=in[0];
	if(i!=1)
	{
		temp=10*temp+in[1];
		if(temp>=13)
		{
			an[0]=temp/13;
			temp=temp%13;
			n++;
		}
		while(j!=i)
		{
			temp=10*temp+in[j];
			an[n]=temp/13;
			temp=temp%13;
			n++;j++;
		}
		if(!n)cout<<'0';
		for(int k=0;k<n;k++)cout<<an[k];
		cout<<endl;
		cout<<temp;
	}
	else cout<<"0\n"<<in[0];
	return 0;
}
//***********************
//?????13
//?????? 1200012914
//???2012.11.11
//*********************** 


int main()
{
    char numerator[101], quotient[101]; //???????????\0 
    int remainder = 0; //remainder??13???????
    int i; //i????
    cin >> numerator; //????? 
    for (i = 0; numerator[i] != '\0'; i++) //???????????
    {
        quotient[i] = (remainder * 10 + (numerator[i] - '0')) / 13 + '0';
        //???i?=??????????i????10????13??
        //???????? 
        remainder = (remainder * 10 + (numerator[i] - '0')) % 13; 
        //??=??10????13??
    }
    quotient[i] = '\0'; //????quotient??? 
    i = 0; //?????????
    while (quotient[i] == '0') i++; //?????????
    if (quotient[i] == '\0') cout << "0"; 
    //???????13????????0?????0
    else 
    do 
    {
          cout << quotient[i];
          i++;
    } while (quotient[i] != '\0');
    //???????????????????????? 
    cout << endl << remainder << endl; //?????????????? 

    return 0;
}
int main()
{
	int i=2,t,w=0;
	char str[101];
	char ans[100];
	str[0] = '0';
	cin>>(str+1);
	if(str[2]==0||((str[1]-'0')*10+str[2]-'0'<13&&str[3]==0))
	{
		cout<<"0"<<endl;
		cout<<(str+1)<<endl;
	}else{
	if((str[1]-'0')*10+str[2]-'0'<13)
		i = 3;
	while(str[i]!=0)
	{
		ans[w]='0';
		t = (str[i-2]-'0')*100+(str[i-1]-'0')*10+str[i]-'0';
		while(t>=13)
		{
			t -= 13;
			str[i-2] = t/100 + '0';
			str[i-1] = t/10 + '0';
			str[i] = t%10 + '0';
			ans[w]++;
		}
		w++;
		i++;
	}
	ans[w]=0;
	cout<<ans<<endl;
	if(str[i-2]!='0')
		cout<<str[i-2];
	cout<<str[i-1]<<endl;
	}
	return 0;
}
int main()
{
	int i = 0, j, k, count = 0, product[100] = {0}, remainder, numerator, left = 0;
	char num[100] = {0};
	do
	{
		cin.get(num[i]);
		i++;
	}
	while(num[i - 1] != '\n');
	for (j = i - 2; j >= 0; j -= 6)
		count += (num[j] - 48);
	for (j = i - 3; j >= 0; j -= 6)
		count += (num[j] - 48) * 10;
	for (j = i - 4; j >= 0; j -= 6)
		count += (num[j] - 48) * 100;
	for (j = i - 5; j >= 0; j -= 6)
		count -= (num[j] - 48);
	for (j = i - 6; j >= 0; j -= 6)
		count -= (num[j] - 48) * 10;
	for (j = i - 7; j >= 0; j -= 6)
		count -= (num[j] - 48) * 100;
	remainder = count % 13;
	numerator = (num[0] - 48) * 10 + (num[1] - 48);
	for (k = 0; k < i - 2; k++)
	{
		product[k] = floor(numerator / 13);
		left = numerator - 13 * product[k];
		numerator = left * 10 + (num[k + 2] - 48);
	}
	if ((product[0] == 0) && (product[1] == 0))
		cout << "0" << endl;
	if (product[0] != 0)
	{
		cout << product[0];
		for (k = 1; k < i - 2; k++)
			cout << product[k];
		cout << endl;
	}
	if ((product[0] == 0) && (product[1] != 0))
	{
		for (k = 1; k < i - 2; k++)
			cout << product[k];
		cout << endl;
	}
	cout << remainder << endl;
	return 0;
}
main()
{
char a[100];
int e;
int n,i,b,k;
scanf("%s",a);
n=strlen(a);
if(n==2)
  {
       k=(a[0]-'0')*10+a[1]-'0';
       e=k/13;b=k%13;
       printf("%d\n%d",e,b);
  }
  else if(n==1)
  {
       e=0;b=a[0]-'0';
       printf("%d\n%d",e,b);
  }
  else
  {
     if((a[0]-'0')*10+(a[1]-'0')<13)
       {
           e=((a[0]-'0')*100+(a[1]-'0')*10+(a[2]-'0'))/13;
            b=((a[0]-'0')*100+(a[1]-'0')*10+(a[2]-'0'))%13;
            printf("%d",e);
         for(i=1;i<n-2;i++)
           {
             e=(b*10+(a[i+2]-'0'))/13;
             b=(b*10+(a[i+2]-'0'))%13;
             printf("%d",e);
           }
           printf("\n%d",b);
        }
     else
       {
           e=((a[0]-'0')*10+(a[1]-'0'))/13;
           b=((a[0]-'0')*10+(a[1]-'0'))%13;
            printf("%d",e);
            for(i=1;i<n-1;i++)
              {
                 e=(b*10+(a[i+1]-'0'))/13;
                 b=(b*10+(a[i+1]-'0'))%13;
                  printf("%d",e);   
              }
               printf("\n%d",b);
        }
  }
getchar();getchar();getchar();getchar();getchar();getchar();
}
const long maxL=100;

char a[maxL+1];

long ans[maxL+1];

main(){
    long i,l,rest;
    scanf("%s",a);
    l=strlen(a);
    rest=0;
    for(i=0;i<l;i++){
	rest=rest*10+a[i]-'0';
	ans[i]=rest/13;
	rest%=13;
    }
    i=0;
    while((ans[i]==0) && (i<l-1))
	i++;
    for(;i<l;i++)
	printf("%ld",ans[i]);
    printf("\n%ld\n",rest);
    return 0;
}
int main()
{
char s[1000];
int a,shang,yu,l,i,j,k;j=0;
scanf("%s",s);
l=strlen(s);
for(j=0;l>9;j++)
{a=0;
for(i=8;i>=0;i--)
{
a+=(s[i]-'0')*(int)pow(10,8-i);
}
shang=a/13;printf("%d",shang);
yu=a%13;
if(yu>=10)
{
s[0]=yu/10+'0';
s[1]=yu%10+'0';
for(k=2;k<=100;k++)
s[k]=s[k+7];
}
else if(yu>0)
{
s[0]=yu+'0';
for(k=1;k<=100;k++)
s[k]=s[k+8];
}
else if(yu==0)
{
for(k=0;k<=100;k++)
s[k]=s[k+9];
}
l=strlen(s);
}
a=0;
for(i=l-1;i>=0;i--)
{
a+=(s[i]-'0')*(int)pow(10,l-1-i);
}
shang=a/13;printf("%d\n",shang);
yu=a%13;
printf("%d",yu);
}
void main()
{
	char a[101];
	char b[101];
	int i,n,m,l;
	gets(a);
	l=strlen(a);
	n=0;
	for(i=0;i<l;i++)
	{
		b[i]=(n*10+a[i]-'0')/13+'0';
		n=(n*10+a[i]-'0')%13;
	}
	if(l==1)
		printf("0");
	else if(l<=2&&((a[0]-'0')*10+a[1]-'0')<=13)
		printf("0");
	else
	{
		if(((a[0]-'0')*10+a[1]-'0')>=13)
		{
			for(i=1;i<l;i++)
				printf("%c",b[i]);
		}
		else
		{
			for(i=2;i<l;i++)
				printf("%c",b[i]);
		}
	}
	printf("\n");
	printf("%d",n);

		
}
main()
{
    char a[1000];
    int b,d,e,f,g,h;
    scanf("%s",a);
    e=strlen(a);
    int i[e],c[e];
    for(g=0;g<e;g++)
    c[g]=0;
    for(g=0;g<e;g++)
    i[g]=a[g]-'0';
    if(e==1)
    printf("%d\n%d",0,i[0]);
    else if(e==2)
    printf("%d\n%d",(i[0]*10+i[1])/13,(i[0]*10+i[1])%13);
    else
    {
    for(b=0,d=0;b<e;b++)
    {
                    if(d*10+i[b]>=13)
                    {
                    c[b]=(d*10+i[b])/13;
                    d=(d*10+i[b])%13;
                    }
                    else
                    {
                    if(b<e-1)
                    {
                    c[b+1]=(d*100+i[b]*10+i[b+1])/13;
                    d=(d*100+i[b]*10+i[b+1])%13;
                    b++;
                    }
                    else
                    {
                    d=d*10+i[b];
                    b++;
                    }
                    }
                    }
    if(c[1]!=0)
    printf("%d",c[1]);
    for(f=2;f<e;f++)
    printf("%d",c[f]);
    printf("\n%d",d);
    }
    }
main()
 {
   char s[100];
     int a[100],i,j,len,c;
     long b;
    scanf("%s",s);
    b=0;
    len=strlen(s);
   for (i=0;i<len;i++)
		{
		if (s[i]=='0')
		  {
		  c=0;
		  }
		else if (s[i]=='1')
		  {
		  c=1;
		  }
		else if (s[i]=='2')
		  {
		  c=2;
		  }
		else if (s[i]=='3')
		  {
		  c=3;
		  }
		else if (s[i]=='4')
		  {
		  c=4;
		  }
	else if (s[i]=='5')
		  {
		  c=5;
		  }
	else if (s[i]=='6')
		  {
		  c=6;
		  }
	else if (s[i]=='7')
		  {
		  c=7;
		  }
	else if (s[i]=='8')
		  {
		  c=8;
		  }
	else if (s[i]=='9')
	      {
	      	c=9;
	      	}
	b=b*10+c;
	a[i]=b/13;
	b=b-a[i]*13;
	 }
	  i=0;
		 do
			{
		      i=i+1;
		      }
		while (a[i]==0);
		 for (j=i;j<len-1;j++)
		   printf("%d",a[j]);
		   printf("%d\n",a[len-1]);
		   printf("%d\n",b);
		   getchar();
		   getchar(); 
		   }
main()
{
      char bei[100]={'\0'},shang[100]={'\0'};
      int i,wei,a;
      scanf("%s",bei);
      for(i=0;;i++)
      {if(bei[i+1]=='\0')
      {wei=i;
      break;}}
      
      if(wei<1)
      {printf("0\n%c\n",bei[0]);}
      
      if(wei>=1)
      {a=10*(bei[0]-'0')+bei[1]-'0';
      shang[0]=a/13+'0';
      for(i=1;i<wei;i++)
      {a=(a%13)*10+bei[i+1]-'0';
       shang[i]=a/13+'0';
       }
       a=a%13;
       
       
       
       if((shang[0]=='0')&&(wei>1))
       {
                  for(i=0;i<=wei-2;i++)
                  shang[i]=shang[i+1];
                  shang[wei-1]='\0';}   
       
       
       printf("%s\n",shang);
       printf("%d\n",a);
       }
   
      }
main()
{
const int last=1000;
char s[1050];
scanf("%s",s);
int num[1050];
int len=strlen(s);
int i;
i=last+1;
for (int j=len-1;j>=0;j--)
{i--;
num[i]=(s[j]-'0');}
int st=i;
num[last+1]=0;
while (i<=last)
{
num[i+1]+=num[i]%13*10;
num[i]=num[i]/13;
i++;
}
while (num[st]==0) st++;
if (st>last) printf("0");
for (i=st;i<=last;i++) 
printf("%c",num[i]+'0');
printf("\n");
printf("%d",num[last+1]/10);
}
int main()
{	char c[200];
	int zs[200],shang[200];
	int i,j,yu=0,flag=0;
	gets(c);
	for(i=strlen(c)-1;i>=0;i--){
		zs[i]=c[i]-'0';
	}
	for(i=0;i<strlen(c);i++){
		shang[i]=(yu*10+zs[i])/13;
		yu=(yu*10+zs[i])%13;
	}
	for(i=0;i<strlen(c);i++){
		if(flag){
			printf("%d",shang[i]);
		}
		if(1-flag){
			if(shang[i]!=0){
				printf("%d",shang[i]);
				flag=1;
			}
		}
	}
         if(flag==0){
		printf("0");
	}
	printf("\n");
	printf("%d",yu);
	return 0;
}