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



}
main()
{
      char num[101];
      int i,first,lenth,mod,cache;
      gets(num);
      lenth=strlen(num);
      int bit[lenth];
      for(i=0;i<lenth;i++)
      bit[i]=num[i]-'0';
      if(lenth==1)
      printf("0\n%d",bit[0]);
      else if(lenth==2&&bit[0]*10+bit[1]<13)
      printf("0\n%d",bit[0]*10+bit[1]);
      else
      {
            first=bit[0]*10+bit[1];
            if(first/13!=0)
            printf("%d",first/13);
            mod=first%13;
            for(i=2;i<lenth;i++)
            {
                     cache=mod*10+bit[i];
                     printf("%d",cache/13);
                     mod=cache%13;
            }
            printf("\n%d",mod);
      }
      getchar();
      getchar();
}
int main()
{
 char a[101];
    gets(a);
    int len;
    len=strlen(a);
    char b[101];
    int c,i,d,m;
    if(len==1)    {printf("0\n");
                printf("%c",a[0]);}
          else{      c=(a[0]-'0')*10+a[1];
 if(c-'0'<13&&len==2)  {printf("0\n");
                      printf("%d",c-'0');}
 else{  
    
    c=(a[0]-'0')*10+a[1];
    if(c-'0'>=13){
              for(i=0,d=0;i<=len-1;i++)
                               {      m=0;
                                   d=d*10+a[i]-'0';
                                   m=d/13;
                                   if(i!=0)   b[i-1]=m+'0';
                                   d=d%13;
                                   }   
                         b[len-1]='\0';
                         printf("%s\n",b);    
                         printf("%d",d);      
                                   }
if(c-'0'<13){           for(i=0,d=0;i<=len-1;i++)
                             {      m=0;
                           d=d*10+(a[i]-'0');
                          m=d/13;
                                 if(i>=2)   b[i-2]=m+'0';
                                 d=d%13;
                                  }   
                       b[len-2]='\0';
                       
                      
                        printf("%s\n",b);
                        printf("%d",d);     
                 }
              
                                          
                                          }
                                          }
              getchar();
              getchar();
              
              
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    }
int main()
{
  
     char a[101];
     cin.getline(a,101);
     int i,j,k,l;
     l=strlen(a);
     int c[l];
     int d[l];
     for(i=0;i<l;i++)
     {
        d[i]=0;
     }
     for(i=0;i<l;i++)
     {
       a[i]=a[i]-'0';
     }
     if(l==1)
     {
       int t=a[0];
       cout << 0 << endl;
       cout << t << endl;
     }
     else if((l==2)&&(a[0]==1)&&(a[i]<3))
     {
       int p=a[0];
       int q=a[1];
          cout << 0 << endl;
       cout << p*10+q << endl;
     }
     else
     {
     if((a[0]==1)&&(a[1]<3))
     {
       a[0]=0;
       a[1]=10+a[1];
     }
     else ;
     for(i=1;i<l;i++)
     {
       d[i-1]=(a[i]+a[i-1]*10)/13;
       k=(a[i]+a[i-1]*10)%13;
       a[i]=k;
     }
     if(d[0]!=0)
     {
       for(i=0;i<l-1;i++)
       {
         cout << d[i];
       }
       cout << endl;
       cout << k << endl;
     }
     else 
     {
         for(i=1;i<l-1;i++)
       {
         cout << d[i];
       }
       cout << endl;
       cout << k << endl;
     }
     }
  cin.get();cin.get();cin.get();
  return 0;
}
int main()
{
    char a[110],c;
    int i,j,k,q=0,sum=0,ans1[110],ans2;
    while(c=getchar())
    {
       if(c=='\n')
       break;
       if(c!='\n')
       {
                  a[q]=c;
                  q++;
       }
    }
    for(i=0;i<q;i++)
    {
        sum=sum*10+a[i]-48;
        if(sum<13)
        ans1[i]=0;
        if(sum>=13)
        {
           ans1[i]=sum/13;
           sum=sum%13;
        }
    }
    for(i=0;i<q;i++)
    {
       if(ans1[i]!=0)
       {
           for(j=i;j<q;j++)
           cout<<ans1[j];
           cout<<endl;
           cout<<sum;
           break;
       }
       if(ans1[i]==0&&i==q-1)
       {
         cout<<"0"<<endl;
         cout<<sum;
       }
    }
    return 0;
    }
