semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
    char digit[100],result[100];
	gets(digit);
	int i,a,n,c,s;
	n=strlen(digit);
	for(i=0;i<n;i++)
	{
		if(i==0) a=digit[i]-'0';  
		else a=c*10+digit[i]-'0';
		result[i]=a/13+'0';
		c=a%13;
	}
	if((result[0]=='0' && n==1)||(result[1]=='0' && n==2))
		printf("0\n");
	else
	{for(i=0;i<3;i++)
	{
		if(result[i]!='0') {s=i;break;}
	}
	for(i=s;i<n;i++)
		printf("%c",result[i]);
	printf("\n");}
	printf("%d",c);
	return 0;
}
int main()
{
	char s[100];
	int a[100]={0},i,len,count=0,num=1;
	gets(s);
	len=strlen(s);
	if(len==1)
	{printf("0\n%d",s[0]-48);}
	else if(len==2&&(s[0]-48)*10+(s[1]-48)<13)
		printf("0\n%d",(s[0]-48)*10+s[1]-48);
	else
	{for(i=0;i<len;i++)
		s[i]=s[i]-48;
	if(s[0]*10+s[1]>=13)
	{for(i=0;i<len&&count<len-1;i++)
	{a[count]=(s[i]*10+s[i+1])/13;
	s[i+1]=(s[i]*10+s[i+1])%13;
	count++;
	}
     for(i=0;i<count;i++)
		printf("%d",a[i]);
	 printf("\n%d",s[i+1]);
	}
	else 
	{a[0]=(s[0]*100+s[1]*10+s[2])/13;
	s[2]=(s[0]*100+s[1]*10+s[2])%13;
     for(i=2;i<len&&num<(len-2);i++)
	{a[num]=(s[i]*10+s[i+1])/13;
	s[i+1]=(s[i]*10+s[i+1])%13;
	num++;
	 }
	for(i=0;i<num;i++)
		printf("%d",a[i]);
	printf("\n%d",s[i+1]);
	}
	}
	return 0;
}
int main()
{
char str[101];
int answer[101];
memset(answer,0,sizeof(answer));
int p,q,flag=0,j,i,k;
cin>>str;
//cout<<str<<endl;
i=0;
for(j=0;j<strlen(str);j++)
   {
    //cout<<str<<"]]]]]]"<<endl;
   p=0;
   for(k=i;p<13;k++)
       {if(k>=strlen(str))
          break;
       p=p*10+str[k]-'0';
	   }
  // cout<<p<<endl;
  // cout<<k-1<<endl;
   j=k-1;
   answer[j]=p/13;
   //cout<<answer[j]<<endl;
   p=p%13;
   q=p;
   for(int k=j;k>=i;k--)
     {
      str[k]=p%10+'0';
	  p=p/10;
	  }
   }
for(i=0;i<j;i++)
   {
   if(answer[i]!=0)
      flag=1;
   if(flag)
     cout<<answer[i];
	 }
if(!flag)
cout<<0;
cout<<endl<<q<<endl;
return 0;
    }
