semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
main()
{
      char a[101];
      scanf("%s",a);
      int n=strlen(a);
      int b[101];
      for (int i=0;i<n;i++)
      b[i]=a[i]-'0';
      int s[100];
      if (n<3) printf("%d\n%d\n",atoi(a)/13,atoi(a)%13);
      else
      {
          int i=0;
          while(i<n-1)
          {
              if ((10*b[i]+b[i+1])<13) 
              {s[i]=0;
              s[i+1]=(100*b[i]+10*b[i+1]+b[i+2])/13;
              b[i+2]=(100*b[i]+10*b[i+1]+b[i+2])%13;
              i+=2;}
              else
              {s[i]=(10*b[i]+b[i+1])/13;
              b[i+1]=(10*b[i]+b[i+1])%13;
              i++;}
           }
      
       if(s[0]==0) for (int i=1;i<n-1;i++) printf("%d",s[i]);
       else for (int i=0;i<n-1;i++) printf("%d",s[i]);
       printf("\n%d",b[n-1]);
       }

}
int main()
{
	char a[100];
	int d, c[100], b[100], p = 0, temp;
	cin>>a;
	for(int i = 0; i < strlen(a); i++)                 //??????????????
		c[i] = a[i] - '0';
	if(strlen(a) == 1)                                 //????????????0????
	{
		cout<<0<<endl<<c[0]<<endl;
		return 0;                                      //?????
	}
	if(strlen(a) == 2 && c[0] * 10 + c[1] < 13)        //????????????13???
	{
		cout<<0<<endl<<c[0] * 10 + c[1]<<endl;
		return 0;                                       //?????
	}
	d = c[0] * 10 + c[1];                               //????????????
	for(int i = 2; i <= strlen(a); i++)                 //?????????????
	{
		b[p] = d / 13;
		p++;
		temp = d % 13;
		d = temp * 10 + c[i];
	}
	if(b[0] == 0)                                       //????0??????
	{
		for(int i = 1; i < p; i++)
			cout<<b[i];
		cout<<endl;
	}
	else                       
	{
		for(int i = 0; i < p; i++)
			cout<<b[i];
		cout<<endl;
	}
	cout<<temp<<endl;
	return 0;
}
main()
{
     char s[100];
     int i,n;
     int a[100],b[100];
     scanf("%s",s);
     n= strlen(s);
     if(n>2)
     {
     a[0]=(s[0]-'0')*10+(s[1]-'0');
     if(a[0] >= 13)
     {
      printf("%d",a[0]/13);
     }
      b[0]=a[0]%13;
      for(i=1;i<n-1;i++)
      {
       a[i]=b[i-1]*10+(s[i+1]-'0');
       printf("%d",a[i]/13);
       b[i]=a[i]%13;
       }
       printf("\n");
       printf("%d",b[n-2]);
      }
      else if(n==2)
      {
        a[0]=(s[0]-'0')*10+(s[1]-'0');
        printf("%d\n",a[0]/13);  
        printf("%d",a[0]%13); 
      }
      else
      {
       printf("0\n") ;
       printf("%c",s[0]); 
      } 
}
int main()
{
    int s,i,l;
    char N[100],S[99];
    gets(N);
    l=strlen(N);
    if(l==1)
    {
            printf("0\n");     
            printf("%s\n",N);
    }
    else if(l==2)
    {
            int q=(10*(N[0]-'0')+(N[1]-'0'))/13;
            s=(10*(N[0]-'0')+(N[1]-'0'))%13;
            printf("%d\n",q);     
            printf("%d\n",s);
    }
    else
    {
    if(10*(N[0]-'0')+(N[1]-'0')>=13)
    {     s=(N[0]-'0')*10+N[1]-'0';
          for(i=0;i<(l-2);i++)
          {
            S[i]=s/13+'0';
            s=(s%13)*10+N[i+2]-'0';
          } 
          S[i]=s/13+'0';
          s=s%13;
          S[i+1]='\0';
          printf("%s\n",S);
          printf("%d\n",s);    
     }          
    else
    {
          s=(N[0]-'0')*100+(N[1]-'0')*10+N[2]-'0'; 
          for(i=0;i<(l-3);i++)
          {
            S[i]=s/13+'0';
            s=(s%13)*10+N[i+3]-'0';
          } 
          S[i]=s/13+'0';
          s=s%13;
          S[i+1]='\0';
          printf("%s\n",S);
          printf("%d\n",s);                   
    }
    }
    getchar();
    getchar();
}
int main()
{  char a[101]={0};
 int b[101]={0};
 int c[101]={0};
   int i,l,m;
  cin>>a;
  l=strlen(a);
  if(l==1)
  {cout<<"0"<<endl;
   cout<<a[0]<<endl;}
  else if(l==2&&a[0]=='1'&&(a[1]=='0'||a[1]=='1'||a[1]=='2'))
   {cout<<"0"<<endl;
    cout<<a<<endl;}
else {
  for(i=0;i<l;i++)
  {b[i]=a[l-1-i]-'0';}
  for(i=l-1;i>=1;i--)
  {m=b[i]*10+b[i-1];
   b[i-1]=m%13;
   c[i-1]=m/13;}
i=l-1;
 while(c[i]==0)i--;
 for(;i>=0;i--)
 cout<<c[i];
 cout<<endl;
 cout<<b[0];}
return 0;
}
int main()
{
    int n=0,i,j,k;
    char num[101],b[100];
    scanf("%s",num);
    for(i=0;num[i]!='\0';i++)
    n++;
    if(n==1)
    printf("0\n%c",num[0]);
    else if((n==2)&&((num[1]-'0')<3)&&(num[0]=='1'))
    printf("0\n%c%c",num[0],num[1]);
    else
  {
    for(j=1;j<=n-1;j++)
    {
      b[j-1]=((num[j-1]-'0')*10+(num[j]-'0'))/13+'0';
      num[j]=((num[j-1]-'0')*10+(num[j]-'0'))%13+'0';
      k=num[j]-'0';
    }
    b[n-1]='\0';
    if(b[0]=='0')
    {
               for(i=1;i<=n-2;i++)
              printf("%c",b[i]);
    }
    else 
           printf("%s",b);
  printf("\n%d",k);
}
getchar();    
getchar();
getchar();
}
int main ()
{
    char temp[101];
    cin.getline(temp,101);
    if (strlen(temp) == 1) cout << 0 << endl << temp[0];
    else{
        int number[100], remainder;
        for (int i = 0; i < strlen(temp); i++)
            number[i] = temp[i] - 48;
        for (int i = 0; i < strlen(temp) - 1; i++){
            number[i+1] += number[i] % 13 * 10;
            number[i] /= 13;
        }
        remainder = number[strlen(temp) - 1] % 13;
        number[strlen(temp) - 1] /= 13;
        for (int i = 0; i < strlen(temp) - 1; i++){
            if (number[i] == 0 && number[i+1] != 0){
                for (int j = i+1; j < strlen(temp); j++)
                    cout << number[j];
                cout << endl;
                break;
            }
            else if (i == strlen(temp)-2) cout << 0 << endl;
        }
        cout << remainder;
    }
    return 0;
}
//*****************************************
//*         ???????13              *
//*         ??????                  *
//*         ???1200012764              *
//*         ???2012/11/18              * 
//*****************************************
int main()
{
	char a[150];              //????????????a
	int b[150] = {0};           //???????b???????
	scanf("%s", a);            
	int u, v, w, al;          //????????????u?v?w?   ???????al
	al = strlen(a);
	int x = 0, y = 0;        
	if (al >= 3)               //???????????
	{
	if (x >= 13)                  //?????????13????al - 1?
	{
		x = 10 * (a[0] - '0') + a[1] - '0';
		u = 0; 
		while (u <= al - 3)              //???????????????????
		{
			b[u] = x / 13;
			x = (x % 13) * 10 + (a[u + 2] - '0');
			u++;
		}
		b[al - 2] = x / 13;           //?????????
		y = x % 13;               //y???
		for (u = 0; u <= al - 2; u++)
		{
			cout << b[u];
		}
		cout << endl;
		cout << y << endl;
	}
	if (x < 13)           //??????13?????al-3?
	{
		x = 100 * (a[0] - '0') + 10 * (a[1] - '0') + a[2] - '0';
		u = 0;
		while (u <= al - 4)                  //?????????????
		{
			b[u] = x / 13;
			x = (x % 13) * 10 + (a[u + 3] - '0');
			u++;
		}
		b[al - 3] = x / 13;
		y = x % 13;
		for (u = 0; u <= al -3; u++)
		{
			cout << b[u];
		}
		cout << endl;
		cout << y << endl;
	}
	}
	if (al == 1)                   //????????????
	{

		cout << "0" << endl << a[0] - '0' << endl;            //?????????0
	}
	if (al == 2)            //????????????
	{
		x = (a[0] - '0') * 10 + a[1] - '0';               //?????????
		cout << x / 13 << endl << x % 13 << endl;
	}
	return 0;
}
main()
{
      char a[150];
      char b [150];
      int i,l,c,d,e,f;
      scanf("%s",a);
      l=strlen(a);
      if (l>2)
      {
      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');
              for(i=1;i<=l-2;i++)
              {
                   d=(b[i-1]-'0')*13;
                   c=(c-d)*10+(a[i+1]-'0');
                   b[i]=c/13+'0';
              }
      b[l-1]='\0';
      f=c-(b[l-2]-'0')*13; 
      printf("%s\n",b);
      printf("%d\n",f);
      }
      else
      {
          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');
          for(i=1;i<=l-3;i++)
          {
                    d=(b[i-1]-'0')*13;
                    c=(c-d)*10+(a[i+2]-'0');
                    b[i]=c/13+'0';        
          }
      b[l-2]='\0';
      f=c-(b[l-3]-'0')*13;
      printf("%s\n",b);
      printf("%d\n",f);
      }
      }
      else {if(l==2)
      {
          b[0]=((a[0]-'0')*10+(a[1]-'0'))/13+'0';
          b[1]='\0';
          f=((a[0]-'0')*10+(a[1]-'0'))%13;
          printf("%s\n",b);
          printf("%d\n",f);
          
      }
      else 
      {
         
          b[0]=(a[0]-'0')/13+'0';
          b[1]='\0';
          f=a[0]-'0';
          printf("%s\n",b);
          printf("%d\n",f);
      }}
           
      
   }
