semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
    char a[105]; int t[100], u[100], flag=1, tmp, j; memset (a,0,sizeof(a)); memset(t,0,sizeof(t));memset (u,0,sizeof(u));
    cin.getline(a, 105);
    for (int i=0; i<strlen(a); i++)
        t[i]=a[i]-'0';
    if (strlen(a)==1)
        cout << t[0]/13 << endl << t[0]%13 << endl;
    else if (strlen(a)==2)
        cout << (10*t[0]+t[1])/13<< endl<< (10*t[0]+t[1])%13 <<endl;
    else
    {
        tmp=10*t[0]+t[1]; u[0]=tmp/13;
        for (int i=2;i<strlen(a);i++)
        {
            tmp%=13;
            tmp=t[i]+tmp*10;
            u[flag]=tmp/13;
            flag++;
        }
        tmp%=13;
        for (j = 0; j < flag; j++)
            if (u[j]!=0) break;
        for (;j<flag;j++)
            cout << u[j];
        cout << endl;
        cout << tmp<<endl;
    }
    return 0;
}
int main()
{
   int i,len,remain,num,size=0;
   char N[101];
   cin>>N;
   len=strlen(N);
   remain=0;
   if(len==1)
	   cout<<0<<endl<<N<<endl;
   else if(len==2 && N[0]=='1' && N[1]<'3')
            cout<<0<<endl<<N<<endl;
   else
   {
       for(i=0;i<len;i++)
	   {
          num=remain*10+N[i]-'0';
	      if(num<13) 
		  {
		      remain=num;
	          N[i]=0+'0';
		  }
	      else 
		  {
	          N[i]=num/13+'0';
              remain=num%13;
		  }

	   }
       for(i=0;i<len;i++)
	   {
          if(N[i]!='0')
		  {
	         size=i;
		     break;
		  }
	   }
       for(i=size;i<len;i++)
       cout<<N[i];
       cout<<endl;
       cout<<remain<<endl;
   }
  return 0;
}
int main ()
{
    char a[100];
    scanf("%s",a);
    int n,i,m,f,j;
    n=strlen(a);
    int b[99];
    if(n==1)
    {
            printf("0\n");
            printf("%d",a[0]-'0');
    }
    else if(((a[0]-'0')*10+(a[1]-'0'))<13&&n==2)
    {
            printf("0\n");
            printf("%d",((a[0]-'0')*10+(a[1]-'0')));
    }
    else
    {
    m=((a[0]-'0')*10+(a[1]-'0'))/13;
    f=((a[0]-'0')*10+(a[1]-'0'))%13;
    if(m==0)
    {
            m=((a[0]-'0')*100+(a[1]-'0')*10+(a[2]-'0'))/13;
            f=((a[0]-'0')*100+(a[1]-'0')*10+(a[2]-'0'))%13;
            printf("%d",m);
            for(i=1;i<n-2;i++)
            {
                            b[i]=(f*10+(a[i+2]-'0'))/13;
                            f=(f*10+(a[i+2]-'0'))%13;
                            printf("%d",b[i]);
            }
            printf("\n");
            printf("%d",f);
    }
    else
    {
            printf("%d",m);
            for(i=1;i<n-1;i++)
            {
                            b[i]=(f*10+(a[i+1]-'0'))/13;
                            f=(f*10+(a[i+1]-'0'))%13;
                            printf("%d",b[i]);
            }
            printf("\n");
            printf("%d",f);
    }
    }
    return 0;
}
main()
{
      int a[N] = {0}, c[N] = {0};
      int i, k, d;
      char a1[N];  
      scanf("%s", a1);
      k = strlen(a1);
      for(i = 0; i < k; i++) a[i] = a1[k - i - 1] - '0';
      d = 0;
      for(i = k - 1; i >= 0 ; i--)
      {
            d = d * 10 + a[i];
            c[i] = d / 13;
            d = d % 13;   
      }   
      while(c[k - 1] == 0 && k > 1) k--;  
      for(i = k - 1; i >= 0; i--) printf("%d", c[i]);
      printf("\n%d", d);
      getchar();
      getchar();
      getchar();   
}
int c,d;
void cal(int b[105],int i,int k,int n)
{
	if(i<n)
	{
	c=(k*10+b[i])/13;
	k=(k*10+b[i])%13;
	if(i!=1)
	cout<<c;
	else
	{
		if(c>0)
			cout<<c;
	}
	cal(b,i+1,k,n);
	}
	if(i==n-1)
		cout<<endl<<k;
}
int main()
{
	char a[105];
	cin>>a;
	int i,j,k,m,n;
	n=strlen(a);
	int b[105];
	for(i=0;i<n;i++)
	{
		b[i]=a[i]-'0';
	}
	if(n==1)
		cout<<"0"<<endl<<b[0];
	else
	{
		if(n==2&&b[0]==1&&b[1]<3)
			cout<<"0"<<endl<<10+b[1];
		else
	       cal(b,1,b[0],n);
	}
	
	return 0;
}
int main()
{
	int i,j,k,a[100],b[100],x;
	char num[101];
	memset(num,0,sizeof(num));
	scanf("%s",num);
	for(i=0;i<strlen(num);i++)
	{
		a[i]=b[i]=0;
		a[i]=num[i]-'0';
	}
	if(i==1)
	{
		printf("0\n%d\n",a[0]);
	}
	else
	{
		x=a[0];
		for(j=1;j<strlen(num);j++)
		{
			a[j]=10*x+a[j];
			b[j]=a[j]/13;
			x=a[j]%13;
		}
		if(b[1]!=0)
		{
			printf("%d",b[1]);
		}
		else if(j==2)
		{
			printf("%d",b[1]);
		}
		for(k=2;k<strlen(num);k++)
		{
			printf("%d",b[k]);
		}
		printf("\n%d",x);
	}
	return 0;
}
int main()
{
	char num[100];
	int a, b;
	cin >> num;
	if (num[1] == '\0')
		cout << '0' << '\n' << num[0];
	else
	{
		a = ((num[0] - '0') * 10 + (num[1] - '0')) / 13;
		b = ((num[0] - '0') * 10 + (num[1] - '0')) % 13;
		if (a != 0 || num[2] == '\0')
			cout << a;
		for (int i = 2; num[i] != '\0'; i++)
		{
			a = (b * 10 + (num[i] - '0')) / 13;
			b = (b * 10 + (num[i] - '0')) % 13;
			cout << a;
		}
		cout << '\n' << b << endl;
	}
	return 0;
}
int main()
{
    int i,j,k,a,l;
    int c;
    char s[101],r[101];
    gets(s);
    l=strlen(s);
    if(l==2)
    {
     a=(s[0]-'0')*10+s[1]-'0';
    printf("%d\n%d",a/13,a%13);
    }
    if(l==1)
    printf("0\n%c",s[0]);
    if(l>=3){
     c=s[0]-'0';
     if(c*10+s[1]-'0'>=13)
     {
       for(i=0;s[i+1]!='\0';i++)
       {
         a=c*10+s[i+1]-'0';
         r[i]=a/13+'0';
         c=a%13;
       }
       r[i]='\0';
       printf("%s\n%d",r,c);
                          }
       else  
       {   
          c=c*10+s[1]-'0';
        for(i=0;s[i+2]!='\0';i++)
       {
         a=c*10+s[i+2]-'0';
         r[i]=a/13+'0';
         c=a%13;
       }
       r[i]='\0';
       printf("%s\n%d",r,c);
                          }}
}
int main()
{
char n[100];
int a[100],b[100],yu,i,j,x;
scanf("%s",n);
    x=strlen(n);
for (i=0;i<x;i++)
{
a[i]=n[i]-'0';}
if (x==1) printf("0\n%d",a[0]); else
if (x==2&&(a[0]*10+a[1]<13)) {printf("0\n%d",a[0]*10+a[1]);}
    else
{
b[0]=(10*a[0]+a[1])/13;
yu=(10*a[0]+a[1])%13;
if(b[0]!=0)
{
printf("%d",b[0]);
for (i=2;i<x;i++)
{
b[i-1]=(yu*10+a[i])/13;
yu=(yu*10+a[i])%13;	
}
for (i=1;i<x-1;i++)printf("%d",b[i]);
printf("\n%d",yu);
}
if (b[0]==0) 
{
b[0]=(100*a[0]+10*a[1]+a[2])/13;
yu=(100*a[0]+10*a[1]+a[2])%13;
printf("%d",b[0]);
for (i=3;i<x;i++)
{
b[i-2]=(yu*10+a[i])/13;
yu=(yu*10+a[i])%13;	
}
for(i=1;i<x-2;i++) printf("%d",b[i]);
printf("\n%d",yu);
}
}	
return 0;
}
main()
{
      int d,l,s,i,r=0,p,q;
      char a[10000],b[10000];
      scanf("%s",a);
      l=strlen(a);
      r=a[0]-'0';
      if((a[0]-'0')*10+a[1]-'0'<=13&&l==2)
      {q=10*r+a[1]-'0';
      r=q%13; 
      printf("0\n%d",r);}
      else if(l==1)
      {q=a[0]-'0';
      r=q%13;
      printf("0\n%d",r);}
     else 
     {
     
      for(i=1;i<l;i++)
      {
                        q=10*r+a[i]-'0';
                        p=q/13;
                        r=q%13;
                        b[i-1]=p+'0';
      }
      s=strlen(b);
      if(b[0]=='0'&&s>1)
      {{for(i=0;i<s-1;b[i]=b[i+1],i++);}b[s-1]='\0';}
      b[s]='\0';
      printf("%s\n%d",b,r);
      }
}
main()
{
    char s[100],a[100]={0};
    int d;
    int l,m,r,i,j,k;
    gets(s);
    l=strlen(s);
    if(l==1)
    {
        printf("0\n");
        puts(s);
    }
    if((l==2)&&(s[0]=='1'))
    {
        r=(s[0]-'0')*10+s[1]-'0';
        printf("%d\n",r/13);
        printf("%d",r%13);
    }
    if((l==2)&&(s[0]!='1'))
    {
        r=(s[0]-'0')*10+s[1]-'0';
        printf("%d\n",r/13);
        printf("%d",r%13);
    }
    if(l>=3)
    {
        for(i=0;i<l;i++)
            s[i]=s[i]-'0';
        for(i=0;i<l-1;i++)
        {
            r=s[i]*10+s[i+1];
            if(i<l-2)
            {
                if(r>=13)
                {
                    a[i]=r/13;
                    s[i+1]=r%13;
                }
                else
                {
                    a[i]=0;
                    s[i+1]=s[i]*10+s[i+1];
                }
            }
            else
            {
                if(r>=13)
                {
                    a[i]=r/13;
                    k=r%13;
                }
                else
                {
                    a[i]=0;
                    k=r;
                }
            }
        }
    if(a[0]!=0)
        for(i=0;i<l-1;i++)
            printf("%d",a[i]);
    else
        for(i=1;i<l-1;i++)
            printf("%d",a[i]);
    printf("\n");
    printf("%d",k);
    }
}
//????????
int main()
{
    char s[10000];
    int len,i,j=0,k=0,t=0;
    int a[10000],b[10000]={0};
    cin >>s;
    len=strlen(s);
    a[0]=len;
    for (i=1;i<=len;i++)
        a[i]=(int)s[i-1] -48;
    if (len==1)
    {
        cout <<a[1]/13<<endl;
        cout <<a[1]%13<<endl;
    }
    else
    if (len==2)
    {
        j=10*a[1]+a[2];
        cout <<j/13<<endl;
        cout <<j%13<<endl;
    }
    else
    {
        j=a[1]*10+a[2];
        i=2;
        k=1;
        while (i<len)
        {
            b[k]=j/13;
            j=j-b[k]*13;
            i++;
            j=j*10+a[i];
            k++;
        }
        b[k]=j/13;
        j=j-b[k]*13;
        t=1;
        while (b[t]==0) t++;
        for (i=t;i<=k;i++)
            cout <<b[i];
        cout <<endl;
        cout <<j<<endl;
    }
    return 0;
}
int main()
{
	char num[100];
	int result[100];
	memset(num,'0',100);
	memset(result,0,100);
	int yushu = 0, len, i = 0, j = 0;
	cin.getline(num,100);
	len = strlen(num);
	if (len == 1)
	{
		cout << 0 << endl;
		cout << num[0] << endl;
	}
	else
	{
		result[0] = ((num[0] - '0') * 10 + num[1] - '0') / 13;
		yushu = ((num[0] - '0') * 10 + num[1] - '0') % 13;
		for (i = 1; i <= len - 2; i++)
		{
			result[i] = (yushu * 10 + num[i + 1] - '0') / 13;
			yushu = (yushu * 10 + num[i + 1] - '0') % 13;
		}
		if ((result[0] == 0) && len > 2)
			j = 1;
		for (j; j < i; j++)
			cout << result[j];
		cout << endl;
		cout << yushu << endl;
	}
	return 0;
}
int main(){
    char n[1000];
    int a[1000];
    int i,yu,len,sh;
    scanf("%s",&n);
    len=strlen(n);
    for(i=0;i<len;i++)
       a[i]=n[i]-48;
    if(len==1)  printf("0\n%s",n);
    if(len==2&&(10*a[0]+a[1])<13) printf("0\n%s",n);
    if(len>2||(len==2&&(10*a[0]+a[1])>=13)) 
    {    
         if((10*a[0]+a[1])>=13) { yu=(10*a[0]+a[1])%13;sh=(10*a[0]+a[1])/13;printf("%d",sh);}
         if((10*a[0]+a[1])<13){yu=10*a[0]+a[1];}
         for(i=2;i<len;i++)
         {
             
             sh=(10*yu+a[i])/13;
             yu=(10*yu+a[i])%13;
             printf("%d",sh);
         }
         printf("\n");
         printf("%d",yu);
    }
scanf("%d",&i);    
return 0;    
    
}
int div13(int A)
{
 int div;
 if (A>=13*9)
    div=9;
 else 
 {
  if (A>=13*8)
  {
   div=8;
  }
  else
  {
   if (A>=13*7)
   {
    div=7;
   }
   else
   {
    if (A>=13*6)
    {
     div=6;
    }
    else
    {
     if (A>=13*5)
     {
      div=5;
     }
     else
     {
      if (A>=13*4)
      {
       div=4;
      }
      else
      {
       if (A>=13*3)
       {
        div=3;
       }
       else
       {
        if (A>=13*2)
        {
         div=2;
        }
        else
        {
         if (A>=13*1)
         {
          div=1;
         }
         else
         {
          div=0;
         }   
        }   
       }   
      }   
     }   
    }   
   }
  }
 }
 return div;
}