main()
{
    char a[1000];
    int b=0,i=0;
    scanf("%s",a);
    while(a[i]!='\0')
         {
             b=b*10+a[i]-'0';
             a[i]='0'+b/13;
             b=b%13;
             i++; }
    if(a[1]=='\0') printf("0");
    else if(a[1]=='0')
    {
           if(a[2]!='\0') printf("%s",&a[2]);
           else printf("0");
    }
    else printf("%s",&a[1]);
    printf("\n%d",b);
}
int main()
{
	int a[101]={0},q[101]={0},r[101]={0},len,i;
	char b[101];
	gets(b);
	len=strlen(b);
	for(i=0;i<len;i++)
		a[len-i-1]=b[i]-'0';
	for(i=len-1;i>=0;i--)
	{
		a[i]=r[i+1]*10+a[i];
		q[i]=a[i]/13;
		r[i]=a[i]%13;
	}
	i=len;
	while(q[i]==0&&i>0)
		i--;
	for(i=i;i>=0;i--)
		printf("%d",q[i]);
	printf("\n%d",r[0]);
	return 0;
}
int main()
{
	char a[102];
	int b[102],c[102],d[102];
	int e,i,j;
	gets(a);
	e=(int)strlen(a);
	for(i=0;i<e;i++)
	{
		b[i]=a[i]-'0';
	}
	if(e==2&&(b[0]==1&&b[1]<3))
	{
		printf("0\n%d",10*b[0]+b[1]);
	}
	else if(e==1)
	{
		printf("0\n%d",b[0]);
	}
	else{
	c[0]=b[0]*10+b[1];
	for(j=1;j<e;j++)
	{
		c[j]=b[j+1];
	}
	d[0]=c[0]/13;
	c[0]=c[0]%13;
	for(j=0;j<e-1;j++)
	{
		d[j+1]=(10*c[j]+c[j+1])/13;
		c[j+1]=(10*c[j]+c[j+1])%13;
	}
	if(d[0]==0)
	{
		for(j=1;j<e-1;j++)
		{
			printf("%d",d[j]);
		}
	}
	else
	{
		for(j=0;j<e-1;j++)
		{
			printf("%d",d[j]);
		}
	}
	printf("\n");
	printf("%d",c[e-2]);}
	return 0;
}
int main()
{
      char N[100],Result[100];
      int Z[100];
      memset(N,0,sizeof(N));
      memset(Result,0,sizeof(Result));
      memset(Z,0,sizeof(Z));
      scanf("%s",&N);
      int i=0;
      int j=0;
      int k=0;
      int b,c,d;
      int e,g;
      int a=strlen(N);
      g=1;
      if(a==1){
               printf("0\n");
               printf("%d",N[0]-'0');
               }
      else{
           e=N[0]-'0';
           c=N[1]-'0';
           while(g==1){
                       if((e*10+c)<13){
                                       if(a==2){
                                                printf("0\n");
                                                printf("%d",e*10+c);
                                                break;
                                                }
                                       else{
                                            e=e*10+c;
                                            i=1;
                                            }
                                       }
                       while(i<=(a-2)){
                                       b=e;
                                       c=N[i+1]-'0';
                                       d=b*10+c;
                                       Z[j]=d/13;
                                       e=d%13;
                                       i++;
                                       j++;
                                       }
                       if(i==(a-1)){
                                    b=e;
                                    c=N[i+1]-'0';
                                    d=b*10+c;
                                    Z[j]=d/13;
                                    j++;
                                    }
                       while(k<=(j-2)){
                                       Result[k]=Z[k]+'0';
                                       k++;
                                       }
                       printf("%s\n",Result);
                       printf("%d",e);
                       g=0;
                       }
           }
      
      return 0;
}
main()
{
      char a[105];
      scanf("%s",a);
      int c=0,d=0,e,i=0;
      while(a[i]!='\0')
      {
                       e=a[i]-'0';
                       c=d*10+e;
                       d=c%13;
                       a[i]=c/13+'0';
                       i++;
      }
      if(a[1]=='\0') printf("0");
      else if(a[1]=='0') 
      {
           if(a[2]!='\0') printf("%s",&a[2]);
           else printf("0");
      }
      else printf("%s",&a[1]);
      printf("\n");
      printf("%d",d);
}
int main()
{
	char ch[110];
	cin>>ch;
	int shu[110];
	for (int i=0;i<strlen(ch);i++)
		shu[i]=ch[i]-'0';
	if (strlen(ch)<=2 && shu[0]*10+shu[1]<13) 
	{
		cout<<0<<endl;
		if (strlen(ch)==2) cout<<shu[0]<<shu[1]<<endl;
		else cout<<shu[0];
	}
	else 
	{
		int count=2;
		int yushu=(shu[0]*10+shu[1])%13;
		int shang=(shu[0]*10+shu[1])/13;
		if (shang!=0) cout<<shang;
		while (count<strlen(ch))
		{
			cout<<(yushu*10+shu[count])/13;
			yushu=(yushu*10+shu[count])%13;
			count++;
		}
		cout<<endl;
		cout<<yushu;
	}
	return 0;
}
main()
{
     char string[101],a[101];
     int i,l,j;
        scanf("%s",string);
        l=strlen(string);
        if(l==1)
          {       
          printf("0\n");
          printf("%d\n",string[0]-'0');
          }
        else if(l==2)
          {
            if(((string[0]-'0')*10+(string[1]-'0'))<13)
            {
               printf("0\n");
               printf("%d",string[0]-'0');
               printf("%d\n",string[1]-'0');
            }
            else
            {
               printf("%d\n",((string[0]-'0')*10+(string[1]-'0'))/13);
               printf("%d\n",((string[0]-'0')*10+(string[1]-'0'))%13);
            }
          }
        else
     {                                                       
                                        
        if(((string[0]-'0')*10+(string[1]-'0'))<13)
        {    
            a[0]=((string[0]-'0')*100+(string[1]-'0')*10+(string[2]-'0'))/13;
            printf("%d",a[0]);
            string[2]=((string[0]-'0')*100+(string[1]-'0')*10+(string[2]-'0'))%13+'0';
            for(j=2;j<l-1;j++)
            {
               a[j-1]=((string[j]-'0')*10+string[j+1]-'0')/13;
               string[j+1]=((string[j]-'0')*10+(string[j+1]-'0'))%13+'0';
               printf("%d",a[j-1]);
            }
            printf("\n");
            printf("%d\n",(string[l-1]-'0'));   
        }
        else
        {
            for(j=0;j<l-1;j++)
            {
               a[j]=((string[j]-'0')*10+(string[j+1]-'0'))/13;
               string[j+1]=((string[j]-'0')*10+(string[j+1]-'0'))%13+'0';
               printf("%d",a[j]);
            }
            printf("\n");
            printf("%d\n",(string[l-1]-'0'));
        } 
     }
     
     getchar();
     getchar();
}
//****************************************
//*?????13                    **
//*?????? 1100012920              **
//*???2011.11.2                     **
//****************************************
int main()
{
	char num[100], ans[100];
	int n, i, flag = 1, a = 0; 
	cin.get(num, 100);
	n = strlen(num);
	for (i = 0; i < n; i++)
	{
		ans[i] = (a * 10 + (num[i] - '0')) / 13;
		a = (a * 10 + (num[i] - '0')) % 13;
	}
	for (i = 0; i < n; i++)
	{
		if (n != 2)
		{
		   if (n != 1 && flag == 1 && (ans[i] - '0' + 48) == 0)
		    	continue;
		   else if ((ans[i] - '0' + 48) != 0 || flag != 1 || n == 1)
		   {
		    	flag = 0;
			    cout << ans[i] - '0' + 48;
		   }
		}
	}
    if (n == 2)
	{
	   if ( (ans[0] - '0' + 48) != 0)
		   cout << ans[0] - '0' + 48;
	   cout << ans[1] - '0' +48;
	}
	cout << endl << a;
	return 0;
}
/* ???? ??13.cpp
 * ??? 1200012826 ??
 * ??? 2012?11?16?
 */
