semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
	char a[101] = {'0'}, r[101] = { '0' };
	cin.getline(a, 101);
	int x = strlen(a), i, b[101] = {0},temp=0;
	if (x == 1)
	{
		cout << '0' << endl << a[0] << endl;
		return 0;
	}
	for (i = 0; i < x ; i++)
	{
		b[i] = a[i] - '0';
	}
	for (i = 0; i < x; i++)
	{
		r[i] = b[i] / 13+'0';
		b[i + 1] += (b[i] % 13) * 10;
	}
	for (i = 0; i < x; i++)
	{
		if ((r[i] == '0') && (temp == 0))
			continue;
		if (r[i] != 0)
			temp = 1;
		cout << r[i];
	}
	if (temp == 1)
		cout << endl;
	else
		cout << '0' << endl;
	cout << b[x]/10 << endl;
	return 0;
}
int main()
{
	char sz[300]={'\0'}, result[300]={'\0'};
	int k,i,j,m;
	scanf("%s",sz);
	if(strlen(sz)==1)
	{
		j=sz[0]-48;
		printf("0\n%d",j);
	}
	else if(strlen(sz)==2)
	{
		j=(sz[0]-48)*10+(sz[1]-48);
		printf("%d\n%d",j/13,j%13);
	}
	else
	{
	k=sz[0]-48;
	for(j=k,i=1;i<strlen(sz);i++)
	{
		k=j*10+(sz[i]-48);
		for(m=0;m<=9;m++)
		{
			if(13*m<=k&&13*(m+1)>k)
			{
				result[i-1]=m+48;
				j=k-13*m;
				break;
			}
		}
	}
		if(result[0]!='0')
		{
			printf("%c",result[0]);
		}
		for(i=1;i<strlen(result)-1;i++)
		{
			printf("%c",result[i]);
		}
		printf("%c\n",result[strlen(result)-1]);
		printf("%d",j);
	}
		return 0;
}
//*******************************
//*???? ??13              *
//*?  ????  1100062709     *
//*?  ??2011.11.5            *
//*******************************
int main()
{
        int  r = 0, j;
        char str[101];
        cin >> str;
        unsigned num[101];
        for (j = 0; str[j] != '\0'; j++)
        {
            num[j] = (r * 10 + str[j] - '0') / 13;
            r = (r * 10 + str[j] - '0') % 13;
        }
        j = 0;
        while (num[j] == 0)
              j++;
        if(str[j]=='\0') cout<<"0";
        for (;  str[j] != '\0'; j++)
            cout  << num[j];
        cout << endl;
        cout << r << endl;
        cin>>r;
    return 0;
}
int main()
{
	char a[100],b[100];
	int i,j=0,k,x,s;
	for(i=0;i<100;i++)
	  {a[i]=0;b[i]='0';}
	scanf("%s",a);
	for(i=0;a[i]!=0;i++)
	  x=i+1;
	for(i=x;i<100;i++)
	  a[i]='0';
	while(j<x-1)
	  {s=0;
	   while(a[j]>'0')
	    {if(a[j+1]-3>='0')
	      {a[j+1]=a[j+1]-3;a[j]=a[j]-1;s++;}
	     else if(a[j]>='2')
	      {a[j+1]=a[j+1]-3+10;a[j]=a[j]-2;s++;}
	     else
	       {a[j]='0';a[j+1]=a[j+1]+10;}
	    }
	   b[j]=s+'0';
	   j=j+1;
	  }
	if(b[0]=='0'&&b[1]=='0')
	  printf("0");
	else if(b[0]!='0')
	  printf("%c",b[0]);
	for(i=1;i<x-1;i++)
	  printf("%c",b[i]);
	printf("\n");
	printf("%d",a[x-1]-'0');
}
int main()
{
	char num1[101], num2[101];
	int i, j, r = 0, l1;
	cin >> num1;
	l1 = strlen(num1);
	if (((l1 == 2) && ((num1[0] - '0') == 1) && ((num1[1] - '0') > 2)) || (l1 > 2) || ((l1 == 2) && ((num1[0] - '0') > 1) ))
	{
	for (i = 0; i < l1; i++)
	{
		num2[i] = (((r * 10) + num1[i] - '0') / 13) + '0' ;
		r = (r * 10 + num1[i] - '0') % 13;
	}
	if (num2[1] == '0')
	{
        for (j = 2; j < l1; j++)
		{
			cout << num2[j];
		}
	}
	else 
	{
		for (j = 1; j < l1; j++)
		{
			cout << num2[j];
		}
	}
	    cout << endl;
		cout << r;
	}
	if ((l1 == 2) && ((num1[0] - '0') == 1) && ((num1[1] - '0') <= 2))
	{
		cout << (10 + num1[1]- '0') / 13;
		cout << endl;
	    cout << (10 + num1[1]- '0') % 13;
	}
	if (l1 == 1)
	{
		cout << (num1[0] - '0') / 13;
		cout << endl;
		cout << (num1[0] - '0') %13;
	}

	return 0;
}
//*************************
//*  ?????13 
//*  ????? 
//*  ???1200012941 
//*  ???2012?11?12? 
//*************************
int main()
{
    int i, count = 0, y;
    char num[100];
    int s[100] = {0};
    cin >> num;
    y = num[0] - '0';
    for (i = 1; num[i] != '\0'; i++)
    {
         s[i] = (y * 10 + num[i] - '0') / 13;
         y = (y * 10 + num[i] - '0') % 13;
         count++;
    }
    if (count == 0)
    {
       cout << 0 << endl << y << endl;
    }
    if (count > 0)
    {
       if (((num[0] - '0') * 10 + num[1] - '0') / 13 == 0)
       {
          if (s[2] == 0)
          {
             cout << 0 << endl << (num[0] - '0') * 10 + num[1] - '0' << endl;
          }
          else
          {
             for (i = 2; i <=  count; i++)
             {
                 cout << s[i]; 
             }
             cout << endl << y << endl;
          }
       }
       else
       {
          for (i = 1; i <=  count; i++)
          {
              cout << s[i]; 
          }
          cout << endl << y << endl;
       }
    }
    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;
i=0;
for(j=0;j<strlen(str);j++)
   {
   p=0;
   for(k=i;p<13;k++)
       {if(k>=strlen(str))
          break;
       p=p*10+str[k]-'0';                                                 //???????str???????????????13 
	   }
   j=k-1;                                                                  //????????????answer?????? 
   answer[j]=p/13;                  
   p=p%13;
   q=p;
   for(int k=j;k>=i;k--)
     {
      str[k]=p%10+'0';                                                      //??str?????????????????0?? 
	  p=p/10;
	  if(p==0&&str[k-1]=='0')
	     {
		 i=k-1;
		 break;}
	  }
   }
for(i=0;i<j;i++)
   {
   if(answer[i]!=0)                                                         //???0???????answer 
      flag=1;
   if(flag)
     cout<<answer[i];
	 }
if(!flag)
   cout<<0;                                                                //????13??? 
cout<<endl<<q<<endl;                                                        //q??? 
return 0;
}
int main()
{
    char s[100];
    scanf("%s",s);
    int a[100];
    int b[100];
    int i,c;
    c=strlen(s);
    for(i=0;i<c;i++)
    {a[i]=s[i]-'0';b[i]=0;}
    for(i=0;i<c-1;i++)
    {b[i]=(a[i]*10+a[i+1])/13;
     a[i+1]=(a[i]*10+a[i+1])%13;}
     if(b[0]!=0)
     for(i=0;i<c-1;i++)
     printf("%d",b[i]);
     else  
     if(b[0]==0&&b[1]==0)
     printf("0");
     else
     for(i=1;i<c-1;i++)
     printf("%d",b[i]);
     printf("\n%d",a[c-1]);
     return 0;
     }