int lev13(int A)
{
 int lev;
 if (A>=13*9)
 {   
    lev=A-13*9;
 }
 else 
 {
  if (A>=13*8)
  {
   lev=A-13*8;
  }
  else
  {
   if (A>=13*7)
   {
    lev=A-13*7;
   }
   else
   {
    if (A>=13*6)
    {
     lev=A-13*6;
    }
    else
    {
     if (A>=13*5)
     {
      lev=A-13*5;
     }
     else
     {
      if (A>=13*4)
      {
       lev=A-13*4;
      }
      else
      {
       if (A>=13*3)
       {
        lev=A-13*3;
       }
       else
       {
        if (A>=13*2)
        {
         lev=A-13*2;
        }
        else
        {
         if (A>=13*1)
         {
          lev=A-13*1;
         }
         else
         {
          lev=A;   
         }   
        }   
       }   
      }   
     }   
    }   
   }
  }
 }
 return lev;
}

main()
{
 char dvdd[100];
 char ans[100];
 int N, div, lev, a, head;
 int i;
 for (i=0; i<100; i++)
     ans[i]='0';
 scanf("%s", dvdd);
 N=strlen(dvdd);
 lev=0;

 for (i=0; i<=N-1; i++)
 {
  a=dvdd[i]-'0'+lev*10;
  div=div13(a);
  lev=lev13(a);
  ans[i]=div+'0';   
 }
 if (N==1)
 {
    printf("0\n");
    printf("%d\n", lev); 
 }
 else
 {
  head=(dvdd[0]-'0')*10+(dvdd[1]-'0');
  if (head<13)
  {
   if (N==2)
      printf("0\n");
   else
   {
    for (i=2; i<=N-1; i++)
        printf("%c", ans[i]);
    printf("\n");
   }         
   printf("%d\n", lev);   
  }
  else
  {
   for (i=1; i<=N-1; i++)
        printf("%c", ans[i]);
   printf("\n");
   printf("%d\n", lev);   
  }
 }
}
main()
{
      int d,q,r,l,i,m;
      char dividend[10000],quotient[10000];
      scanf("%s",dividend);
      l=strlen(dividend);
      if(l==1)
      printf("%c\n%d",'0',dividend[0]-'0');
else{
      r=dividend[0]-'0';
      for(i=1;i<l;i++)
      {
                      m=dividend[i]-'0'+10*r;
                      q=m/13;
                      r=m%13;
                      quotient[i-1]=q+'0';
      }
      quotient[l-1]='\0';
      if(quotient[0]=='0'&&l>2)
      {for(i=0;i<l;quotient[i]=quotient[i+1],i++);}
      printf("%s\n%d",quotient,r);
    }
}
int main()
{
	char a[100], b[100];
	int i, m, k, l = 0, j, flag, x, y;
	i = 0;
	flag = 0;
	cin.getline(a,100);
    j = strlen(a);
	if (j >= 2)
	{
		if (j >= 3)
		{
			while (i < j)
			{
				m = l * 10 + a[i] - '0';
				b[i] = m / 13 + '0';
				l = m % 13;
				i = i + 1;
			}
			for (k = 0; k < i; k ++)
			{
				if ((b[k] != '0') || (flag == 1))
				{
					cout << b[k];
					flag = 1;
				}
			}
			cout << endl << l;
		}
		else 
		{
			m = ((a[0] - '0') * 10 + a[1] - '0');
			x = m / 13;
			y = m % 13;
			cout << x << endl << y;
		}
	}
	else
		cout << "0" << endl << (a[0] - '0');
	return 0;
}
int main()
{
	char bei0[105];
	int bei[105]={0},shang[105]={0};
	int beichu,yushu;
	int yu[4];
	int i,j;
	cin.getline(bei0,102,'\n');
	int n;
	n=strlen(bei0);		//?????????
	for(i=0;i<=n-1;i++)
		bei[i+1]=bei0[i]-'0';	//??char???????????int?,?bei[1]???
	
	if(n==1)
		cout<<"0"<<endl<<bei[1]<<endl;

	else if(n==2&&(bei[1]*10+bei[2]<13))
		{cout<<"0"<<endl;
		 cout<<bei[1]*10+bei[2]<<endl;}
	
	else
	{
	yu[1]=bei[0];
	yu[2]=bei[1];
	yu[3]=bei[2];
	
	for(i=3;i<=n;i++)
	{
		beichu=yu[1]*100+yu[2]*10+yu[3];
		shang[i-2]=beichu/13;
		yushu=beichu%13;
		if(yushu<10)
			{yu[1]=0;yu[2]=yushu;}
		else 
			{yu[1]=1;yu[2]=yushu%10;}
		yu[3]=bei[i];
	}
	beichu=beichu=yu[1]*100+yu[2]*10+yu[3];
	shang[n-1]=beichu/13;
	yushu=beichu%13;
	if(shang[1]==0)
	{
		for(i=2;i<=n-1;i++)
			cout<<shang[i];
	}
	else
	{
		for(i=1;i<=n-1;i++)
		cout<<shang[i];
	}
	cout<<endl;
	cout<<yushu<<endl;
	}
	return 0;
}
int main()
{
	char a[100];
	int i, l, r, L, j, b[100];
	gets(a);
	l = strlen(a);
	if (l == 1)
	{
		cout << "0" << endl;
	    cout << a[0] - '0';
    }
	if (l == 2)
	{
		b[0] = (10 * (a[0] - '0') + a[1] - '0') / 13;
		r = (10 * (a[0] - '0') + a[1] - '0') % 13;
		cout << b[0] << endl;
	    cout << r;
    }
	if (l > 2)
	{
	    L = l - 2;
	    b[0] = (100 * (a[0] - '0') + 10 * (a[1] - '0') + a[2] - '0') / 13;
	    r = (100 * (a[0] - '0') + 10 * (a[1] - '0') + a[2] - '0') % 13;
	    for (i = 1; i < L; i++)
		{
		    b[i] = (10 * r + a[i + 2] - '0') / 13;
	        r = (10 * r + a[i + 2] - '0') % 13;
		}
	    for (i = 0; i < L; i++)
	        cout << b[i];
	    cout << endl << r;
	}
    return 0;
}
/************************************
5.cpp
???Nov 2, 2011
??(12-11) ??13
?? 1100012886
************************************/