int main()
{
	int i, r, y, b=0, s[101];
	char a[101];
	cin >> a;
	if(a[1] == '\0')
	{
		cout << 0 << endl;
		cout << a[0] << endl;
	}
	else
	{
	
		r=(a[0]-'0')*10+a[1]-'0';
		for(i=1; a[i] != '\0'; i++)
		{
		
			s[i]=r/13;
			y=r%13;
			b++;
			r=10*(r%13)+a[i+1]-'0';
			if(a[i+1] == '\0')
			{
				break;
			} 
		}
		if(s[1] != 0)
		{
			for(i=1; i <= b; i++)
			{
				cout << s[i];
			}
			cout << endl;
			cout << y << endl;
		}
		else
		{
			if(b == 1)
			{
				cout << 0 << endl;
			}
			else
			{
				for(i=2; i <= b; i++)
				{
					cout << s[i];
				}
				cout << endl;
			}
			cout << y << endl;
		}
		return 0; 
	}
}
main()
{
      int a;
      char b[200];
      int c;
      int h,m;
      char s[200];
      gets(s);
      int l=strlen(s);
      int i,j,k;
      if(l==2)
      {
              c=(s[0]-'0')*10+s[1]-'0';
              h=c/13;
              m=c%13;
              printf("%d\n%d\n",h,m);
      }
      else if(l==1)
      {
           c=s[0]-'0';
           printf("0\n%d",c);
      }
      else if(l>2)
      {
           if((s[0]-'0')*10+s[1]-'0'>=13)
           {
           
          c=s[0]-'0';
           for(i=0;i<l-1;i++)
           {
                           
                            a=c*10+s[i+1]-'0';
                           b[i]=a/13+'0';
                           c=a%13;
                           
                           
           }
                 b[i]='\0';
                 printf("%s\n%d\n",b,c);
           }
           else if((s[0]-'0')*10+s[1]-'0'<13)
           {
                c=(s[0]-'0')*10+(s[1]-'0');
                for(i=0;i<l-2;i++)
                {
                                a=c*10+s[i+2]-'0';
                                b[i]=a/13+'0';
                                
                                c=a%13;
                }
                 b[i]='\0';
                printf("%s\n%d\n",b,c);
           }
      }
      }