int main()
{
    char a[200],b[200]={0};
    scanf("%s",a);
    int len=strlen(a);
    int c=(a[0]-'0')*10+(a[1]-'0'),d=0;
    if(len==2&&c<13)
    {
    printf("0\n");
    printf("%s\n",a);
    }
    else
    {
    for(int i=2;i<len+1;i++)
    {
     b[i-2]=c/13+'0';
     d=c%13;
     c=d*10+a[i]-'0';
    }
    if(len==1)
    {
    printf("0\n");
    printf("%s\n",a);
    }
    else if((b[0]-'0')!=0)
    {
    printf("%s\n",b);
    printf("%d\n",d);
    }
    else
    {
    for(int i=1;i<strlen(b);i++)
    printf("%c",b[i]);
    printf("\n");
    printf("%d\n",d);
    }
    }
}
/*************************
 ***??:??? 1200012776
 ***????:??13
 ***??:2012?11?4?
 *************************/
int main()
{
	int i, j, k, count_num;
	//count_num??????
	
	char num[101], shang[100];
	int mod = 0;
	cin >> num;
	count_num = strlen(num);
	mod = 0;
	for (j = 0; j < count_num; j++)
	//???????????,???????,?????13,?????10??????,????13,??????
		
	{
		mod = mod * 10 + num[j] - '0';	//?????????????10????????????
		shang[j] = mod / 13 + '0';	//?j???????
		mod = mod % 13;	//???????????????13???
	}
	shang[count_num] = '\0';	//????????,???????????0,??????,???????
	for (j = 0; ; j++)
	{
		if (shang[j] - '0')	//????????0?
		{
			k = j;	//?????
			break;
		}
	}
	if(j == count_num)	//???0
	{
		cout << "0" << endl;
	}
	else
	{
		for (j = k; j < count_num; j++)
		{
			cout << shang[j];	//????????
		}
		cout << endl;
	}
	cout << mod << endl;
	return 0;
}
main()
{
      char c[110]={'\0'};
      gets(c);
      int i,a,b;
      if(c[1]=='\0')
      {
                    a=c[0]-'0';
                    printf("0\n%d",a);
      }
      else
      {
          for(i=0;c[i+1]!='\0';i++)
          {
                      if(i==0)a=(c[i]-'0')*10+c[i+1]-'0';
                      else a=a*10+c[i+1]-'0';
                      b=a/13;         
                      c[i]=b+'0';
                      a=a%13;                      
          }
          c[i]='\0';
          if(c[0]=='0'&&c[1]!='\0')
          {
                    for(i=0;c[i]!='\0';i++)
                    {
                                           c[i]=c[i+1];
                    }
          }
          printf("%s\n%d",c,a);
      }
}
int main()
{
    int i,j,b[200],c[200]={0},s;
    char a[200];
    gets(a);
    for(i=0;i<200;i++)
     if(a[i]!='\0') b[i]=a[i]-'0';
     else break;
    if(a[1]=='\0') 
    {
      printf("0\n");
      printf("%c\n",a[0]);
      //scanf("%d",&j);
      return 0;
    }
    for(j=1;j<i;j++)
    {
      if(j>1) {
              
              s=b[j-2]*100+b[j-1]*10+b[j];
              b[j-2]=0;
              }
      else s=b[1]+b[0]*10;
      b[j]=s%13;
      
      if(b[j]>=10) 
      {
        b[j-1]=1;
        b[j]=b[j]-10;
      }
      else b[j-1]=0;
      c[j]=s/13;
    }
    int ss=0;
    for(j=0;j<i;j++)
    if(c[j]!=0||ss!=0||j==i-1)
    {
      printf("%d",c[j]);
      ss=1;
    }
    printf("\n");
    if(b[i-2]!=0) printf("%d",b[i-2]);
    printf("%d\n",b[i-1]);
    //scanf("%d",&j);
    return 0;
}
int main()
{
	int i,len,temp;
	char str1[MAXLEN],str2[MAXLEN];
	
	cin >> str1;
	len=strlen(str1);

	temp=0;
	for (i=0;i<len;i++)
	{
		temp=(temp%13)*10+str1[i]-'0';
		str2[i]='0'+temp/13;
	}

	for (i=0;i<len;i++)
		if ( str2[i]!='0' )
			break;
	if (i==len)
		cout << "0" << endl;
	else
	{
		for (;i<len;i++)
			cout << str2[i];
		cout << endl;
	}
	cout << temp%13 << endl;
	return 0;
}
void main()
{
	char a[100],b[100];
	int c[100];
	gets(a);
if (atoi(a)<13)printf("0\n%d",atoi(a));
else{
	int len;
	len=strlen(a);
	int j,i,wei;
	wei=a[0]-'0';
	for (i=1;i<len;i++)
	{
		b[i-1]=(10*wei+a[i]-'0')/13+'0';
		wei=(10*wei+a[i]-'0')%13;
	} 
	
	if (b[0]=='0')
		i=1;
	else i=0;
	
	for (j=i;j<len-1;j++)
	{
		c[j]=b[j]-'0';
		printf("%d",c[j]);
		}
	
	printf("\n");
	printf("%d",wei);
}
}
int main ()
{
    char beichushu[101],shang[100];
    const int chushu=13;
    int a,b,i,c,d;
    gets (beichushu);
    a=strlen (beichushu);
if (a==1) printf ("0\n%s",beichushu);
else if (a==2) {c=((beichushu[0]-'0')*10+beichushu[1]-'0')/chushu;
                      d=((beichushu[0]-'0')*10+beichushu[1]-'0')%chushu;
                      printf("%d\n%d",c,d);}
else
{
    b=(beichushu[0]-'0')*10+(beichushu[1]-'0');
    if (b<13)
    {
            for (i=0;i<=a-3;i++)
            {
                b=b*10+beichushu[i+2]-'0';
                shang[i]=b/chushu+'0';
                b=b%chushu;
            }
            
            shang[a-2]='\0';
            printf ("%s\n%d",shang,b);
     }
     else
     {
         for (i=0;i<=a-3;i++)
         {
             shang[i]=b/chushu+'0';
             b=b%chushu;
             b=b*10+beichushu[i+2]-'0';
         }
         shang[a-2]=b/chushu+'0';
         b=b%chushu;
         shang[a-1]='\0';
         printf ("%s\n%d",shang,b);
     }
}
return 0;
}
//??13?????
int main()
{
	char a[110];
	char result[110];
	int b;
	int last=0;  //?????,?????
	int y;   //??
	int s;   //?
	int l;
	int i;
	scanf("%s",a);
	l=strlen(a);
	for(i=0;i<l;i++)
	{
		b=last+(a[i]-'0');
		y=b%13;
		s=b/13;
		result[i]='0'+s;
		last=y*10;
	}
	result[l]='\0';
	if(result[0]=='0')
	{
		if(result[1]=='0')
		{
			for(i=0;i<=l-2;i++)
			{
				result[i]=result[i+2];
			}
		}
		else
		{
			for(i=0;i<=l-1;i++)  //???=???
			{
				result[i]=result[i+1];
			}
		}
	}
	l=strlen(result);
	if(l==0)            //??????
	{
		result[0]='0';
		result[1]='\0';
	}
	printf("%s\n%d",result,y);
	return 0;
}
int main()
{
    char test[100] , tem[100];
    int len , i , j , flag = 0;
    int q , r = 0;
    while(cin >> test)
    {
        len = strlen(test);
        for (i = 0 ; i <= len - 1 ; i++)
        {
           r =10 * r + test[i] - '0';
           if (((r / 13) != 0)&&(!flag))
           {
               q = i;
               flag = 1;
           }
           if (flag)
           {
               tem[i - q] = r / 13 + '0';
           }
           r = r % 13;
        }
        if (flag == 0)
        {
            cout << '0';
        }
        else
        {
            for (i = 0 ; i <= len - 1 - q ; i++)
           {
             cout << tem[i];
           }
        }
        cout << endl;
        cout << r << endl;
    }
    return 0;
}
int main()
{
	char a[100];
	int	b[100],c[100];
	int i,k,m;
	double n;
	gets(a);
	k=strlen(a);
	for(i=0;i<k;i++)
	{
		b[i]=a[i]-48;
	}
	if(k>1)
	{
		for(i=0;i<k-1;i++)
		{
			m=10*b[i]+b[i+1];
			n=m/13;
			c[i]=floor(n);
			b[i+1]=m%13;
		}
		if(c[0]!=0||k<=2)
		{
			cout<<c[0];
		}
		for(i=1;i<k-1;i++)
		{
			cout<<c[i];
		}
		cout<<endl;
		cout<<b[k-1];
	}
	else
	{
		cout<<"0"<<endl<<b[0]<<endl;
	} 
	return 0;
}
// ??13.cpp : ??????????????
//