int main()
{
	char num[110],a[3]={' ',' ','\0'},qq[110];                //????
	int i=0;
	cin >>num;
	int n=strlen(num);
	memset(qq,'\0',110);                                      //???
	while (i<n-1)
	{
		a[0]=num[i];a[1]=num[i+1];                            //????????????0??100
		int x=atoi(a);
		if (i>0&&num[i-1]>'0') x+=100;                 
		int t=x%13,q=x/13;                                    //??????
		qq[i]='0'+q;
		if (t>=10)                                            //??
		{
			t-=10;
			num[i]='1';num[i+1]='0'+t;
		}
		else 
		{
			num[i]='0';num[i+1]='0'+t;
		}
		i++;
	}
	if (n==1)
	{
		cout <<0 <<endl <<num;return 0;
	}
	if (qq[0]=='0'&&n>2)
	     for (int i=0;i<n;i++) qq[i]=qq[i+1];
	cout <<qq;
	cout <<endl ;
	if (num[n-2]!='0') cout <<num[n-2];
	cout <<num[n-1];
	return 0;
}
int main()
{
	char a[100] = {'\0'}, b[100] = {'\0'};                       // a???????b???13???
	cin.getline(a, 100);                                         // ?a??
	int r, i;                                                    // r???
	r = 0;
	for (i = 0; a[i] != '\0'; i++)
	{
		b[i] = ((r * 10 + (a[i] - '0')) / 13) + '0';             // ???????a????????13??b??????
		r = (r * 10 + (a[i] - '0')) % 13;                        // ???????a????????13????
	}
	if (a[1] == '\0' || ((a[0] - '0') == 1 && ((a[1] - '0') < 3) && (a[2] == '\0')))                                            // ???????13?????0
		cout << '0';
	else if ((b[1] - '0') != 0)             // ?b?????0??????????b
	{
		for (i = 1; b[i] != '\0'; i++)
			cout << b[i];
	}
	else                                                         // ??????????
	{
		for (i = 2; b[i] != '\0'; i++)
			cout << b[i];
	}
	cout << endl << r;
	return 0;
}
void main()
{
	char a[200],b[200],c;
	int i=0,r=0,flag=0;
	scanf("%c",&c);
	while(c!='\n')
	{
		a[i]=c;
		i++;
		scanf("%c",&c);
	}
	a[i]='!';
	i=0;
	while(a[i]!='!')
	{
		b[i]=(r*10+a[i]-'0')/13+'0';
		r=(r*10+a[i]-'0')%13;
		i++;
	}
	b[i]='!';
	i=0;
	do
	{
		if(flag==0)
		{
			if(b[i]>='1'&&b[i]<='9')
			{
				printf("%c",b[i]);
				flag=1;
			}
		}
		else
		{
			printf("%c",b[i]);
		}
		i++;
	}while(b[i]!='!');
	if(flag==0)
	{
		printf("0");
	}
	printf("\n%d",r);
}
int main()
{
    char a[100];
    int divide[100], mod[100];
    int len;
    cin >> a;
    len = strlen(a);
    if (len == 1)
    {
        cout << 0 << endl;
        cout << a[0];
    }
    else
    if(len == 2)
    {
        cout << (10 * (a[0] - '0') + (a[1] - '0')) / 13 << endl;
        cout << (10 * (a[0] - '0') + (a[1] - '0')) % 13;
    }
    else
    {
        divide[0] = (10 * (a[0] - '0') + (a[1] - '0')) / 13;
        mod[0] = (10 * (a[0] - '0') + (a[1] - '0')) % 13;
        for (int i = 1; i < len - 1; i++)
        {
            divide[i] = (10 * mod[i - 1] + (a[i + 1] - '0')) / 13;
            mod[i] = (10 * mod[i - 1] + (a[i + 1] - '0')) % 13;
        }
        if (divide[0])
            cout << divide[0];
        for (int i = 1; i < len - 2; i++)
        {
            cout << divide[i];
        }
            cout << divide[len - 2] << endl;
            cout << mod[len - 2] << endl;
    }
    return 0;
}
//****************************************
//*?????13                       
//*?????? 1100012789      
//*???2011.11.4                       
//****************************************