int con13(int x,int y)
{
	int n=(10*x+y)/13;
	return(n);
}
int rem13(int x,int y)
{
	int n=(10*x+y)%13;
	return(n);
}
int main()
{
	char c[101],d[101];
	gets(c);
	int i=0;
	while(c[i]!='\0')
	{
	c[i]-='0';
	i++;	
	}
	if(i==1)
	   {
	   printf("%d\n",0);
	   printf("%d",c[0]);
	   } 
	else
	  if(i==2&&c[0]==1&&c[1]<3)
	  {
	  printf("%d\n",0);
	  printf("%d",rem13(c[0],c[1]));
	  }
	else
	{
	int rem=rem13(c[0],c[1]);
	d[0]=con13(c[0],c[1]);
	if(d[0])
	printf("%d",d[0]);
	for(int j=2;j<i;j++)
	{
	d[j-1]=con13(rem,c[j]);	
	rem=rem13(rem,c[j]);
	printf("%d",d[j-1]); 
	}
	printf("\n");
	printf("%d",rem);
    }
}
main()
{
	char a[100];
	char b[100];
	scanf("%s",a);
	int l=strlen(a);
	int m=0;
	int i;
	for(i=0;i<l;i++)
	{	
		b[i]=(10*m+a[i]-'0')/13+'0';
		m=(10*m+a[i]-'0')%13;
	}
	b[i]='\0';
	strcpy(b,b+1);
	if(b[0]=='\0'||b[0]=='0'&&b[1]=='\0')
		printf("0\n%d",m);
	else if(b[0]=='0')
	{
		strcpy(b,b+1);
		printf("%s\n%d",b,m);
	}
	else
		printf("%s\n%d",b,m);

}
char zhengshu[202]={0};
int numout[402]={0},numin1[402]={0},num[202]={0},lenout,len1,len2;
int main()
{
	int i,pd=0,bg,tw=0,nu;
	cin.getline(zhengshu,202);//????????????
	len1=strlen(zhengshu);
	for(i=0;i<len1;i++)numin1[i]=zhengshu[i]-48;
	tw=numin1[0];
	for(i=0;i<len1-1;i++)
	{
		nu=tw*10+numin1[i+1];
		numout[i]=nu/13;
		tw=nu%13;
	}
	bg=!numout[0];
	for (i=bg;i<len1-1;i++)cout<<numout[i];
	if(len1<=2&&numout[0]==0)cout<<0;
	cout<<endl;
	cout<<tw;
	return 0;
}
int main()
{
    int i, j;
    char zheng[100]; 
    int shang[100], yushu;
    cin.getline(zheng, 100);
    int len = strlen(zheng);
    yushu = zheng[0] - '0';
    if (len == 1)
    {
        cout << 0 << endl <<  yushu << endl;
    }
    else
    {
        if (len == 2 && yushu * 10 + zheng[1] - '0' < 13)
        {
            cout << 0 << endl << yushu * 10 + zheng[1] - '0' << endl;
        }
        else
        {
            if (yushu * 10 + zheng[1] - '0' < 13)
            {
                yushu = yushu * 10 + zheng[1] - '0';
                j = 0;
                for (i = 2; i < len; i++)
                {
                     shang[j++] = (yushu * 10 + zheng[i] - '0') / 13;
                     yushu = (yushu * 10 + zheng[i] - '0') % 13;
                }
                for (i = 0; i < j; i++)
                {
                     cout << shang[i];
                }
                cout << endl << yushu;
            }
            else
            {
                j = 0;
                for (i = 1; i < len; i++)
                {
                    shang[j++] = (yushu * 10 + zheng[i] - '0') / 13;
                     yushu = (yushu * 10 + zheng[i] - '0') % 13;
                }
                for (i = 0; i < j; i++)
                {
                     cout << shang[i];
                }
                cout << endl << yushu;
            }
        }
    }
    return 0;
}
int main()
{
    static char n[100];
    int d=0;
    scanf("%s",n);
    int len=strlen(n);
    int a=n[0]-'0',i,b,c;
    if(len==1)
    {
    printf("0\n");
    printf("%c\n",n[0]);
    }
    else{ 
    if(len==2&&(n[0]-'0')==1&&(n[1]-'0')<3)
    {
    printf("0\n");
    printf("%c",n[0]);
    printf("%c",n[1]);
    }
    else{
    for(i=0;i<len-1;i++)
    {
    b=n[i+1]-'0';
    c=a*10+b;
    d=c/13;
    if(i==0&&d==0); 
    else  
    printf("%d",d);
    a=c-d*13;
    } 
    printf("\n");
    printf("%d\n",a);
    }
    }
}
/**********************************************
/* ?  ?: ??13
/* ?  ?: ??????0????N??????100??
/*         ???????13????????????
/* ?  ?: ???  1200012861
/* ?  ?: 2012?11?10?
**********************************************/