int main()
{
	char a[100];//={"10382942388594365769456845647694"};
	char shang[100];
	scanf("%s",a);
	int sh,yushu=a[0]-'0',i;
	//scanf("%s",a);
	if(((a[0]-'0')*10+(a[1]-'0'))<13&&a[2]=='\0')printf("0");
	if(a[1]=='\0')printf("0");
	for(i=1;a[i]!='\0';i++)
	{
		sh=(yushu*10+(a[i]-'0'))/13;
		yushu=(yushu*10+(a[i]-'0'))%13;
		shang[i-1]=sh;
		if(i!=1||sh!=0)printf("%d",sh);
	}
	//for(i=0;shang[i]!='\0';i++)
		//printf("%c",shang[i]);
	printf("\n%d",yushu);
	
}
int main()
{
 char str[101];
 int a[101],sh[100];
 int i1,i2,i3,i4,i5,len,yu=0;
 scanf("%s",str);
 len=strlen(str);
 for(i1=0;i1<=len-1;i1++)
 {
  a[i1]=str[i1]-'0';
 }
 for(i2=0;i2<=len-1;i2++)
 {
  sh[i2]=(a[i2]+yu*10)/13;
  yu=(a[i2]+yu*10)%13;
 }
// printf("%d",yu);
 if(len==1)
 printf("%d\n%d\n",0,a[0]);
 else if((len==2)&&(a[0]==1)&&(a[1]<=2))
 printf("%d\n%d%d\n",0,a[0],a[1]);
 else  
{
	if(a[1]==0)
   {
	 for(i4=2;i4<=len-1;i4++)
	 { 
	   if(i4==(len-1))
	   printf("%d\n",sh[i4]);
	   else
	   printf("%d",sh[i4]);
	 }
   }
  else
   {
	 for(i5=1;i5<=len-1;i5++)
	 {
       if(i5==(len-1))
	   printf("%d\n",sh[i5]);
	   else
	   printf("%d",sh[i5]);
	 }
   }
 printf("%d",yu);
 }

}
int main()
{
    char a[101],b[100];
    int a1[100],a2[99],a3[99];
    int i,l,x;
    scanf("%s",a);
    l=strlen(a);
     if (l>2)
{
             for(i=0;i<l;i++)
    a1[i]=a[i]-'0';
    a3[0]=a1[0];    
    for(i=0;i<l-1;i++)
    {
                      a2[i]=(a1[i+1]+a3[i]*10)/13;
                      a3[i+1]=(a1[i+1]+a3[i]*10)%13;
                      
    }
    if (a2[0]!=0)
    {
                    for(i=0;i<l-1;i++)
                    b[i]=a2[i]+'0';
                    b[l-1]=0;
    }
    else
    {
                            for(i=1;i<l-1;i++)
                            b[i-1]=a2[i]+'0';
                            b[l-2]=0;
    }
    printf("%s\n",b);
    printf("%d\n",a3[l-1]);
}
if (l==2)
{
    x=(a[0]-'0')*10+(a[1]-'0');
    printf("%d\n",x/13);
    printf("%d\n",x%13);
}  
   if (l==1)
{   
   x=a[0]-'0';
   printf("%d\n",x/13);
   printf("%d\n",x%13);
}
}
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;
		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;
}
main()
{
   char s[100];
   scanf("%s",s);
   int length=strlen(s);
   int t[100];
   int i;
   for(i=0;i<length;i++)
      t[i]=s[i]-'0';   
   if(length==1)
      printf("0\n%d",t[0]);
   else if((length==2)&&(t[0]*10+t[1]<13))
      printf("0\n%d",t[0]*10+t[1]);
   else
   {   
   int p[100]={0};
   int a=t[0];
   int k=1;
   for(i=1;i<length;i++)
   {
      a=a*10+t[i];
      p[i]=a/13;
      a=a%13;  
      k++;                  
   }
   for(i=1;i<k;i++)
   {
       if((i==1)&&(p[i]==0))
         continue;
       else
         printf("%d",p[i]);                  
   }
   printf("\n");
   printf("%d",a);
   }
   getchar();
   getchar();
}
int main()
{
	int len, i, j;
	char str[101], ans[100] = {'0'}, a, b;
	cin >> str;
	len = strlen(str);
	a = str[0];
	b = str[1];
	for (i = 0; i < len - 1; )
	{
		if (str[i] > '1')
		{
			if (str[i + 1] >= '3')
			{
				str[i]--;
				str[i + 1]-=3;
			}
			else
			{
				str[i]-=2;
				str[i + 1]+=7;
			}
			ans[i]++;
		}
		if (str[i] == '1')
		{
			if (str[i + 1] >= '3')
			{
				str[i]--;
				str[i + 1]-=3;
				ans[i]++;
			}
			else
			{
				str[i + 1]+=10;
				i++;
				ans[i] = '0';
			}
		}
		if (str[i] == '0')
		{
			i++;
			ans[i] = '0';
		}
	}
	if (len == 1 || (len == 2 && a == '1' && b < '3'))
	{
		cout << "0";
	}
	else if (a == '1' && b < '3')
	{
		for (j = 1; j < i; j++)
		{
			cout << ans[j];
		}
	}
	else
	{
		for (j = 0; j < i; j++)
		{
			cout << ans[j];
		}
	}
	cout << endl;
	if (str[i - 1] == '1')
	{
		str[i]-=10;
		cout << str[i - 1] << str[i] << endl;
	}
	else
	{
		cout << str[i] << endl;
	}
	return 0;
}
int main()
{
     char s[100]={0};
     scanf("%s",s);   //???s[0]???? 
     int a[100],b;
     int c,d,e;
     c=s[0]-'0';
     d=s[1]-'0';
     e=c*10+d;
     int l=strlen(s);
     if(l==1)
     {
             printf("0\n");
             printf("%c",s[0]);
     }
     else if((e<13)&&(l==2))
     {
          printf("0");
          printf("\n");
          printf("%d",e);
     }
     else
     {
         for(int i=0;i<l-1;i++)
         {
               a[i]=e/13;
               c=e-13*a[i];
               d=s[i+2]-'0';
               e=c*10+d;
         }
         for(int q=0;q<l-1;q++)
         {
                  if((q==0)&&(a[q]!=0))
                  printf("%d",a[q]);
                  else if(q!=0)
                  printf("%d",a[q]);
         }
        
         printf("\n");
         printf("%d\n",c);
     }
  
}
int main()
{	int i,n,k=0,a,j;
	char s[100],b[100];
	scanf("%s",s);
	n=strlen(s);
	if(n==1)
	{
		printf("0\n");
		k=s[0]-'0';
		printf("%d",k);
	}
	else
		if(n==2&&s[0]=='1'&&(s[1]-'0')<3)
		{
			printf("0\n");
		k=10+s[1]-'0';
		printf("%d",k);
		}
		
		else{for(i=0;i<n;i++)
			{k=s[i]-'0'+k*10;
		a=k/13;
		b[i]=a+'0';
		k=k%13;}
	b[i]='\0';
	
		for(j=0;j<i;j++)
		{if(b[j]!='0')
		{	printf("%c",b[j]);
			break;
		}
		}
		for(j++;j<i;j++)
		printf("%c",b[j]);
		printf("\n");
		printf("%d\n",k);
		}
	


	return 0;
}
main()
{
      char a[MAX+1];
      int b[MAX+1],c[MAX+1];
      scanf("%s",a);
      int len=strlen(a);
      int i,p,k;
      for(i=0;i<len;i++) b[i]=a[i]-'0';
      b[i]=0;
      if(len==2&&b[0]*10+b[1]<=12)
      printf("0\n%d\n",b[0]*10+b[1]);
      else if(len==1)printf("0\n%d\n",b[0]);
      else
      {
      for(k=0;k<len-1;k++)
      //{
      //if(b[k]=='\0') 
      //{
      //p=k; 
      //break;
      //}
      //else 
      {
           int m;
           m=b[k]*10+b[k+1];
           c[k]=m/13;
           b[k+1]=m%13;
      }
      //}
      
      if(c[0]!=0)
      printf("%d",c[0]);
      for(int j=1;j<=k-1;j++) 
      {
      printf("%d",c[j]);
      }
      printf("\n");
      
      printf("%d\n",b[k]);
      }
      }