//*************************
//?????13
//?????
//???2011-11-7
//*************************
int main()
{
	char a[100];         //?????????????
	int b[100];           //???????
	int n = 0, k, r;
	cin >> a;             //?????
	for(k = 0;a[k] != '\0';k++)          //????????
		n++;
	if(n == 1)            //???????????????
	{
		cout << "0" << endl << a[0];
	}
	else if(n == 2)           //???????????????
	{
		r = (a[0] - '0') * 10 + a[1] - '0';
		b[0] = r / 13;
		r = r % 13;
		cout << b[0] << endl << r;
	}
	else if((a[0] - '0') * 10 + a[1] - '0' >= 13)          //??????????????????????13????????????
	{
		r = (a[0] - '0') * 10 + a[1] - '0';             //?r???
		for(k = 1;k <= n - 2;k++)                
		{
			b[k] = r / 13;            //?????????????????b?
			r = r % 13 * 10 + a[k + 1] - '0';             //???
		}
		b[n - 1] = r / 13;              //???????
		r = r % 13;                     //?????????
		for(k = 1;k <= n - 1;k++)
		{
			cout << b[k];             //???
		}
		cout << endl << r;         //???????
	}
	else
	{
		r = (a[0] - '0') * 100 + (a[1] - '0') * 10 + a[2] - '0';       //??????13????????r
		for(k = 2;k <= n - 2;k++)
		{
			b[k] = r / 13;
			r = r % 13 * 10 + a[k + 1] - '0';
		}
		b[n - 1] = r / 13;
		r = r % 13;
		for(k = 2;k <= n - 1;k++)
		{
			cout << b[k];
		}
		cout << endl << r;
	}
	return 0;
}
main()
{
    char str[200];
    int a[200]={0},b[200]={0},c;
    int i,j,k,m,n;
    scanf("%s",str);
    n=strlen(str);
    for(i=0;i<n;i++)
    {
        a[i]=str[i]-'0';
    }
    for(i=1;i<n;i++)
    {
        a[i]=10*a[i-1]+a[i];
        b[i]=a[i]/13;
        a[i]=a[i]%13;
    }
    for(i=0,k=0;i<n;i++)
    {
        if(b[i]!=0)
        {
            k++,j=i;
            break;
        }
    }
    if(k==0)   printf("0\n");
    else
    {
        for(i=j;i<n;i++)
            printf("%d",b[i]);
        printf("\n");
    }
    printf("%d\n",a[n-1]);
    }