int main()
{
	int i = 0, j, k, count = 0, product[100] = {0}, remainder = 0, dividend;
	char num[100] = {0};
	do
	{
		cin.get(num[i]);
		i++;
	}
	while(num[i - 1] != '\n');

	if (i == 2)                                                   //???????,????0???,?????
		cout << "0" << '\n' << num[0] << "\n";
	else
	{
		dividend = (num[0] - 48) * 10 + (num[1] - 48);            //?????,??????????????
		for (k = 0; k < i - 2; k++)	
		{
			product[k] = floor(dividend / 13);                    //??????????
			remainder = dividend - 13 * product[k];               //????????,????????????13???
			dividend = remainder * 10 + (num[k + 2] - 48);        //?????,???????
		}
		if ((product[0] == 0) && (product[1] == 0))               //??????????0,?????0,??0
			cout << "0" << endl;
		if (product[0] != 0)                                      //????????0,??????
		{
		for (k = 0; k < i - 2; k++)
			cout << product[k];
		cout << endl;
		}
		if ((product[0] == 0) && (product[1] != 0))               //????????0,???0,???????????
		{
			for (k = 1; k < i - 2; k++)
				cout << product[k];
			cout << endl;	
		}
		cout << remainder << endl;
	}
	return 0;
}
char divider[101] = {0},answer[100] = {0};
int divide13(int);

int main(){
	int num;char *p;
	cin>>divider;
	num = divide13(strlen(divider));
	for(p = answer;*p == '0';++p);      //????????????
	if(*p)cout<<p<<endl<<num<<endl;
	else cout<<"0\n"<<num<<endl;
	return 0;
}

int divide13(int len){
	int num = 0,pos = 0,ans;
	for(;pos < len;++pos){
		num = 10 * num + divider[pos] - '0';
		if(num < 13){   //??????
			answer[pos] = '0';
		}
		else{
			ans = num/13;
			answer[pos] = '0' + ans;
			num -= 13 * ans;
		}
	}
	return num;
}
main()
{
   char c[100];
   int i,len,flag;
   scanf("%s",c);
   len=strlen(c);
   int a,b;
   b=0;
   if(len==1) printf("0\n%d",c[0]-'0');
   else
   {
	   flag=(c[0]-'0')*10+c[1]-'0';
	   if(len==2&&flag<13)
	   {
	   printf("0\n%d",flag);
	   }
   else
   {
   for(i=0;i<=len-1;i++)
   {
	   a=b*10+c[i]-'0';
	   if(a<13)
	   {
		   c[i]='0';
	       b=a;
	   }
	   else
	   {
	       b=a%13;
	       c[i]=(a-b)/13+'0';
	   }
   }
   if(flag>=13)
   {
	   for(i=1;i<len;i++)
		   printf("%c",c[i]);
	   printf("\n%d",b);
   }
   else
   {
	   for(i=2;i<len;i++)
		   printf("%c",c[i]);
	    printf("\n%d",b);
   }
   printf("\n");
   }
}
}
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; f[i-1]=d/13; 
		  	  if(d>=13)
		  	  {
		  	  	 
		  	      d=d%13; 
			  } 
			  
			  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]);
      
}
const int chushu=13;
int main()
{
char n[101],shang[100];
int a,i;
scanf("%s",n);
if (n[1]=='\0') {printf ("0\n%s",n);}
else if (n[0]=='1' && n[1]<'3' && n[2]=='\0') {printf ("0\n%s",n);}
else
{
  a=n[0]-'0';
  a=a*10+n[1]-'0';
  if(a<13)
  {
  for(i=1;n[i+1]!='\0';i++)
      {
      a=a*10+n[i+1]-'0';
      shang[i-1]=a/chushu+'0';
      a=a%chushu;
      }
  shang[i-1]='\0';
  }
  else
  {
  shang[0]=a/chushu+'0';
  a=a%chushu;
  for(i=1;n[i+1]!='\0';i++)
      {
      a=a*10+n[i+1]-'0';
      shang[i]=a/chushu+'0';
      a=a%chushu;
      }
  shang[i]='\0';
  }
printf("%s\n%d",shang,a);
}
return 0;
}
/*??(12-11) ??13*/ 