main()
{
char a[105];
gets(a);
int i,b,c;
if(a[1]=='\0')
{
b=a[0]-'0';
c=0;
printf("%d\n",c);
printf("%d",b);
}
else
{
if(a[2]=='\0')
{
b=((a[0]-'0')*10+(a[1]-'0'))%13;
c=((a[0]-'0')*10+(a[1]-'0'))/13;
printf("%d\n",c);
printf("%d",b);
}
else
{
b=((a[0]-'0')*100+(a[1]-'0')*10+(a[2]-'0'))%13;
c=((a[0]-'0')*100+(a[1]-'0')*10+(a[2]-'0'))/13;
printf("%d",c);
for(i=3;a[i]!='\0';i++)
{
c=(b*10+(a[i]-'0'))/13;
b=(b*10+(a[i]-'0'))%13;
printf("%d",c);
}
printf("\n");
printf("%d",b);
}
}
}
int main()
{
  char c[200];
  int a[200],b[200];
  int yushu;
  gets(c);
  int m,i;
  m=strlen(c);
  for(i=0;i<m;i++)
  {
	a[i]=c[i]-'0';
  }
  if(m>2)
 {
		if((a[0]*10+a[1])>=13)
 {
		yushu=a[0];
		for(i=1;i<m;i++)
		{
			b[i]=(yushu*10+a[i])/13;
			yushu=(yushu*10+a[i])%13;
		}
	for(i=1;i<m;i++)	
	{
		printf("%d",b[i]);
	}
	printf("\n");
	printf("%d",yushu);
 }
 else
 {
		yushu=a[0]*10+a[1];
		for(i=2;i<m;i++)
		{
			b[i]=(yushu*10+a[i])/13;
			yushu=(yushu*10+a[i])%13;
		}
	for(i=2;i<m;i++)	
	{
		printf("%d",b[i]);
	}
	printf("\n");
	printf("%d",yushu);
 }
}
if(m==2)
{
	printf("%d\n",(a[0]*10+a[1])/13);
	printf("%d",(a[0]*10+a[1])%13);
}
if(m==1)
{
	printf("0\n");
	printf("%d",a[0]);
} 	
}
//*************************************
//* ????3.cpp *
//* ??????1200012844 *
//* ?????2012?11?13? *
//* ???????13 *
//**************************************