int main()
{
	int i = 0, dividend = 0;
	char n[100];
	cin >> n;
	do
	{
		dividend = dividend * 10 + n[i] - '0';
		i++;
	} while ((dividend < 13) && (n[i] != '\0')); //????????
	while (n[i] != '\0')
	{
		cout << dividend / 13; //????i+1?????
		dividend = (dividend % 13) * 10 + n[i] - '0'; //?????
		i++;
	}
	cout << dividend / 13 << endl; //???????
	cout << dividend % 13 << endl; //????????????
	return 0;
}
int main(){
	char str[1100],stre[1100];
	scanf("%s", str);
	int a=strlen(str),l=(str[0]-'0'),t,i,j,x=0,y;
	if(((a==2)&&(str[1]-'0')<3&&(str[0]-'0')==1)||(a==1)){
		printf("0");
		printf("\n%s",str);
	}
	else if((a>2)||(a==2&&(str[0]-'0')*10+(str[1]-'0')>=13)){
	for(i=0;i<a-1;i++){
		t=l%13;
		stre[i]=l/13+'0'; 
		l=t*10+str[i+1]-'0';
	}
    stre[a-1]=l/13+'0'; 
	for(i=0;i<a;i++){
		if((stre[i]-'0')!=0){
			x++;
		}
		if(x!=0){
			printf("%c",stre[i]);
		}
	}
	y=l%13;
	printf("\n%d",y);
	}
		
	return 0;
}
main()
{
      char c[100],v[100];
      int a,b,d,e,i,m;
      scanf("%s",c);
      if(c[1]=='\0')
      {
      printf("0\n");
      printf("%c\n",c[0]);
      }
      else            
      if((c[2]=='\0')&&(((c[0]-'0')*10+c[1]-'0')<=13))
      {
                  printf("0\n");
                  m=(c[0]-'0')*10+c[1]-'0'; 
                  printf("%d\n",m);
      }
      else
      if(((c[0]-'0')*10+c[1]-'0')>=13)
      {
      a=((c[0]-'0')*10+c[1]-'0')%13;
      b=((c[0]-'0')*10+c[1]-'0')/13;
      v[0]=b+'0';
      for(i=2;c[i]!='\0';i++)
      {
                  d=(a*10+c[i]-'0')%13;
                  b=(a*10+c[i]-'0')/13;
                  a=d;
                  v[i-1]=b+'0';
      }
      v[i-1]='\0';
      printf("%s\n",v);
      printf("%d\n",a);
      }
      else
      if(c[3]=='\0')
      {
      d=((c[0]-'0')*100+(c[1]-'0')*10+c[2]-'0')/13;
      e=((c[0]-'0')*100+(c[1]-'0')*10+c[2]-'0')%13;
      printf("%d\n",d);
      printf("%d\n",e);
      }
      else
      {
          d=((c[0]-'0')*100+(c[1]-'0')*10+c[2]-'0')/13;
          e=((c[0]-'0')*100+(c[1]-'0')*10+c[2]-'0')%13;
          for(i=3;c[i]!='\0';i++)
          {
                            v[i-3]=d+'0';
                            c[i-2]=e+'0';
                            e=((c[i-2]-'0')*10+c[i]-'0')%13;
                            d=((c[i-2]-'0')*10+c[i]-'0')/13;
                            c[i-1]=e+'0';
                            v[i-2]=d+'0';
          }
          v[i-2]='\0';
          printf("%s\n",v);
          printf("%d\n",e);
      }
      getchar();
      getchar();
      }