int main()
{
	char a[101];
	cin>>a;
	int len;
	len=strlen(a);
	int b[101],i,c[101];
	for(i=1;i<=len;i++) b[i]=a[i-1]-'0';
	int hand=0;
	i=2;
	int num=b[1];
	while(i<=len)//???? 
	{
		num=num*10+b[i];
		hand++;
		c[hand]=num/13;
		num=num%13;
		i++;
	}
	i=1;
	if(hand==0) cout<<"0"<<endl;
	else
	{
		while(c[i]==0 && i<hand) i++;
		for(;i<=hand;i++) cout<<c[i];
		cout<<endl;
	}
	cout<<num<<endl;
	return 0;
}
//****************************************
//*?????13                       **
//*?????? 1100012927              **
//*???2011.11.3                     **
//****************************************
int main()
{
    char a[100];
    int i = 0, r, j = 0, b[100] ={0};
    cin >> a;
    for (r = 0; a[r] != 0; r++)
    {
        b[r] = (i * 10 + a[r] - '0') / 13;     //????????
        i = ((i * 10) + a[r] - '0') % 13;     //???
    }
    
    if (r == 1 || (r == 2 && b[1] == 0)) cout << b[0];
    else
    {
        while (b[j] == 0 ) j++;       //???0??????
        for (; j < r; j++)
            cout << b[j];
    }
    cout << endl;
    cout << i << endl;
	return 0;
}
int main()
{
	int i,n,m,a[100];
	char str[100];
	gets(str);
	n=strlen(str);
	if(n==1)printf("0\n%c",str[0]);
	else if(n==2&&(str[1]-'0'+(str[0]-'0')*10)<13)
	{
		m=str[1]-'0'+(str[0]-'0')*10;
		printf("0\n%d",m);
	}
	else{
	for(i=0;i<n-1;i++)
	{
		m=(str[i]-'0')*10+str[i+1]-'0';
		a[i]=m/13;
		str[i+1]=m%13+'0';
	}
	if(a[0]!=0)printf("%d",a[0]);
	for(i=1;i<n-1;i++)printf("%d",a[i]);
	printf("\n");
	printf("%c",str[n-1]);}
	return 0;
}
main()
{
      int a,b,c,n,m,r,i,j,k;
      char numm[102];
      scanf("%s",numm);
      int LEN=strlen(numm);
      int num[102];
      
      for(i=0;i<LEN;i++)
        num[i]=numm[i]-'0';//printf("%d  ",num[i]);
   if(LEN>2)
    {
      if(num[0]*10+num[1]>=13)
      {
         printf("%d",(num[0]*10+num[1])/13);
         i=2;
         r=(num[0]*10+num[1])%13;
                            
      } 
      else
      {
         i=2;
         r=(num[0]*10+num[1])%13;                          
      }
      while(i<LEN)
      {
         printf("%d",(10*r+num[i])/13);
         r=(10*r+num[i])%13;
         i++;         
      }
      printf("\n%d",r);
    }
 if(LEN==1)   
    {
      printf("%d\n%d",0,num[0]);
    }
 if(LEN==2&&num[0]*10+num[1]>=13)
    {
      printf("%d\n%d",(num[0]*10+num[1])/13,(num[0]*10+num[1])%13);
    }
 if(LEN==2&&num[0]*10+num[1]<13)
    {
      printf("%d\n%d",0,num[0]*10+num[1]);
     } 
 }