int main()
{
	char number[101], result[101]; // number????????result?????
	int i, remain = 0, digit; // i?????remain??????digit??????
	cin >> number;
	digit = strlen(number);
	for (i = 0; i < digit; i++)
	{
		result[i] = ((remain * 10 + (number[i] - '0')) / 13) + '0'; // ?????????
		remain = (remain * 10 + (number[i] - '0')) % 13; // ???????
	}
	result[i] = '\0'; // ??????
	for (i = 0; result[i] == '0' && i < strlen(result) - 1;) // ?????????????????
			i++;
	cout << result + i << endl;
	cout << remain << endl;
	return 0;
}
//??3?11?????????
//*********************
//* ??? ??13     *
//* ??? 1200012878 *
//* 11?16?          *
//*********************
int main()
{
	char a[101];
	int num[101], b[101];
	int len, flag = 0, r, i;
	cin >> a;
	len = strlen(a);
	for (i = 0; i <= len - 1; i++)
		num[i] = a[i] - '0';
	r = 0;
	for (i = 0; i <= len - 1; i++)
	{
		b[i] = (r * 10 + num[i]) / 13;
		r = (r * 10 + num[i]) % 13;
	}
	for (i = 0; i <= len - 1; i++)
	{
		if (b[i] != 0 || flag == 1)
		{
			cout << b[i];
			flag = 1;
		}
	}
	if (flag == 0)
		cout << "0";
	cout << endl;
	cout << r << endl;
	return 0;
}
main()
{
	char a[101]={0},re[100]={0};
	int i,j,k=0,l,te;
	scanf("%s",a);
	l=strlen(a);
	te=a[0]-'0';
	for (i=1;i<l;i++)
	{
		te=te*10+a[i]-'0';
		if (te/13!=0||i!=1)
		{
			re[k]=te/13+'0';
			k++;
		}
     	te=te%13;
	}
	if ((l==1||l==2)&&re[0]==0)
		printf("0\n%d",te);
	else
		printf("%s\n%d",re,te);
	
}
/* Name      : ??13 
 * Version   : 1.0
 * Date      : 2012-12-16
 * New       : Null
 * Func&Feat : ????? 
 * State     : Design
 */