int main()
{
	int i, r;
	char num[1000];
	cin >> num;
	int len = strlen(num);//???????len
	if(len == 1 || ((len == 2) && (num[0] == '1') && (num[1] < '3')))
	{
		cout << 0 << endl;
		cout << num << endl;//?????13?????0???????
	}
	else 
	{
		if(((num[0] - '0') * 10 + (num[1] - '0')) / 13 != 0)
		{
			cout << ((num[0] - '0') * 10 + (num[1] - '0')) / 13;
			r = ((num[0] - '0') * 10 + (num[1] - '0')) % 13;//???????????13???????13???
		}
		else 
			r = ((num[0] - '0') * 10 + (num[1] - '0'));//???????????13????????
		for (i = 2; i < len; i++)//????????????
		{
			cout << (r * 10 + num[i] - '0') / 13;
			r = (r * 10 + num[i] - '0') % 13;
		}
		cout << endl;
		cout << r << endl;//??????
	}
	return 0;
}
main()
{
    char N[100];
    int a[100];
    int b=0,i,l,count=0;
    gets(N);
    l=strlen(N);
    for(i=0;i<l;i++)
    {
        N[i]=N[i]-'0';
        b=10*b+N[i];  
        a[i]=b/13;
        b=b%13;
        count++;
     }
     if(count==1 || (count==2 && a[0]==0 && a[1]==0))
     printf("0");
     else
  {
     if(a[0]!=0)
     { for(i=0;i<l;i++)
      printf("%d",a[i]);
      }
      else if(a[0]==0 && a[1]!=0)
      {
      for(i=1;i<l;i++)
      printf("%d",a[i]);
      }
       else if(a[0]==0 && a[1]==0)
      {
      for(i=2;i<l;i++)
      printf("%d",a[i]);
      }
  }
      printf("\n%d",b);
      getchar();
      getchar();
}
main()
{ int a[N]={0},c[N]={0};
  long i,l,d,b=13;
  char a1[N];
  scanf("%s",a1);
  l=strlen(a1);
  for(i=0;i<l;i++) a[i]=a1[l-i-1]-'0';
  d=0;
  for(i=l-1;i>=0;i--)
  { d=d*10+a[i];
    c[i]=d/b;
    d=d%b;
  }
  while(c[l-1]==0 && l>1) l--;
  for(i=l-1;i>=0;i--) printf("%d",c[i]);
  printf("\n%d",d);
}
char beichushu[150];
int beichu[150];               //??????? 
int chu[150];                  //??????????? 
int chu1[250];                 //??????????? 
int shang[200];               //????? 
void subtract(int *,int *);      //??????????????? 
int compare(int *,int *);        //???????? 
int wei(int *);                  //?????? 
void fangda(int *, int);         //?????10?n??? 
int main(void)
{
	int i,j,k;
	int n;
	int max;       

		int x=0;
		int m=0;
		scanf("%s",beichushu);
		memset(beichu,0,sizeof(beichu));
		memset(chu,0,sizeof(chu));
		memset(chu1,0,sizeof(chu1));
		memset(shang,0,sizeof(shang));
		
		for(i=strlen(beichushu)-1,j=0;i>=0;i--)
			beichu[j++]=beichushu[i]-'0';
        chu[0]=3;
        chu[1]=1;
        chu1[0]=3;
        chu1[1]=1;
		k=wei(beichu)-wei(chu);            //k???????????? 
		max=k;                             //?????????????max??????????? 
		int a=compare(beichu,chu);         //????????????0 
		fangda(chu1,k);                    //???? 
		while(compare(beichu,chu))
		{
			while(compare(beichu,chu1))
			{
				subtract(beichu,chu1);
				m++;
			}
			shang[x]=m;
			x++;
			m=0;
			memset(chu1,0,sizeof(chu1));
		    chu1[0]=3;
		    chu1[1]=1;
			k--;
			if(k>=1)
			    fangda(chu1,k);
		}
		if(shang[0]==0)
		{
			for(i=1;i<=max;i++)
			{
			    printf("%d",shang[i]);
			}
		}
		else if(shang[0]>0)
		{
			for(i=0;i<=max;i++)
			    printf("%d",shang[i]);
		}
		if(a==0)
		    printf("0");
		printf("\n");
		if(beichu[1]==1)
		for(i=1;i>=0;i--)
		    printf("%d",beichu[i]);
		else
		    printf("%d",beichu[0]);
	return 0;
}

void subtract(int *beichu,int *chu1)
{
	int i;
	for(i=0;i<120;i++)
	{
		beichu[i]=beichu[i]-chu1[i];
		if(beichu[i]<0)
		{
			beichu[i]+=10;
			beichu[i+1]--;
		}
	}
}
int compare(int *beichu,int *chu1)
{
	if(wei(beichu)>wei(chu1))
	    return 1;
	else if(wei(beichu)<wei(chu1))
	    return 0;
	else
	{
		int i;
		for(i=149;;i--)
		{
			if(beichu[i]>chu1[i])
			    return 1;
			else if(beichu[i]<chu1[i])
			    return 0;
		}
	}
	return 1;
}
int wei(int *a)
{
	int i,post;
	for(i=149;i>=0;i--)
	{
		if(a[i]>0)
		{
			post=i+1;
				return post;
		}
	}
} 
void fangda(int *c,int n)
{
	int i;
	for(i=100;i>=0;i--)
	{
		c[i+n]=c[i];
	}
	for(i=0;i<n;i++)
	{
		c[i]=0;
	} 
}