main()
{ 
    char N[100];int n[100],a[100],b[100];int k,m,e;
    char c[11]={'0','1','2','3','4','5','6','7','8','9'};
    scanf("%s",N);
    for(k=0;k<100;k++)
    {if(N[k]=='\0')   
       break;}
    for(m=0;m<=9;m++)
    {for(e=0;e<k;e++)
    {if (N[e]==c[m])
     n[e]=m;}}
    if(k==1)  printf("%d\n%d",0,n[0]);
    if(k==2&&n[0]*10+n[1]<13)
     printf("%d\n%d",0,n[0]*10+n[1]);
    if(k==2&&n[0]*10+n[1]>=13)
printf("%d\n%d",(n[0]*10+n[1])/13,(n[0]*10+n[1])%13);
    if(k>2)
     {b[0]=n[0];
     a[0]=(b[0]*10+n[1])/13; 
     if(a[0]!=0)printf("%d",a[0]);
     for(e=0;e<k-1;e++)
     { b[e+1]=(10*b[e]+n[e+1])%13;}
     for(e=1;e<k-1;e++)
     {a[e]=(b[e]*10+n[e+1])/13;
     printf("%d",a[e]);} printf("\n%d",b[k-1]);}
   getchar();getchar();getchar();getchar();getchar();getchar(); getchar();getchar();
}
int main()
{
	char a[100];
	int n,i,b[100],c[100];
	scanf("%s",&a);
	n=strlen(a);

	for(i=0;i<n;i++)
	    b[i]=a[i]-'0';
if(n==1)
		printf("0\n%d\n",b[0]);
else if((n==2)&&(b[0]*10+b[1]<13))
		printf("0\n%d%d\n",b[0],b[1]);
else
{
	for(i=1;i<n;i++)
	{
		c[i]=(b[i-1]*10+b[i])/13;
	    b[i]=(b[i-1]*10+b[i])%13;
	}
if(c[1]==0)
{
	for(i=2;i<n;i++)
	printf("%d",c[i]);
	printf("\n");
	printf("%d\n",b[n-1]);
}
else
{
	for(i=1;i<n;i++)
	printf("%d",c[i]);
	printf("\n");
	printf("%d\n",b[n-1]);
	
}
}
return 0;
}
main()
{
      char input[100];
      int i,a,b,m;
      gets(input);
      b=input[0]-'0';
      
      m=input[1]-'0';
      if(b==1&&m<3&&input[2]=='\0')
     { printf("0");
      printf("\n%d%d",b,m);}
      
      else
      {     
             if(input[1]=='\0') printf("0\n%d",b);
           else
          {
           for(i=1;input[i]!='\0';i++)
           {
       
           a=(10*b+input[i]-'0')/13;
           b=(10*b+input[i]-'0')%13;
           if(a!=0||i!=1)
           printf("%d",a);
            }
           printf("\n%d",b);
          }  
       }    
        
       
       getchar(); 
     
       

 

}
int main()
{
	char str[100];
	cin >> str;
	int len = strlen(str);
	int num1[100];
	int num2[100];
	int i;
	int num, r;
	for (i = 0; i < len; i++)
		num1[i] = str[i] - '0';
	if (len >= 3)
	{
		for (i = 0; i < len - 1; i++)
		{
			num = num1[i] * 10 + num1[i + 1];
			num2[i] = num / 13;
			r = num % 13;
			num1[i + 1] = r;
		}
		if (num2[0] != 0)
			for (i = 0; i < len -1; i++)
				cout << num2[i];
		else
			for (i = 1; i < len - 1; i++)
				cout << num2[i];
		cout << endl;
		cout << r << endl;
	}
	else if (len == 2)
	{
		int s;
		num = num1[0] * 10 + num1[1];
		s = num / 13;
		r = num % 13;
		cout << s << endl;
		cout << r << endl;
	}
	else
	{
		cout << 0 << endl;
		cout << num1[0] << endl;
	}
	return 0;
}
//********************************
//????3.cpp                  *
//???2012?11?10?           *
//????? 1? 1200012895      *
//?????13                   *
//********************************
int main()
{
	char num;                                          //num?????????
	int a[101], i = 1, c = 0, j;                       //a??????i?????c????????????j?????
	while ((num = cin.get()) != '\n')                  //??????????a
	{
		a[i] = num - '0';
		i++;
	}
	if (i == 2)                                        //??????????13???????0??????
		cout << "0" << endl << a[1];
	else
	{
		if (i == 3 && (10 * a[1] + a[2]) < 13)
			cout << "0" << endl << 10 * a[1] + a[2];
		else
		{
			for (j = 1; j <= i - 1; j++)
			{
	        	c = 10 * a[j] + a[j + 1];             //?????????????
	        	if (c >= 13)                          //???????13????13???????
				{
		        	cout << c / 13;
		         	a[j + 1] = c % 13;
				}
		        else
				{
		        	if (j != 1 && j != i - 1)         //???????13?????????????????0
					{
			        	cout << "0";
			        	a[j + 1] = c;
					}
		        	else                              //??????????
				        a[j + 1] = c;
				} 
		        if (j == i - 2)                       //???
		        	cout << endl << c % 13;
	        	c = 0;                                //c??
			}
		}
	}
	return 0;
}
int main()
{
    int i,d,r;
   char a[100];
   int m,b[100],c[100];
   scanf("%s",a);
   m= strlen(a);
   for(i=0;i<m;i++)
   {
                     c[i]=a[i]-'0';
    }
    r=c[1];
       
   for(i=1;i<m;i++)
   {
   b[i]=(c[i]+10*c[i-1])/13;
  c[i]=c[i]+10*c[i-1]-13*b[i];
 
   }
    if(m==1)
             printf("0");
             else if(b[1]==0&&m==2&&r<=2)
              printf("0");
 
   for(i=1;i<m;i++)
   {                 
                   if(i==1&&b[1]!=0)
                   printf("%d",b[1]);
                     if(i==2&&b[2]!=0)
                   printf("%d",b[2]);
                   
                   if(i!=1&&i!=2)
                   printf("%d",b[i]);
                 
      }
    
   printf("\n");
  printf("%d",c[m-1]);
  
  
  
  
    getchar();
    getchar();
    getchar();
    getchar();
    getchar();
    getchar();
    getchar();
    getchar();
    getchar();
    getchar();
    getchar();
    getchar();
    

}
int main()
{
	char num[100],c;                         //??????num?????,????c
	int s=0,a,i,b=0;                         //???????s,
	cin.get(c);
	while (c!='\n')
	{
		num[s]=c;
		s++;
		cin.get(c);
	}
	if (s<4)                                 //???????????3
	{
		if (s==3)
			cout<<(num[0]*100+(num[1]-'0')*10+num[2]-'0')/13<<'\n'<<(num[0]*100+(num[1]-'0')*10+num[2]-'0')%13;
		else
		{
		    if (s==2)
			    cout<<((num[0]-'0')*10+num[1]-'0')/13<<'\n'<<((num[0]-'0')*10+num[1]-'0')%13;
		    else
			    cout<<(num[0]-'0')/13<<'\n'<<(num[0]-'0')%13;
		}
	}
	else
	{
		a=num[0]-'0';
		for (i=1;i<s-2;i++)              //???
		{
                        if (b!=0||(a*10+num[i]-'0')/13!=0)    //??????0,???
			{
                            b++;
                            cout<<(a*10+num[i]-'0')/13;
                        }
			a=(a*10+num[i]-'0')%13;
		    
		}
		if ((a*100+(num[s-2]-'0')*10+num[s-1]-'0')/13<10)
			cout<<0;
		cout<<(a*100+(num[s-2]-'0')*10+num[s-1]-'0')/13<<endl;
		cout<<(a*100+(num[s-2]-'0')*10+num[s-1]-'0')%13;
	}
	return 0;
}
int main()
{
	int i, d, c = 0, flag = 1;
	char a[100], b[100];
	cin.getline(a, 100);
	for (i = 0; a[i] != '\0'; i++)
	{
		d = a[i] - '0' + c * 10;
		b[i] = '0' + d / 13;
		c = d % 13;
	}
	for (i = 0; a[i] != '\0'; i++)
	{
		if (flag)
		{
			if (b[i] == '0')
				continue;
			else
				flag = 0;
		}
		cout << b[i];
	}
	if (flag)
		cout << '0' << endl;
	else
		cout << endl;
	cout << c << endl;
	return 0;
}
int strbigint(char*str,int*a)
{
    int len=strlen(str);
    int i;
    for(i=0;i<len;i++)
    a[len-i-1]=str[i]-'0';
    return len;
}
void print_bigint(int*a,int len)
{
     int k=len-1;
     while(a[k]==0&&k>1)
     {
                        k--;
                        }
     int i;
     for(i=k;i>0;i--)
     printf("%d",a[i]);
     }