int main()
{
    char c,Dividend[100]={0};
    int N;
    for(int i=0;(c=getchar())!='\n';i++){Dividend[i]=c;N=i+1;}
    int PartQuotient[100]={0},PartRemainder[100]={0};
    if(N==1)cout<<0<<endl<<(int)(Dividend[0]-48)<<endl;
    else
    {
        for(int i=0;i<N;i++)
        {
            int PartDividend;
            if(i==0)PartDividend=Dividend[i]-48;
            else PartDividend=10*PartRemainder[i-1]+(Dividend[i]-48);
            //cout<<i<<' '<<PartDividend<<endl;
            PartQuotient[i]=PartDividend/13;
            PartRemainder[i]=PartDividend%13;
            //cout<<i<<' '<<PartQuotient[i]<<' '<<PartRemainder[i]<<endl;
            if((i<2&&PartQuotient[i]==0&&Dividend[i+1]!=0)==0)cout<<PartQuotient[i];
        }
        cout<<endl<<PartRemainder[N-1]<<endl;
    }
    return 0;
}
/*************************
 ***??:??? 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
	{
		cout << shang + j << endl;
	}
	cout << mod << endl;
	return 0;
}
int main(){
	int m,i;
	int sz[1000];
	int jg[1000];
	char zfc1[1000];
	scanf("%s",zfc1);
    m=strlen(zfc1);
	for(i=0;i<m;i++){
         sz[i]=zfc1[i]-48;
	}
	if(m>=2){
		if((m==2)&&(sz[0]*10+sz[1]<13)){printf("%d\n",0);}
	for(i=0;i<m-1;i++){
		jg[i]=(sz[i]*10+sz[i+1])/13;
		sz[i+1]=(sz[i]*10+sz[i+1])%13;
	}
	for(i=0;i<m-1;i++){
        if((i==0)&&(jg[i]==0)){continue;}
		else if(i!=m-2){printf("%d",jg[i]);}
        else if(i==m-2){printf("%d\n",jg[i]);}
	}
	}
	else{printf("%d\n",0);}
	printf("%d",sz[m-1]);
	return 0;
}
int main()
{
	char a[100];
	char b[100] = {0};
	int m, n, i, k = 0;
	cin.getline(a,100);
	if (a[1] == '\0')
	{
		cout << 0 <<endl;
		cout << a[0];
	}
	else 
	{
		n = (a[0] -48) * 10 + (a[1] - 48);
		if (n < 13)
			k = 1;
		b[0] = n / 13 + 48;
		m = n % 13;
		for (i = 2; a[i] != '\0'; i++)
		{
			n = m * 10 + (a[i] - 48);
			if (n >= 13)
			{
				b[i - 1] = n / 13 + 48;
				m = n % 13;
			}
			else
			{
				b[i-1] = 48;
				m = n;
			}
		}
		if (b[1] != 0)
		{
			cout << b + k << endl;
			cout << m;
		}
		else
		{
			cout << b[0] << endl;
			cout << m;
		}
	}
	return 0;
}
void main()
{
	char *p;
	char s[101];
	char a[101];
	int i,l,t;
	int x=0;
	scanf("%s",s);
	l=strlen(s);
	for(t=0,i=0;i<l;i++)
	{
		t=t+s[i]-'0';
		a[i]=t/13+'0';
		if(t>=13)
			t=t%13*10;
		else
			t=t*10;
	}

	t=t/10;
	a[l]=0;
	if(l==1)
		printf("%c\n%c\n",'0',s[0]);
	else if (l==2&&(s[0]-'0')*10+s[1]-'0'<13)
		printf("%c\n%s\n",'0',s);
	else
	{
		for(i=0;i<l;i++)
			if(a[i]!='0')
			{
				p=&a[i];
				break;
			}
			printf("%s\n%d\n",p,t);
	}
}
int main()
{
	int b[100],j=2,i,e,c[100],p;
	char a[100];
	
	
	scanf("%s",a);
	
	p=strlen(a);
	if(p==1)
	{printf("0\n");
	printf("%d",a[0]-'0');
    }
    else
    {
	b[0]=(a[0]-'0')*10+a[1]-'0';
 
    while(a[j]!=0)
	{
	b[j-1]=a[j]-'0';
	
	j++;
	}
	j-=2;
    
    for(i=0;i<j;i++)
    {
                
	c[i]=b[i]/13;
	e=b[i]%13;
	b[i+1]+=e*10;    
		
	}
	c[j]=b[j]/13;
	e=b[j]%13;
	
	if(j==0)
	printf("%d\n",c[0]);
	else 
    {
         if(c[0]!=0)
    printf("%d",c[0]);
	i=1;
	while(i<j)
	{
	printf("%d",c[i]);
    i++;
    }
	
    printf("%d\n",c[j]);
}
            
	printf("%d",e);
}
	
}
int main()
{
    char a[100],b[100];
    int c[100],d[100],i,j,n,s,t=0;
    scanf("%s",a);
     n=strlen(a);
    for(i=0;i<n;i++)
    {c[i]=a[i]-'0';}
    for(i=0;i<n;i++)
     { t = t*10+c[i];
       d[i]=t/13;
       t = t%13;
       }
       if(n==1||(n==2&&d[1]==0))
       printf("0");
       else
    {
        if(d[1]==0) 
     for(i=2;i<n;i++)
      {
        printf("%d",d[i]);
        }
      else 
        for(i=1;i<n;i++)
      {
        printf("%d",d[i]);
        }
        } 
        printf("\n%d\n",t); 
      getchar();
      getchar();
}
int main()
{
	int i, r = 0, q = 0, q1 = 0;
	char num[100];
	
	cin >> num;

	if ((num[1] == '\0') || 
		(num[2] == '\0' && (((num[0]-'0') * 10 + num[1] - '0') < 13)))
		cout << "0" << endl;
	else
	{
		q = ((num[0] - '0') * 10 + num[1] - '0') / 13;
		if (q != 0)
		{	
			cout << q;
			r = ((num[0] - '0') * 10 + num[1] - '0') % 13;
			for (i = 2; num[i] != '\0'; i++)
			{
				q = (r * 10 + num[i] - '0') / 13;
				cout << q;
				r = (r * 10 + num[i] - '0') % 13;
			}
			cout << endl;
		}
		else
		{
			r = ((num[0] - '0') * 100 + (num[1] - '0') * 10 + num[2] - '0') % 13;
			q1 = ((num[0] - '0') * 100 + (num[1] - '0') * 10 + num[2] - '0') / 13;
			cout << q1;
			for (i = 3; num[i] != '\0'; i++)
			{
				q = (r * 10 + num[i] - '0') / 13;
				cout << q;
				r = (r * 10 + num[i] - '0') % 13;
			}
			cout << endl;
		}
	}

	r = 0;
	// ???????r
	for (i = 0; num[i] != '\0'; i++)
	{
		r = (r * 10 + num[i] - '0') % 13;
	}
	cout << r << endl;

	return 0;
}
int main ()
{
	char a[101];
	int i = 0, yushu = 0 , b[101] = {0}, k = 0;
	cin.getline(a, 100);
	while (a[i] != '\0')
	{
		b[i] = (yushu * 10 + a[i] - '0') / 13;
		yushu = (yushu * 10 + a[i] - '0') % 13;
		i++;
	}
	k = i - 1;
	if (k == 0)
		cout << "0" << endl << a[0] << endl;
	else 
	{
		if ((a[0] - '0') * 10 + a[1] - '0' < 13 && k == 1)
		{
			cout << ((a[0] - '0') * 10 + a[1] - '0') / 13 << endl;
			cout << ((a[0] - '0') * 10 + a[1] - '0') % 13 << endl;
		}
		else
		{
			if ((a[0] - '0') * 10 + a[1] - '0' < 13 && k > 1)
				i = 2;
			else
				i = 1;
			for (i; i <= k; i++)
				cout << b[i];
			cout << endl;
			cout << yushu << endl;
		}
	}
	return 0;
}
int main()
{
	char number[100];
	int i, toDevide, tell = 0;
	cin >> number;
	toDevide = number[0] - '0';
	for(i = 1; number[i] != '\0'; i++)
	{
		toDevide = toDevide * 10 + number[i] - '0';
		if(i > 1 || toDevide / 13 != 0)
	         {
                            cout << toDevide / 13;
                            tell++;
                   }
		toDevide %= 13;
	}
         if ( tell == 0) 
              cout << '0';
	cout << endl << toDevide << endl;
	return 0;
}
int main()
{
	int a[105],b[100],i=0,e=0;
	char d;
	char x[105]={'\0'};
	while (cin>>x)
	{
	   int j4=0;
	while (x[j4]!='\0')
	{
		int c;
		c=x[j4]-'0';
		a[i++]=c;
		j4++;
	}
	d=0,j4=0;
	for (int j=0;j<=i-1;j++)
	{
		e=e*10+a[j];
		b[j]=e/13;
		e=e%13;
	}
	int flag=0;
	for (int i2=0;i2<=i-1;i2++)
	{
		if (b[i2]!=0)
			flag=1;
		if (flag==1)
		    cout<<b[i2];
	}
	if (flag==0)
		cout<<0;
	cout<<endl;
	cout<<e<<endl;
	e=0;
	i=0;
	flag=0;
	for (int j3=0;j3<=99;j3++)
	{
		a[j3]=0;
		b[j3]=0;
	}
	}
}
//*******************************************************************
//*??????????????? ***********************************
//*??????? 1200012979 ****************************************
//*???2012.11.13 *************************************************
//*******************************************************************
int main()
{
	int a[100] , b[100]={0} , i , p , t ; //a????????b?????t???
	char num[100] ;                  //num????
	cin >> num ;
	p = strlen(num) ;               //???????
	for ( i = 0 ; i < p ; i++ )
	  a[i] = num[i] - '0' ;         //???????
	if ( p > 1 )
	{
      for ( i = 1 ; i < p ; i++ )     //??????
	  {
		if ( i >= 2 )               //????????????????????
		{
		   if ( a[i-2] == 0 )
		   {
             b[i] = ( a[i-1] * 10 + a[i] ) / 13 ; //???????
             t = ( a[i-1] * 10 + a[i] ) % 13 ; //t???
			 a[i] = t % 10 ;
             a[i-1] = t / 10 ; 
		   }
	       else
		   {
			  t = ( a[i-2] * 100 + a[i-1] * 10 + a[i] ) % 13 ;
			  b[i] = ( a[i-2] * 100 + a[i-1] * 10 + a[i] ) / 13 ;
		 	  a[i] = t % 10 ;
              a[i-1] = t / 10 ;
			  a[i-2] = 0 ;
		   }
		}
		else                       //??????????????????
		{
			b[i] = ( a[i-1] * 10 + a[i] ) / 13 ;
			t = ( a[i-1] * 10 + a[i] ) % 13 ;
			a[i] = t % 10 ;
            a[i-1] = t / 10 ;
		}
	  }
     if ( b[1] == 0 && p > 2 )
		i = 2 ;
	 else 
		i = 1 ;
	 for ( ; i < p ; i++ )
	  cout << b[i] ;                //????
	  cout << endl ;
	  cout << t << endl;                 //????
	}
	 else
	{
		cout << "0" << endl;
		cout << num[0] << endl;
	}
	return 0;
}
int main()
{
	char a[100];
	scanf("%s",a);
	int b[100];
	int c[100];
	int i,j,k,m,n;
	n=strlen(a);
	for(i=0;i<=n;i++)
	{
		b[i]=a[i]-'0';
	}
	if(n<=2) 
	{
		if(n==1) printf("%c\n%d",'0',b[0]);
		if(n==2) {k=b[0]*10+b[1];printf("%d\n%d",k/13,k%13);}
	}
	else
	{
	c[0]=(b[0]*10+b[1])/13;
	b[1]=(b[0]*10+b[1])%13;
	if(c[0]!=0) printf("%d",c[0]);
	for(i=1;i<n-1;i++)
	{
		c[i]=(b[i]*10+b[i+1])/13;
		b[i+1]=(b[i]*10+b[i+1])%13;
		printf("%d",c[i]); 
	}
	printf("\n");
	printf("%d",b[n-1]);
	}
	
}
main()
{
	char str[101];
	scanf("%s",str);
	int a[100],b[100],c[100],d[100];
	int i,len;
	len=strlen(str);
	for(i=0;i<len;i++)
	{
		a[i]=str[i]-'0';
	}
	b[0]=a[0];
	if(len==1) printf("0");
	if(len==2&&a[1]<3&&a[0]==1) printf("0");
	for(i=0;i<len-1;i++)
	{
		c[i]=b[i]*10+a[i+1];
		b[i]=c[i]%13;
		d[i]=(c[i]-b[i])/13;
		b[i+1]=b[i];
	    if(d[i]==0&&i==0);
		else
		printf("%d",d[i]);
	}
	printf("\n%d",b[len-1]);
}
//********************************
//*????3.cpp                ** 
//*?????13                 **
//*?????? 1200012834      **
//*???2012.11.10             **
//********************************

int main()
{
	char num[101];   // num??????
	int quot[101], r, i, temp, weishu = 0;  // quot????????weishu??????
	cin >> num;
	if (num[1] == '\0' ||
		(num[0] == '1' && (num[1] == '0' || num[1] == '1' || num[1] == '2') && num[2] == '\0'))
	{
		cout << 0 << endl << num;  // ????????0?12??????
	}
	else
	{
		r = num[0] - '0';         // ????r?????????
		for (i = 0; num[i+1] != '\0'; i++)
		{
			temp = r * 10 + num[i+1] - '0';  // temp???????2???
			r = temp % 13;                   // r?temp??13???
			quot[i] = (temp - r) / 13;       // quot[i]????temp??13??
			                                 // ?????????i???
			weishu ++;         // ????????1
			temp = 0;          // temp??
		}
		if (quot[0] != 0)      // ???????????0
		{
			cout << quot[0];   // ?????
		}
		for (i = 1; i < weishu; i++)
		{
			cout << quot[i];   // ????????
		}
		cout << endl << r << endl;  // ????
	}
	return 0;
}