int main()
{
	char input[101];
	cin >>input;
	int length=strlen(input),result[101],count=0,yu=0;
	while (count<length)
	{
		yu=yu*10+input[count]-'0';
		result[count]=yu/13;
		yu%=13;
		count++;
	}
	int head=0;
	for (int i=0;i<count;i++)
	{
		if (head==0&&result[i]!=0) head=1;
		if (head==1)
		{
			cout <<result[i];			
		}
	}
	if (head==0) cout <<"0";
	cout <<endl;
	cout <<yu <<endl;
	
	return 0;
}
main()
{
      char a[1000],b[1000];
      int i,j,k,l;
      gets(a);
      i=0;
      j=0;
      k=0;
      l=0;
      while(a[i+1]!='\0')
      {
          i++;
      }
      while(j<=i)
      {
          b[j]='0';
          j++;
      }
      k=i;
      if(k==0||(k==1&&a[0]=='1'&&a[1]<='2'))
      {
          printf("0\n");
          puts(a);
      }
      else
      {
          i=0;
          while(i<k)
          {
          b[i]=(10*(a[i]-'0')+a[i+1]-'0')/13+'0';
          a[i+1]=(10*(a[i]-'0')+a[i+1]-'0')-13*(b[i]-'0')+'0';
          i=i+1;
          }
          i=1;
          if(b[0]!='0')
          printf("%c",b[0]);
          while(i<k)
          {
          printf("%c",b[i]);
          i++;
          }
          if(b[k]!='0')
          printf("%c",b[k]);
          printf("\n%c",a[k]);
      }
      getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();
}
int main()
{
	char a[101];
	int b[101],c[101];
	cin>>a;
	int l=strlen(a),i,x,j,k;
	for(i=0;i<l;i++)
		b[i]=a[i]-'0';
	x=b[0];
	for(i=0;i<l-1;i++)
	{
		c[i]=x/13;
		x=(x-13*c[i])*10+b[i+1];
	}
	c[i]=x/13;
	x=x-13*c[i];
	for(k=0; ;k++)
		if(c[k]!=0)
			break;
	if(l==1)
		cout<<'0'<<endl;
	else if(l==2&&b[0]==1&&b[1]<=2)
		cout<<'0'<<endl;
	else
		{for(j=k;j<=i;j++)
			cout<<c[j];
		cout<<endl;
			}
	cout<<x;
	return 0;
}
int main ()
{
    char a[100];
    int b[100];
    int c[100];
    int i,j,k;
    int t=0; 
    scanf("%s",a);
    if(a[1]=='\0'||(a[2]=='\0'&&(10*(a[0]-'0')+a[1]-'0'<13)))
    {printf("%d\n",t);
    printf("%s",a);}
    else{b[1]=(10*(a[0]-'0')+1*(a[1]-'0'))%13;
    c[1]=(10*(a[0]-'0')+1*(a[1]-'0'))/13;
    for(i=2,j=2;i<=100;)
    {            if(a[i]!='\0')
              {
                 b[j]=(10*b[j-1]+a[i]-'0')%13;
                 c[j]=(int)((10*b[j-1]+a[i]-'0')/13);
                 i=i+1;
                 j=j+1;
                 }
                 else
                 break;
                 }
            
                if(c[1]!=0)
                printf("%d",c[1]);
                for(k=2;k<=j-1;k++)
                {
                                   printf("%d",c[k]);
                }
                 printf("\n");
                printf("%d",b[j-1]);}
                getchar();
                getchar();
                }
int main()
{
	char beDiv[101];
	int i, r, tell, lenth;
	int result [101];
	cin >> beDiv;
	for(i = 0, r = 0; beDiv[i] != '\0'; i++)
	{
		r = r * 10 + beDiv[i] - '0';
		result[i] = r / 13;
		r %= 13;
	}
	lenth = i;
	if((lenth == 2 && (beDiv[0] - '0') * 10 + beDiv[1] - '0' < 13)
             || lenth == 1)
		cout << '0' << endl;
	else
	{
                  for(i = 0, tell = 0; i < lenth; i++)
		{
		    if(result[i] != 0)
			    tell = 1;
		    if(tell)
			    cout << result[i];
		}
	}
	cout << endl << r << endl;
	return 0;
}
int main () 
{
 
char a[200];
cin>>a;
int x[200],b[200],i;
for( i=0;i<strlen(a);i++)
x[i]=a[i]-'0';
i=0;
int s=0,temp=0;
while(i<strlen(a))
{						   
 temp=temp*10+x[i++];
b[s++]=temp/13;
temp=temp%13;
}

int k=0;
while(b[k]==0&&k<s)
k++;

if(k==s)
{cout<<0<<endl<<temp%13<<endl;return 0;}
for(int i=k;i<s;i++)
cout<<b[i];
 cout<<endl<<temp%13<<endl;			  
 				  
  
	return 0;    
}