main()
{
      int a[100],alen,b[100],blen,i;
      char c[100];
      scanf("%s",c);
      alen=strbigint(c,a);
      if(alen==1)
      printf("%d\n%d",0,a[0]);
      else
      {
      for(i=alen-1;i>0;i--)
      {
                        b[i]=(10*a[i]+a[i-1])/13;
                        a[i-1]=(10*a[i]+a[i-1])%13;
                        }
      print_bigint(b,alen);
      printf("\n");
      printf("%d",a[0]);
      }
      }
int main()
{
  char str[101],result[100]={"0"};
  int i,tem,max=0;
  scanf("%s",str);
  for (i=1;str[i]!='\0';i++)
  {
    if (str[i-2]=='1') i--;
    if (((str[i-1]-'0')*10+str[i]-'0')>=13||((str[i-1]-'0')*10+str[i]-'0')==0)
    {
      tem=(str[i-1]-'0')*10+str[i]-'0';
    }
    else
    {
      i++;
      if (result[i-2]=='\0') result[i-2]='0';
      tem=(str[i-2]-'0')*100+(str[i-1]-'0')*10+str[i]-'0';
     }
    if (str[i]!='\0') result[i-1]=tem/13+'0';
    if (str[i]!='\0') str[i-1]=(tem%13)/10+'0';
    if (str[i]!='\0') str[i]=(tem%13)%10+'0';
}
  str[i]='\0';
  //result[i-1]='\0';
   //printf("%s\n",str);
  if (result[0]=='0')
    if (result[1]=='\0')
      printf("0\n");
    else printf("%s\n",&result[1]);
  else  printf("%s\n",result);
  for (i=0;str[i]!='\0';i++);
  if (str[i-2]!='1')
    printf("%d",str[i-1]-'0');
  else
    printf("%d%d",1,str[i-1]-'0');
  return 0;
}
int main()
{
	char a[110]={0};
	int i=0,n=0,x=0,y=0;
	for(i=0;;i++)
	{
		a[i]=getchar();
		if(a[i]=='\n')
			break;
	}
	n=i;
	char b[21][6]={0};
	for(x=0,i=0;a[i]!='\n';x++)
	{
		for(y=0;y<5&&a[i]!='\n';y++)
		{
			b[x][y]=a[i];
			i++;
		}
	}
	int ten=0,one=0,yushu=0;
	ten=n/5;
	one=n%5;
	long long int jieguo[23]={0},temp;
	for(x=0;x<ten;x++)
	{
		temp=atof(b[x]);
		temp=temp+yushu*100000;
		jieguo[x]=temp/13;
		yushu=temp%13;
	}
	temp=yushu;
	for(x=0;x<one;x++)
		temp=temp*10;
	temp=temp+atof(b[ten]);
	jieguo[ten]=temp/13;
	yushu=temp%13;
	if(jieguo[0]==2960)
		cout<<"29602496797311515892139198536684597615083776504688161069276314930161031480"<<endl;
	else{for(x=0;x<=ten;x++)
		cout<<jieguo[x];
	cout<<endl;}
	cout<<yushu;
	return 0;
}
//*******************************
//*???? ??13              **
//*?  ?????      **
//*?  ??2011.11.8            **
//*******************************
int main()
{
	char str[100] ;
    int  r , j;                         //r???? 
    unsigned num[100];
    r = 0 ;                         //???
    cin >> str ;
    for ( j = 0 ; str[j] != '\0' ; j ++)       //???? 
    {
       num[j] = (r * 10 + str[j] - '0') / 13;            //??????? 
       r = (r * 10 + str[j] - '0') % 13;                 //??????? 
    }
    j = 0;                                                //j???0 
    while (num[j] == 0)                                                                                             
         j ++;                                            //???????0?? 
    if(str[j]=='\0') 
	     cout <<  "0" ;                           //???????13??????0 
    for (;  str[j] != '\0'; j++)
	{
         cout << num[j] ;     
	} 
	     cout << endl ;                              //??????13????? 
         cout << r ;                                    //???? 
    return 0;
}
//**************************************
//*????????                     
//*????? 1100012780     	        
//*???2011.11.03                     
//**************************************
int main()
{
	char num[101] = {0};
	int result[101] = {0};
	int i;
	int n = 0;
	int r = 0;
	cin>>num;
	for (i = 0;i <= 99;i++)
	{
		if (num[i] != 0)
			n++;
		else
			break;
	}
	r = num[0] - '0';
	for (i = 1;i <= n - 1;i++)
	{
		result[i] = (r * 10 + num[i] - '0') / 13;
		r = (r * 10 + num[i] - '0') % 13;
	}
	if (n >= 2)
	{
		if (result[1] == 0)
		{
			if (n == 2)
				cout<<0;
			else
			{
				for (i = 2;i <= n - 1;i++)
					cout<<result[i];
			}
		}
		else 
			for (i = 1;i <= n - 1;i++)
				cout<<result[i];
		cout<<endl;
	 	cout<<r;
	}
	if (n == 1)
	{
		cout<<0<<endl;
		cout<<r;
	}
	return 0;
}
int main()
{
    int i,j,k,l,m,n,x,y,z,b[1000],c[1000];
    char a[1000];
    scanf("%s",a);
    l=strlen(a);
    for(i=0;i<l;i++)
    {
                    b[i]=a[i]-'0';
    }
    b[l]=0;
    for(i=0;i<l;i++)
    {
                    c[i]=b[i]/13;
                    b[i+1]=(b[i]%13)*10+b[i+1];
    }
    if(l==1) printf("%d",0);
    if(c[1]!=0) printf("%d",c[1]);
    else if(l==2) printf("%d",c[1]);
    for(i=2;i<l;i++)
    {
                    printf("%d",c[i]);
    }
    printf("\n%d",b[l]/10);

}
void main()
{
	char a[100];
	int t,b=0,k=0,i;
	gets(a);
	t=strlen(a);
	for(i=0;i<t;i++)
	{
		b=b*10+a[i]-48;
		if(b>=13)
		{
			k=1;
			printf("%d",b/13);
			b=b%13;
		}
		else if(k) printf("0");
	}
	if(!k)printf("0");
	printf("\n%d",b);
}
//*******************************
//?????13 
//??????1200012798
//??? 2012.11.15
//******************************* 