main()
{
      char a[1000],d[100];
      int c[100],b[100],x=0,i,j,l;
      scanf("%s",a);
           for(i=0;a[i]!='\0';i++) 
           {
                 c[i]=a[i]-'0'; 
            }//????? ??c?0??c?i1?
           if(i<=1)
           {
           d[0]='0';
           d[1]='\0';
           x=c[0];
           } 
           else if(i==2&&c[0]==1&&c[1]<3)
           {
                d[0]='0';
                d[1]='\0';
                x=c[0]*10+c[1];
                }
           else 
           {
                if(c[0]==1&&c[1]<3)
           {
                  b[0]=(c[0]*100+c[1]*10+c[2])/13;//?????13 
                  x=(c[0]*100+c[1]*10+c[2])%13;//???? 
                  j=3;
           }
           else
           {
                  b[0]=(c[0]*10+c[1])/13;//?????13 
                  x=(c[0]*10+c[1])%13;//???? 
                  j=2;
           }
            int k=0;
            for(;j<i;j++)
           {
                   k++;
                   b[k]=(x*10+c[j])/13;//????10?????? 
                   x=(x*10+c[j])%13;//????? 
           }
           for(j=0;j<=k;j++)
                   d[j]=b[j]+'0';
           d[k+1]='\0';
           }
           printf("%s\n%d",d,x);
      getchar();
      getchar();
}
int main()
{
	char num[101] = {0},ans[101]={0};
	char ch;
	int ni,sh = 0,i,l,ys = 0,flag;
	cin >> num;
	l = strlen(num);
	for (i = 0;i <= l-1;i++)
	{
		ni = num[i] - '0';
		ys = ys * 10 + ni;
		sh = ys / 13;
		ch = (char) (sh + 48);
		ans[i] = ch;
		ys = ys - sh * 13;
	}
	flag = 0;
	for (i = 0;i <= l-1;i++)
	{	
		if (ans[i] != '0')
			flag = 1;
		if (flag == 1) 
			cout << ans[i] ;
	}
	if (flag == 0) 
		cout << '0'; 
	cout << endl;
	cout << ys;
    return 0;
}
main()
{
 char N[101];
 int n[100], dvd[100], left=0, len;
 memset(dvd, 0, 100*sizeof(int));
 int i, temp;
 gets(N);
 len=strlen(N);
 for (i=0; i<len; i++)
   n[i]=N[i]-'0';  
 for (i=0; i<len; i++)
 {
  temp=left*10+n[i];
  dvd[i]=temp/13;
  left=temp%13;   
 }
 for (i=0; i<len; i++)
 {
  if (dvd[i]!=0)
     break;   
 }
 if (i==len) printf("0\n");
 else
 { 
  for (; i<len; i++)
  {
   printf("%d", dvd[i]);   
  }
  printf("\n");
 }
 printf("%d", left);

}
int main()
{
	char number[110]={0};
	cin>>number;
	char shang[110]={0};
	int yushu=0;
	if(strlen(number)>=2)//????????
	{
	for(int i=0;i<strlen(number)-1;i++)//??????
	{
		int a=(number[i]-'0')*10+(number[i+1]-'0');
		shang[i]=a/13+'0';
		number[i+1]=a%13+'0';
	}
	yushu=number[strlen(number)-1]-'0';
	}
	else
	{
		shang[0]='0';
		yushu=number[strlen(number)-1]-'0';
	}
	if(shang[0]!='0'||shang[1]==0)//??
	{
		cout<<shang<<endl;
	}
	else
	{
		for(int i=1;i<strlen(shang);i++)
		{
			cout<<shang[i];
		}
		cout<<endl;
	}
	cout<<yushu;//??

	return 0;
}
int main()
{
	int i,j=0,len,num1,num2;
	int a[110]={0},b[110]={0};
	char ch[110]={0};
	cin.getline(ch,110);
	len=strlen(ch);
	for(i=0;i<len/2*2-1;i+=2)
	{
		a[j]=10*(ch[i]-'0')+ch[i+1]-'0';
		j++;
	}
	if(len%2)
	{
		a[j]=ch[len-1]-'0';
		j++;
	}
	num1=j;
	for(i=0;i<num1;i++)
	{
		b[i+1]+=(b[i]+a[i])%13*100;
		b[i]=(b[i]+a[i])/13;
	}
	if(b[0])
		cout<<b[0];
	else if(num1==1)
		cout<<b[0];
	for(i=1;i<num1-1;i++)
	{
		if(b[i]<10)
			cout<<0;
		cout<<b[i];
	}
	if(len>2)
	{
		if(len%2)
			cout<<b[num1-1];
		else
		{
			if(b[i]<10)
				cout<<0;
			cout<<b[i];
		}
	}
	cout<<endl;
	b[num1]=b[num1]/100;
	cout<<b[num1]<<endl;
	return 0;
}
main()
{
      int n,m=0,i,j;
      char a[101],b[100];
      scanf("%s",a);
      n=strlen(a);
      if(n==1||(n==2&&a[0]-'0'==1&&a[1]-'0'<3))
       printf("0\n%s",a);
      else
      {
      for(i=0;i<=n-1;i++)
      {
                      b[i]=(m*10+a[i]-'0')/13+'0'; 
                      m=(m*10+a[i]-'0')%13;
      }
      if(b[1]=='0')
      for(i=2;i<=n-1;i++)
      printf("%c",b[i]);
      else 
      for(i=1;i<=n-1;i++)
      printf("%c",b[i]);
      printf("\n%d",m);
      }
      getchar();
      getchar();
      getchar();
}
main()
 {
   char s[100];
     int a[100],i,j,len,c;
     long b;
    scanf("%s",s);
    b=0;
    len=strlen(s);
   for (i=0;i<len;i++)
		{
		if (s[i]=='0')
		  {
		  c=0;
		  }
		else if (s[i]=='1')
		  {
		  c=1;
		  }
		else if (s[i]=='2')
		  {
		  c=2;
		  }
		else if (s[i]=='3')
		  {
		  c=3;
		  }
		else if (s[i]=='4')
		  {
		  c=4;
		  }
	else if (s[i]=='5')
		  {
		  c=5;
		  }
	else if (s[i]=='6')
		  {
		  c=6;
		  }
	else if (s[i]=='7')
		  {
		  c=7;
		  }
	else if (s[i]=='8')
		  {
		  c=8;
		  }
	else if (s[i]=='9')
	      {
	      	c=9;
	      	}
	b=b*10+c;
	a[i]=b/13;
	b=b-a[i]*13;
	 }
	  i=0;
		 do
			{
		      i=i+1;
		      }
		while (a[i]==0);
		 for (j=i;j<len-1;j++)
		   printf("%d",a[j]);
		   printf("%d\n",a[len-1]);
		   printf("%d\n",b);
		   }
int main()
{
	char str[100];
	char res[100];
	scanf("%s",str);
	int n= strlen(str);
	int mod = 0;
	int shang;
	mod = str[0]-'0';
	int nLag = 1;
	for(int i=1;i<n;i++)
	{
		mod = mod*10+str[i]-'0';
		shang = mod/13;
		if(i==1 && shang==0)
			nLag = 2;
		res[i] = '0'+shang;
		mod = mod%13;
	}
	res[n] = '\0';
	if(n<=nLag)
		printf("%s\n","0");
	else
		printf("%s\n",res+nLag);
	printf("%d\n",mod);
}
int main()
{
	char num[200];
	int innum[200],outnum[200],temp=0,i,len,mark=0;//temp???????13???
	cin.getline(num,200);
	len=strlen(num);
	for(i=0;i<len;i++)
		innum[i]=num[i]-'0';//??????
	for(i=0;i<len;i++)
	{
		temp=temp*10+innum[i];
		if(temp/13)
		{
			outnum[i]=temp/13;//???13?????outnum?
			temp=temp%13;//temp??temp%13
		}
		else
			outnum[i]=0;
	}
	for(i=0;i<len;i++)
	{
		if(mark==0&&outnum[i]==0)//mark?????0???
			continue;
		if(outnum[i])
			mark=1;
			cout<<outnum[i];
	}
	if(!mark)
		cout<<'0'<<endl<<temp;
	else cout<<endl<<temp;
		return 0;

}
int main()
{
	int i,j,g,l;
	char s[101];
	int a[101];

	gets(s);
	l=strlen(s);
    for (i=1;i<=l;i++)
		a[i]=s[i-1]-'0';
	g=0;
	for (i=1;i<=l;i++)
	{
		j=g*10+a[i];
		a[i]=j/x;
		g=j%x;
	}
	j=1;
	while (a[j]==0 && j<=l)
		j++;
	if (j>l)
	{
		printf("0\n");
		printf("%d\n",g);
	}
	else
	{
		for (i=j;i<=l;i++)
			printf("%d",a[i]);
	    printf("\n");
		printf("%d\n",g);
	}
	return 0;
}