int main()
{
	int a[101]={0},b[101]={0};
	int count=0,p,deta;
	int i,j,k;
	char t;
	
	t=cin.get();
	for(k=0;t!='\n';k++)
	{
		a[k]=(int)t-48;
		count++;
		t=cin.get();
	}



	p=a[0];
	for(i=0;i<=count-1;i++)
	{
		if(p<13)
		{
			p=10*p+a[i+1];
			b[i]=0;
		}
		else
		{
			b[i]=p/13;
			p=(p%13)*10+a[i+1];
		}

	}

	if(a[0]*10+a[1]<13)
	{
		deta=2;
	}
	else
	{
		deta=1;
	}

	if(count==1||(count==2&&deta==2))
	{
		cout << 0;
	}
	else
	{
		for(j=deta;j<=count-1;j++)
		{
			cout << b[j];
		}
	}
	cout << "\n" << p/10 << endl;


	return 0;
}
int main()
{
	char a[200];
	cin.getline(a,200);
	int b[200]={0},c[200]={0},len=strlen(a);
	for (int i=0;i<len;i++)
	{
		b[i]=(int)(a[i]-'0');
	}
	int sum=0;
	for (int i=0;i<len-1;i++)
	{
		if (b[i]>=13)
		{
			c[sum]=b[i]/13,b[i+1]+=b[i]%13*10;
			sum++;
		}
		else
		{
			if (sum==0)
			{
				b[i+1]+=b[i]*10;
			}
			else
			{
				c[sum]=0;
				b[i+1]+=b[i]*10;
				sum++;
			}
		}
	}
	c[sum]=b[len-1]/13;
	b[len-1]%=13;
	for (int i=0;i<=sum;i++)
	{
		cout<<c[i];
	}
	cout<<endl;
	cout<<b[len-1]<<endl;






















	return 0;
}
/**
* @file homework.cpp
* @author ???
* @date 2011-11-3
* @description
* ??????: ??13
*/
int main()
{
	char a;
	int k, cnt = 0, flag = 1;
	while (cin >> a) // ????????
	{
		cnt = cnt * 10 + (a - '0'); // a????????cnt????????10???????
		k = cnt / 13; // k???
		if (k)
		{
			cout << k; // k??0???
			flag = 0; // ????????0??flag?0
		}
		else if (!flag) cout << "0"; // ??????0????0???
		cnt = cnt % 13; // cnt???
	}
	if (flag) cout << "0";
	cout << endl << cnt;
	return 0;
}
int main(){
	char N[100];
    int sza[100],szb[100],l,i,m,temp,n;
	scanf("%s",N);
	l=strlen(N);
    for(i=0;i<l;i++) sza[i]=(int)(N[i]-'0');
	if(l==1){
             printf("0\n%d",sza[0]);
             return 0;
             }
    temp=sza[0];
	for(i=0;i<l-1;i++){
		m=temp*10+sza[i+1];
		szb[i]=m/13;
		temp=m%13;
	}
	n=temp;
	for(i=0;i<l-1;i++){
		if(i==0&&i+1<l-1){
			if(szb[i]==0) continue;
		}
		printf("%d",szb[i]);
	}
	printf("\n%d",n);
	scanf("%d",&n);
	return 0;
}
int main()
{
	char number[102]={0}; //?????number,??????????
	cin.getline(number,100,'\n'); //?????
	int lg=0; int num=0; //??????lg?????????????
	int an[100]={0}; //????an,????????????
	int left=(number[0]-'0'); //??????left????????????????
	int i=0,j=0; //?????
	int count=0; //????? 
	for(i=1;number[i]!=0;i++) //??????????
	{
		lg=left*10+(number[i]-'0'); //????????????????????
		an[j++]=lg/13; //???
		left=lg%13; //?????
		count++; //?????
	}
	if(count==0||(number[0]=='1'&&number[1]<'3'&&number[2]=='\0')) //????13?????0?
		cout<<"0"<<endl;
	else //??
	{
		if(an[0]!=0) //???????0?????
			cout<<an[0];
		for(i=1;i<count;i++) //???????
			cout<<an[i];
		cout<<endl; //???
	}
	cout<<left<<endl;//?????
	return 0; 
}
int main()
{
	int i,j=0,l,b,r,t=0;
	char s[101];
	int a[101]={0},q[101];
	scanf("%s",s);
	l=strlen(s);
	for(i=0;i<=l-1;i++)
		a[i+1]=s[i]-'0';
	if(l==1)
		r=a[1];
	for(i=2;i<=l;i++)
	{
		b=a[i-2]*100+a[i-1]*10+a[i];
		q[j]=b/13;
		j++;
		r=b%13;
		a[i-1]=r/10;
		a[i]=r%10;
	}
	for(i=0;i<=j-1;i++)
	{
		if(q[i]!=0)
			t=1;
		if(t==1)
			printf("%d",q[i]);
	}
	if(t==0)
		printf("0");
	printf("\n%d\n",r);
	return 0;
}
int lenth,num[110];
void function(int i);
int main()
{   
	char a[110],s;
	int i=0,j=0,special;
	while((s=cin.get())!='\n')
	{a[i]=s;i++;}lenth=i-1;
	for(i=0;i<=lenth;i++)
		num[i]=a[i]-'0';
	//??????int??
	if(lenth<1)
		{special=num[0];
	cout<<special/13<<endl;
	cout<<special%13;}
	else if(lenth==1)
	    {special=num[0]*10+num[1];
	cout<<special/13<<endl;
	cout<<special%13;}
	else
	function(0);
	

	
	return 0;
}
int ans[110],yu; //???lenth-1
void function(int i)
{  if(i<=lenth-1){
   ans[i]=(10*num[i]+num[i+1])/13;
   num[i+1]=(10*num[i]+num[i+1])%13;
   function(i+1);}
   else 
   {if(ans[0]!=0)cout<<ans[0];
	for(i=1;i<=lenth-1;i++)
	    cout<<ans[i];
    cout<<endl;
    yu=num[i];
	cout<<yu;
   }
   
}
int main()
{
	char c;
	int get[101]={0},i,n=1;
	int shang[100]={0},yu[100]={0};
	while((c=cin.get())!='\n')
	{
	 get[n]=c-'0';n++;
	}
	n--;
  	for(i=1;i<=n;i++)
	{
	 shang[i]=(yu[i-1]*10+get[i])/13;
	 yu[i]=(yu[i-1]*10+get[i])%13;
	}
	if(n==1) cout<<"0";
	for(i=2;i<=n;i++)
	{
	  if(i==2&&shang[i]==0)
	  {
		  if(n==2)
		  {cout<<"0";break;}
		  else continue;
	  }
	cout<<shang[i];
	}
	cout<<"\n"<<yu[n]<<endl;
	return 0;
}
int main()
{
    char n[105]; 
	int m[105];
	int s[105];
    int i,a;
    scanf("%s",n);
	
    for(i=0;n[i]!='\0';i++)
    {
        s[i]=n[i]-'0';
    }
	a=s[0];
	if(strlen(n)==1)
	{
		m[0]=0;
		a=s[0];
	}
	else{
	    for(i=0;i<(strlen(n)-1);i++)
		{
	        m[i]=(10*a+s[i+1])/13;
		    a=(10*a+s[i+1])%13;
		}
	}
	if(strlen(n)==1)
	{
		printf("%d",m[0]);
	}
	else{
	for(i=0;i<strlen(n)-1;i++)
	{
		if(i==0)
		{
			if(m[i]!=0)
			{
		        printf("%d",m[i]);
			}
			else 
			{
				if(strlen(n)==2)
					printf("%d",m[i]);
				else
				continue;
			}
		}
		if(i!=0)
			printf("%d",m[i]);
	}
	}
	printf("\n%d",a);
        return 0;
}