semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
	int i, j;
	char x[1000], y[1000];
	cin >> x >> y;
	int len1 = strlen(x);
	int len2 = strlen(y);
	if (len1 == 1 && len2 == 1)
		cout << 0;
	int sum[1000];
	for (i = 0; i < 1000; i ++)
		sum[i] = 0;
	for (i = len1 - 1, j = len2 - 1; i >= 0 && j >= 0; i --, j --)
	{
		int k = x[i] + y[j] - 2 * '0';
		sum[len1 - i - 1] += k;
	}
	if (len1 > len2)
	{
		for (i = len1 - len2 - 1; i >= 0; i --)
			sum[len1 - i - 1] += x[i] - '0';
	}
	else if (len1 < len2)
	{
		for (i = len2 - len1 - 1; i >= 0; i --)
			sum[len2 - i - 1] += y[i] - '0';
	}
	for (i = 0; i < 999; i ++)
		if (sum[i] > 9)
		{
			sum[i + 1] += sum[i] / 10;
			sum[i] = sum[i] % 10;
		}
	i = 999;
	while (sum[i] == 0)
		i --;
	for (j = i; j >= 0; j --)
		cout << sum[j];
	cout << endl;
	return 0;
}
int main()
{


const int MAX=210;

int num1[MAX]={0};
int num2[MAX]={0};
int ans[MAX]={0};
char input1[MAX]={NULL};
char input2[MAX]={NULL};

	cin>>input1>>input2;

	int len1=strlen(input1);
	int len2=strlen(input2);

	int longerlength=0;
	if(len1>len2)
		longerlength=len1;
	else
		longerlength =len2;

	int j=0;
	for(int i= len1-1; i>=0; i--)
	{
		num1[j]=input1[i]-'0';
		j++;
		
	}
	j=0;

	for(int i= len2-1; i>=0; i--)
	{
		num2[j]=input2[i]-'0';
		j++;
		
	}


	for(int i=0; i<longerlength; i++)
	{
		ans[i]= ans[i]+num1[i]+num2[i];
		
		if(ans[i]>=10)
		{
			ans[i]=ans[i]%10;
			ans[i+1]++;
			
		}
	}


	int start=0;

	for(int i=MAX-1; i>=0; i--)
	{
			if(start==1)
			cout<<ans[i];
		if(ans[i]>0 && start == 0)
		{
			cout<<ans[i];
			start=1;
		}

	if(i==0 && start==0)
		cout<<0;

	}

return 0;


}
int main()
{
	int i,j,len,len1,len2,min,max;
	char a[251]={'\0'},b[251]={'\0'},c[252]={'\0'};
	scanf("%s %s",a,b);
	len1=strlen(a);
	len2=strlen(b);
	if (len1==1 && len2==1)
		if(a[0]=='0' && b[0]=='0')
			printf("0");
	for(i=0;;i++)
	{
		len1=strlen(a);	
		if(a[0]=='0')
		{
			for(i=1;i<len1;i++)
				a[i-1]=a[i];
			a[len1-1]='\0';
		}
		else
			break;
	}
	for(i=0;;i++)
	{
		len2=strlen(b);	
		if(b[0]=='0')
		{
			for(i=1;i<len2;i++)
				b[i-1]=b[i];
			b[len2-1]='\0';
		}
		else
			break;
	}
	if(len1>len2)
	{   j=0;
		min=len2;
		max=len1;
	}
	else
	{
		j=1;
		min=len1;
		max=len2;
	}
	for (i=0;i<min;i++)
	{
		if(c[i]+a[len1-i-1]+b[len2-i-1]-48<58)
			c[i]=c[i]+a[len1-i-1]+b[len2-i-1]-48;
		else
		{
			c[i]=c[i]+a[len1-i-1]+b[len2-i-1]-48-10;
			c[i+1]=1;
		}
	}
	for(i=min;i<max;i++)
		if(j==0)
		{
			if(c[i]+a[len1-i-1]<58)
			    c[i]=c[i]+a[len1-i-1];
		    else
			{
		    	c[i]=c[i]+a[len1-i-1]-10;
			    c[i+1]=1;
			}
		}
		else
		{
			if(c[i]+b[len2-i-1]<58)
			    c[i]=c[i]+b[len2-i-1];
		    else
			{
		    	c[i]=c[i]+b[len2-i-1]-10;
			    c[i+1]=1;
			}
		}			
	len=strlen(c);
	if(c[len-1]==1)
		c[len-1]='1';
	for(i=len-1;i>=0;i--)
		printf("%c",c[i]);
	return 0;
}
int main(){
    char a[250],b[250];int c[251]={0},i,j;//???250???????251?
    cin.getline(a,250);cin.getline(b,250);
    for(j=strlen(a)-1,i=0;j>=0;--j,++i)
        c[i]+=a[j]-48;
    for(j=strlen(b)-1,i=0;j>=0;--j,++i){
        c[i+1]+=(b[j]-48+c[i])/10;
        c[i]=(b[j]-48+c[i])%10;
    }
    for(;c[i]!=0;++i){
        c[i+1]+=c[i]/10;
        c[i]%=10;
    }
    for(i=250;c[i]==0&&i>=0;--i);
    if(i>=0)do cout<<c[i];while(i--);
    else cout<<0<<endl;
}
int main()
{
	char a[251],b[251],c[251],e;
	int m,n,i,l,x,j;
	scanf("%s",a);
	scanf("%s",b);
         m=strlen(b);
	n=strlen(a);
	for(i=0;i<n;i++)
	{
		a[i]=a[i]-48;
	}	
	for(i=0;i<m;i++)
	{
		b[i]=b[i]-48;
	}
    
	for(i=0;i<n/2;i++)
	{
             e=a[i];
	   a[i]=a[n-1-i];
	   a[n-i-1]=e;
	}
	for(i=0;i<m/2;i++)
	{
            e=b[i];
	   b[i]=b[m-1-i];
	   b[m-i-1]=e;
	}
	for(i=n-1;i>0;i--)
	{
		if(a[i]==0&&n!=1) n--;
		else break;
	}
	for(i=m-1;i>0;i--)
	{
		if(b[i]==0&&m!=1) m--;
		else break;
	}
	if(n<m)
	{
		l=n;
		x=m;
			for(i=0;i<l;i++)
			{
	    	  if((a[i]+b[i])<10) b[i]=a[i]+b[i];
		      else
			  {
			    b[i]=a[i]+b[i]-10;
				for(j=i+1;j<=x;j++)
				{				    
					if(j==x)
					{
						printf("1");
						break;
					}

				    if(b[j]+1<10)
					{
					  b[j]++;
					  break;
					}
			    	else
					{
					  b[j]=0;
					}
				}
			    
			  }
		}
    	
		for(i=x-1;i>-1;i--)
		{
			printf("%c",b[i]+48);
		}
	}
	else
	{
		l=m;
		x=n;
	
		for(i=0;i<l;i++)
		{
	    	if((a[i]+b[i])<10) a[i]=a[i]+b[i];
		    else
			{
			    a[i]=a[i]+b[i]-10;
				for(j=i+1;j<=x;j++)
				{				    
					if(j==x)
					{
						printf("1");
						break;
					}

				    if(a[j]+1<10)
					{
					  a[j]++;
					  break;
					}
			    	else
					{
					  a[j]=0;
					}
				}
			    
			}
		}
    	
		for(i=x-1;i>-1;i--)
		{
			printf("%c",a[i]+48);
		}
	}	
	return 0;
}
void main()
{
	char a[256]={0},b[256]={0};
	int f=0,k,l1,l2,i,j,n1[256]={0},n2[256]={0},n[256]={0};

	gets(a);
    l1=strlen(a);
    k=l1-1;
	for(i=255;i>255-l1;i--)
	{
		n1[i]=a[k]-48;
		k--;
	}

	gets(b);
    l2=strlen(b);
	k=l2-1;
	for(i=255;i>255-l2;i--)
	{
		n2[i]=b[k]-48;
		k--;
	}

    for(i=255;i>255-l1||i>255-l2;i--)
	{
		n[i]=n[i]+n1[i]+n2[i];
		if(n[i]>=10)
		{
			n[i-1]+=1;
			n[i]-=10;
		}
	}
	k=i;
    for(i=k;i<=255;i++)
	{
		if(n[i]==0&&f==0)
			continue;
		printf("%d",n[i]);
		f=1;
	}
	if(l1==1&&l2==1&&n[255]==0)
		printf("0");
}
int main(){
    char a[255],b[255];
    int n,m,i,j,x,y,z,k=0;
    int c[255]={0};
    scanf("%s",a);
    scanf("%s",b);
    m=strlen(a);
    n=strlen(b);
    x=m-1;
    y=n-1;
    while(1){
             if(x<0&&y<0){break;}
             if(x>=0&&y>=0){
                          c[k]=a[x]-'0'+b[y]-'0';
                          k++;
                          x--;
                          y--;
             }
             if(x>=0&&y<0){
                          c[k]=a[x]-'0';
                          k++;
                          x--;
                          y--;             
             }
             if(x<0&&y>=0){
                          c[k]=b[y]-'0';
                          k++;
                          x--;
                          y--;             
             }                   
    }
     for(i=0;i<k-1;i++){
                      z=c[i];
                      c[i]=z%10;
                      c[i+1]+=z/10;                                  
    }
     if(c[k-1]>10){
                z=c[k-1];
                c[k-1]=z%10;
                printf("%d",(z/10));            
    }
    for(i=k-1;i>=0;i--){
                        if(c[i]!=0||k==1){break;}
                        if(c[i]==0){k--;}                                                           
    }
    for(i=k-1;i>=0;i--){
                        printf("%d",c[i]); 
    }                       

    return 0;    
}
int main()
{
	char s1[300],s2[300];
	int a3[301]={0};
	cin.getline(s1,300);
	cin.getline(s2,300);
	int len1 = strlen(s1),len2 = strlen(s2);
	for (int i = 300; (i> 300-len1 || i>300-len2) ;i--)
	{
		if (len1+i-301>=0)
		{
		a3[i] += (int)(s1[len1+i-301])-48;
		}
		if (len2+i-301>=0)
		{
		a3[i]+= (int)(s2[len2+i-301])-48;
		}
		if (a3[i]>=10)
		{
			a3[i]-=10;
			a3[i-1]++;
		}
	}
	int k = 0;
	for (int i = 1; i<=300;i++)
	{
		if (a3[i]!=0)
		{
			k=1;
		}
		if (k==1)
		{
			cout<<a3[i];
		}
	}
	if (k==0)
		cout<<0;
}
int main()
{
    char s[251];
    int a[251]={0},b[251]={0};
    cin>>s;
    int m=strlen(s);
    for (int i=strlen(s);i>=1;i--)
    a[strlen(s)-i+1]=s[i-1]-'0';
    cin>>s;
    if (strlen(s)>m)
    m=strlen(s);
    for (int i=strlen(s);i>=1;i--)
    b[strlen(s)-i+1]=s[i-1]-'0';
    int i;
    for (i=1;i<=m+1;i++)
    {
        a[i+1]+=(a[i]+b[i])/10;
        a[i]=(a[i]+b[i])%10;
    }
    for (;a[i]==0&&i>1;i--);
    for (;i>=1;i--)
    cout<<a[i];
    cout<<endl;
    return 0;
}
int main()
{
	char a[251],b[251],aa[251],bb[251];
	int la,lb,i,ii,jin=0,l,zero=0;
	cin>>a>>b;
	for(i=0;i<251;i++)
		if(a[i]!='0'){ii=i;break;}
	if(ii!=0){
	    for(i=ii;i<251;i++)
			a[i-ii]=a[i];}
	for(i=0;i<251;i++)
		if(b[i]!='0'){ii=i;break;}
	if(ii!=0){
	    for(i=ii;i<251;i++)
			b[i-ii]=b[i];}
	la=strlen(a),lb=strlen(b),l=la;
	if(la>lb)
	{
		l=la,b[la]='\0';
		for(i=la-1;i>=la-lb;i--)
			b[i]=b[i-la+lb];
		for(i=0;i<la-lb;i++)
			b[i]='0';
	}
	else if(lb>la)
	{
		l=lb,a[lb]='\0';
		for(i=lb-1;i>=lb-la;i--)
			a[i]=a[i-lb+la];
		for(i=0;i<lb-la;i++)
			a[i]='0';
	}
	for(i=l-1;i>=0;i--)
	{
		if(a[i]+b[i]-'0'+jin>'9')
			a[i]=a[i]+b[i]-'0'+jin-10,jin=1;
		else
			a[i]=a[i]+b[i]-'0'+jin,jin=0;
	}
	if(jin==1){
		cout<<1;zero=1;}
	for(i=0;i<l;i++)
	{
	    cout<<a[i];zero=1;
	}
	if(zero==0)
		cout<<0<<endl;
	return 0;
}
int main()
{
	char ch1[300];
	char ch2[300];
	char ch3[300];
	int l1=0,l2=0;
	int min_l=0;
	int max_l=0;
	int jinwei=0;
	int number=0;

	ch1[0]='0';
	ch2[0]='0';
	int i=0,k=0;

	scanf("%s",&ch1[1]);
	scanf("%s",&ch2[1]);
	l1=strlen(ch1);
	l2=strlen(ch2);

	min_l=l1>l2?l2:l1;
	max_l=l1>l2?l1:l2;
	if(l1>l2){strcpy(ch3,ch1);}
	else
	{
		strcpy(ch3,ch2);
	}

	for(i=1;i<=min_l||jinwei==1;i++)
	{
		if(!jinwei)
		{
			if(i>min_l)break;
			if((number=ch1[l1-i]+ch2[l2-i]-'0'-'0')<10)
			{
				ch3[max_l-i]=number+'0';
				jinwei=0;
			}
			else
			{
				ch3[max_l-i]=number-10+'0';
				jinwei=1;
			}
		}
		else
		{
			if(i>min_l)
			{
				if((number=ch3[max_l-i]-'0'+1)<10)
				{
					ch3[max_l-i]=number+'0';
					jinwei=0;
				}
				else
				{
					ch3[max_l-i]=number-10+'0';
					jinwei=1;
				}
				continue;
			}
			if((number=ch1[l1-i]+ch2[l2-i]-'0'-'0'+1)<10)
			{
				ch3[max_l-i]=number+'0';
				jinwei=0;
			}
			else
			{
				ch3[max_l-i]=number-10+'0';
				jinwei=1;
			}
		}
	}

	for(i=0;i<=max_l;i++)
	{
		if(ch3[i]!='0')break;
	}

	if(!(i>=max_l))
	{
		for(k=i;k<=max_l;k++)
		{
			if(ch3[k]!='\0')
			{
				printf("%c",ch3[k]);
			}
		}
	}
	else
	{
		printf("0");
	}

	return 0;
}
void dele0(char *a)
{	int i,j;
	for(i=0;*(a+i)=='0';i++);
	for(j=0;*(a+j+i)!=0;j++)
	{	*(a+j)=*(a+i+j);	}*(a+j)=0;
}

void main()
{
	int i,a1,b1,add=0;
	char a[300],b[300],c[300];
	scanf("%s",a);dele0(a);
	scanf("%s",b);dele0(b);
	a1=strlen(a);
	b1=strlen(b);
	for(i=0;i<a1&&i<b1;i++)
	{	if(a[a1-i-1]+b[b1-i-1]-'0'-'0'+add>9){c[i]=a[a1-i-1]+b[b1-i-1]-'0'-10+add;add=1;}
		else {c[i]=a[a1-i-1]+b[b1-i-1]-'0'+add;add=0;}
	}

	if(i==a1)
	{	for(;i<b1;i++)
		{	if(b[b1-i-1]-'0'+add>9){c[i]=b[b1-i-1]-10+add;add=1;}
			else {c[i]=b[b1-i-1]+add;add=0;}
		}	
	}
	else 
	{	for(;i<a1;i++)
		{	if(a[a1-i-1]-'0'+add>9){c[i]=a[a1-i-1]-10+add;add=1;}
			else {c[i]=a[a1-i-1]+add;add=0;}
		}	
	}if(add==1)	printf("1");
	if(i==0)printf("0");
	else for(;i>0;i--)
			printf("%c",c[i-1]);

}
int birev(char * s, int * sr)
{
	int i, len=strlen(s);
	for (i=0; s[i]; i++) sr[len-1-i]=s[i]-'0';
	return len;
}
int bisum(int * ar, int alen, int * br, int blen, int * sum)
{
	int len=(alen>blen)?alen:blen;
	int i, temp=0;
	for (i=0; i<len; i++) {
		sum[i]=(ar[i]+br[i]+temp)%10;
		temp=(ar[i]+br[i]+temp)/10;
	}
	if(temp!=0) {
		sum[i]=1;
		len++;
	}
	return len;
}
void biprt(int * sum, int sumlen)
{
	while (sum[sumlen-1]==0&&sumlen>1) sumlen--;
	while (sumlen) {
		printf("%d", sum[sumlen-1]);
		sumlen--;
	}
}
int main ()
{
	char a[300], b[300];
	int ar[300]={0}, br[300]={0}, sum[300];
	int alen, blen, sumlen;
	gets(a);
	gets(b);
	alen=birev(a, ar);
	blen=birev(b, br);
	sumlen=bisum(ar, alen, br, blen, sum);
	biprt(sum, sumlen);
	return 0;
}
int shift(char n){
	int shift;
	switch(n){
		case'1':shift=1;break;
		case'2':shift=2;break;
		case'3':shift=3;break;
		case'4':shift=4;break;
		case'5':shift=5;break;
		case'6':shift=6;break;
		case'7':shift=7;break;
		case'8':shift=8;break;
		case'9':shift=9;break;
		case'0':shift=0;break;
	}
	return shift;
}

int main(){
	char a[252],b[252],c[252],d[252];
	int lengtha,lengthb,sum[252],lon,i,lina,linb,cha,sh;
	d[0]='0';
	d[1]='\0';
	scanf("%s%s",a,b);
	lengtha=strlen(a);
	lengthb=strlen(b);
	for(lina=0;lina<lengtha;lina++){
		if(a[lina]!='0')break;
	}
	lina;
	for(linb=0;linb<lengthb;linb++){
		if(b[linb]!='0')break;
	}
	linb;
    
	
	if(lengtha-lina>=lengthb-linb){
		cha=(lengtha-lina)-(lengthb-linb);
		for(i=0;i<=cha;i++){
			c[i]='0';
		}
		c[cha+1]='\0';
		strcat(c,b);
		strcat(d,a);
		lon=lengtha;
		sh=lina;
	}
	else{
		cha=(lengthb-linb)-(lengtha-lina);
		for(i=0;i<=cha;i++){
			c[i]='0';
		}
		c[cha+1]='\0';
		strcat(c,a);
		strcat(d,b);
		lon=lengthb;
		sh=linb;
	}
	sum[lon]=0;
	for(i=lon;i>sh;i--){
		sum[i-1]=0;
		sum[i]=shift(d[i])+shift(c[i])+sum[i];
		if(sum[i]>=10){
			sum[i]-=10;
			sum[i-1]++;
		}
	}
	if(sh==0){
		if(sum[0]==1)printf("1");
	    for(i=1;i<=lon;i++)printf("%d",sum[i]);
	    printf("\n");
	}
	else{
	if(sum[sh-1]==1)printf("1");
	for(i=sh;i<=lon;i++)printf("%d",sum[i]);
	printf("\n");
	}
	return 0;
}
/*
 *  ?????.cpp
 *  Created on: 2012-11-24
 *  Author: ???
 */
char a[300], b[300], c[300], tem[300];
int i, len1, len2, len3, firstout;
int plu(int n, int add) {
	if (n == 0) {
		if (a[0] + b[0] + add >= 106) {
			c[0] = a[0] + b[0] + add - 58;
			for(i=len3;i>=1;i--){
				c[i]=c[i-1];
			}
			c[0]='1';len3=len3+1;
		} else {
			c[0] = a[0] + b[0] + add - 48;
		}
	} else {
		if (a[n] + b[n] + add >= 106) {
			if (n == (len3 - 1)) {
				c[n] = a[n] + b[n] + add - 58;
				return plu(n - 1, 1);
			} else {
				c[n] = a[n] + b[n] + add - 58;
				return plu(n - 1, 1);
			}
		} else {
			c[n] = a[n] + b[n] + add - 48;
			return plu(n - 1, 0);
		}
	}
}
int main() {
	for (i = 0; i < 300; i++) {
		a[i] = b[i] = c[i] = tem[i] = '0';
	}
	cin.getline(a, 300);
	cin.getline(b, 300);
	len1 = strlen(a);
	a[len1] = '0';
	len2 = strlen(b);
	b[len2] = '0';
	if (len1 > len2) {
		len3 = len1;
		for (i = len2 - 1; i >= 0; i--) {
			tem[i + (len3 - len2)] = b[i];
		}
		strcpy(b, tem);
	} else {
		len3 = len2;
		for (i = len1 - 1; i >= 0; i--) {
			tem[i + (len3 - len1)] = a[i];
		}
		strcpy(a, tem);
	}
	plu(len3 - 1, 0);
	for (i = 0; i < len3; i++) {
		if (c[i] != '0') {
			firstout = i;
			break;
		}
	}
	for (i = firstout; i < len3; i++) {
		cout << c[i];
	}
	return 0;
}
/*1069 ?????*/ 



int max(int a,int b)
{
	if(a>b) return a;
	else return b;
}

int main()
{
	char x1[260],x2[260];
	cin.getline(x1,260);
	cin.getline(x2,260);
    int len1,len2; //len1.len2
	if(strlen(x1)<strlen(x2))//len3.len4
	{
		char c[260];
		strcpy(c,x1);strcpy(x1,x2);strcpy(x2,c);
	}
	len1=strlen(x1);
	len2=strlen(x2);
	int i;
	int a1[260]={0},a2[260]={0};
	//????????
	for(i=len1;i>0;i--)
	{
		a1[i]=x1[i-1]-'0';
		a2[i]=i-len1+len2>=1?x2[i-len1+len2-1]-'0':0;
	}
	//???????
	for(i=len1;i>0;i--)
	{
	a1[i]+=a2[i];
		int j=i;
		while(a1[j]>=10 && j>=0)
		{
			a1[j-1]+=a1[j]/10;
			a1[j]%=10;
			j--;
	}
	}
       //??
	i=0;
	while(a1[i]==0 && i<len1) i++;
	for(;i<=len1;i++) cout<<a1[i];
	cout<<endl; 
	return 0;
}
char num_1[200]={0},num_2[200]={0};
	int i,j,k;
	int num1[200]={0},num2[200]={0},num3[200]={0};
int Greater(int a,int b)
{
	if(a>b)
		return a;
	return b;
}
void print (int len)
{
	for(i=len;i>=0;i--)
	{
		cout<<num3[i];
	}
}
void addition(int len)
{ 
	for(i=0;i<len;i++)
	{
		num3[i]=num1[i]+num2[i]+num3[i];
		num3[i+1]+=num3[i]/10;
		num3[i]=num3[i]%10;
	}
	int temp=len;
	for(i=len;i>0;i--)
	{
	if(num3[i]==0)
		temp=i-1;
	else
		break;
	}
	print(temp);
		
}
int main()
{

	cin>>num_1;
	cin>>num_2;
	for(i=0;i<strlen(num_1);i++)
	{
		num1[i]=num_1[strlen(num_1)-1-i]-'0';
		
	}
	
	for(i=0;i<strlen(num_2);i++)
	{
		num2[i]=num_2[strlen(num_2)-1-i]-'0';
		
	}
	
	int len=Greater(strlen(num_1),strlen(num_2));
	addition(len);

	return 0;
}
int main()
{
	char s1[256],s2[256];
	int c[256]={0};
	int a,b,i,l1,l2,l=0;
	scanf("%s%s",s1,s2);
	l1=(int)strlen(s1);
	l2=(int)strlen(s2);
	while(l1>0||l2>0){
		a=(l1>0)?s1[--l1]-'0':0;
		b=(l2>0)?s2[--l2]-'0':0;
		c[l]+=a+b;
		c[l+1]=c[l]/10;
		c[l++]%=10;
	}
	while (c[l]==0&&l>0)
		l--;
	for(i=l;i>=0;i--)
		printf("%d",c[i]);
	return 0;
}
int str2bigint(char*str,int*a)
{
	int len=(int)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;
	int i;
	while(a[k]==0&&k>0)
	{
		k--;
	}
	for(i=k;i>=0;i--)
	{
		printf("%d",a[i]);
	}
}
int add_bigint(int*a,int alen,int*b,int blen,int*c)
{
	int i;
	int len=(alen>blen)?alen:blen;
	for(i=0;i<len;i++)
	{
		c[i]=0;
		if(i<alen) c[i]+=a[i];
		if(i<blen) c[i]+=b[i];
	}
	c[len]=0;
	for(i=0;i<len;i++)
	{
		if(c[i]>=10)
		{
			c[i+1]+=c[i]/10;
			c[i]%=10;
		}
	}
	return c[len]?(len+1):len;
}
int main()
{
	char s1[256],s2[256];
	int a[256],b[256],c[256];
	int alen,blen,clen;
	scanf("%s%s",s1,s2);
	alen=str2bigint(s1,a);
	blen=str2bigint(s2,b);
	clen=add_bigint(a,alen,b,blen,c);
	print_bigint(c,clen);
	return 0;
}
//#include <string.h>
char * strrev(char * a){
     char *end;
	 char *beg = a ;
	 char temp;
	 for(end = a; *end; end++);
	 for(end--;beg < end;)
	{
		temp = *beg;
		*beg = *end;
		*end = temp;
		beg++;
        end--;
	}
	return a;
}
int main()
{
	char a[500],b[500] ;
	char *p;
	scanf("%s",a);
	scanf("%s",b);
	
	strrev(a);
	strrev(b);
	
	for(p = a; *p; p++)
		*p = *p - '0';
	for(;p<a+500;p++)
		*p = 0;
	for(p = b; *p; p++)
		*p = *p - '0';
	for(;p<b+500;p++)
		*p = 0;
	int i;
	for(i = 0; i < 500; i++)
	{
		a[i] = a[i] + b[i];
		a[i+1] += a[i]/10;
		a[i] = a[i] % 10;
	}
	
	for(p = a + 400; *p == 0 && p>=a; p--);
	if(p < a)
	printf("0");
	for(;p>=a; p--)
		printf("%d",(int)*p);
	printf("\n");
	//scanf("%s",a);
	return 0; 
}
main(){
       int a[255];
       int b[255];
       int c[255];
       memset(a,0,sizeof(a));
       memset(b,0,sizeof(b));
       memset(c,0,sizeof(c));
       char str[255];
       int len1,len2;
       cin >> str;
       len1 = strlen(str);
       for(int i = 0; i < len1; i++){
               a[len1 - 1 - i] = str[i] - '0';
       }
       cin >> str;
       len2 = strlen(str);
       for(int i = 0; i < len2; i++){
               b[len2 - 1 - i] = str[i] - '0';
       }
       if(len1 > len2){len2 = len1;}
       for(int i = 0; i < len2; i++){
               c[i] = a[i] + b[i];
       }
       for(int i = 0; i < len2; i++){
               if(c[i] >= 10){
                       c[i + 1] += c[i] / 10;
                       c[i] %= 10;
               }
       }
       for(int i = len2; i >= 0; i--){
               if(c[i] != 0){
                       len2 = i;
                       break;
               }
               if(i == 0){len2 = -1;}
       }
       if(len2 < 0){cout << "0" << endl;return 0;}
       for(int i = len2; i >= 0; i--){
               cout << c[i];
       }
       cout << endl;
}
int main(int argc, char* argv[])
{
	char a[250],b[250];
	int c[250]={0};
	int i,j=0,d,s,n1,n2,max,pan=0;
	scanf("%s%s",a,b);
	n1=strlen(a);
	n2=strlen(b);
	if(n1>n2){
		max=n1;
		d=n1-n2;
		for(i=n1-1;i-d>=0;i--){
			s=a[i]+b[i-d]-'0'-'0';
			if(s+j>9){
				c[i]=s-10+j;
				j=1;
			}
			else{
				c[i]=s+j;
				j=0;
			}
		}
		for(i=d-1;i>=0;i--){
			s=a[i]+j-'0';
			if(s>9){
				c[i]=s-10;
				j=1;
			}
			else{
				c[i]=s;
				j=0;
			}
		}
	}
	else{
		max=n2;
		d=n2-n1;
		for(i=n2-1;i-d>=0;i--){
			s=b[i]+a[i-d]-'0'-'0';
			if(s+j>9){
				c[i]=s-10+j;
				j=1;
			}
			else{
				c[i]=s+j;
				j=0;
			}
		}
		for(i=d-1;i>=0;i--){
			s=b[i]+j-'0';
			if(s>9){
				c[i]=s-10;
				j=1;
			}
			else{
				c[i]=s;
				j=0;
			}
		}
	}
    if(j==1){
		printf("1");
	}
	for(i=0;i<max;i++){
		if(c[i]!=0)
			pan=1;
		if(pan==1||(pan==0&&j==1))
			printf("%d",c[i]);
	}
	if(pan==0&&j==0)
		printf("0");
	return 0;
}
int zh(char a)
{
	int b;
	if((a>='A')&&(a<='Z'))
	{
		b=(int)(a)-55;
		return b;
	}
	else
	{
		b=(int)(a)-48;
		return b;
	}
}
char fzh(int a)
{
	char b;
	if(a>9)
	{
		b=(char)(a-10+48);
		return b;
	}
	else
	{
		b=(char)(a+48);
		return b;
	}
}


int main()
{
	char a[10000],b[10000],a1[10000],b1[10000],c[10000];
	int n;
	int i,j,k;
	int sum=0;
	int l1,l2;
	int jinwei;
	for(i=0;i<9999;i++)
	{
		a1[i]='0';
		b1[i]='0';
	}
	a1[9999]='\0';
	b1[9999]='\0';
	
	
	
	scanf("%s%s",a,b);
	l1=strlen(a);
	l2=strlen(b);
	
	for(i=0;i<l1;i++)
	{
		a1[l1-1-i]=a[i];
	}
	for(i=0;i<l2;i++)
	{
		b1[l2-1-i]=b[i];
	}


	for(i=0;i<9999;i++)
	{
		
		if(i==0)
		{
			c[i]=fzh(zh(a1[i])+zh(b1[i]));
			if((zh(a1[i])+zh(b1[i]))>9)
			{
				jinwei=1;
			}
			else 
			{
				jinwei=0;
			}
		}
		else
		{
			c[i]=fzh((zh(a1[i])+zh(b1[i]))+jinwei);
			if((zh(a1[i])+zh(b1[i])+jinwei)>9)
			{
				jinwei=1;
			}
			else
			{
				jinwei=0;
			}
		}
	}

	for(i=9998;i>=0;i--)
	{
		if(sum==0)
		{
			if(c[i]!='0')
			{
				printf("%c",c[i]);sum++;
			
			}
		}
		else
		{
			printf("%c",c[i]);
		}
	}
	if(sum==0)
	{
		printf("0");
	}
	return 0;
}
/*
 * dshw1.cpp
 *
 *  Created on: 2013-3-16
 *      Author: ibm
 */




struct Addlist
{
	int n;
	int *element;
};

typedef struct Addlist *ablist;

ablist creatalist(void)
{
	ablist alist = (ablist)malloc(sizeof(struct Addlist));
	if(alist != NULL)
	{
		alist -> element = (int*)malloc(sizeof(int)*MAXNUM);
		if (alist -> element)
		{
			alist ->n = 0;
			return alist;
		}
		else delete(alist);
	}
	return NULL;
}

ablist creatblist(void)
{
ablist blist = (ablist)malloc(sizeof(struct Addlist));
	if(blist != NULL)
	{
		blist -> element = (int*)malloc(sizeof(int)*MAXNUM);
		if (blist -> element)
		{
			blist ->n = 0;
			return blist;
		}
		else delete(blist);
	}
}


int main()
{
	int i,j,k;
	int lena,lenb,len;
	int carry = 0;

ablist alist = creatalist();
ablist blist = creatblist();

char achar[MAXNUM];
cin>>achar;
//cout<<achar<<endl;
lena = strlen(achar);
//cout<<lena<<endl;

char bchar[MAXNUM];
cin>>bchar;
//cout<<bchar;
lenb = strlen(bchar);
//cout<<lenb<<endl;

//if( (achar[0]-'0' ==0 )&& (bchar[0]-'0'==0))
//{
	//cout<<"flag"<<endl;
//	cout<<'0';
//return 0;}
for( i=0; i<lena; i++)
{
	alist -> element[i] = achar[lena - i - 1] - '0';
	//cout<<i<<' '<<alist -> element[i] ;
}
for( i=lena; i<MAXNUM; i++)
{
	alist -> element[i] = 0;
	//cout<<i<<' '<<alist -> element[i] ;
}
for( j=0; j<lenb; j++)
{
	blist -> element[j] = bchar[lenb - j - 1] - '0';
	//cout<<j<<' '<<blist -> element[j] ;
}
for( j=lenb; j<MAXNUM; j++)
{
	blist -> element[j] = 0;
	//cout<<j<<' '<<blist -> element[j] ;
}
//for (i=lena-1; i>=0; i--)
//cout<<"a "<<alist->element[i]<<endl;
//cout<<endl;
//for (i=lenb-1; i>=0; i--)
//cout<<"b "<<blist->element[i]<<endl;;

	//int len;
	if (lena <= lenb)
	len = lenb;
	else
		len = lena;
	//cout<<"len "<<len<<endl;

for (k=0; k<len; k++)
{
	alist -> element[k] = alist -> element[k] + blist -> element[k] + carry;
	//cout<<k<<' '<<alist -> element[k]<<endl;
	if (alist -> element[k] >= 10)
	{
		alist -> element[k] -= 10;
		carry = 1;
	}
	else carry = 0;
	//cout<<k<<' '<<alist -> element[k]<<endl;
	//cout<<carry<<endl;
}
if (carry == 1)
{
	alist -> element[len] = 1;

//for (i=lena; i>=0; i--)
//{//cout<<"aaaa ";
//cout<<alist->element[i];}
//cout<<' '<<endl;
//if (carry == 1)
//{
	//cout<<"1";

	for (i=len; i>=0; i--)
		cout<<alist -> element[i];
	return 0;
}
else
{
	j = 0;
	for (i=len-1; i>=0; i--)
	{
		if (alist -> element[i] == 0)
		{
			j++;
		}
		else
			break;
	}
	//cout<<"  "<<j<<endl;
		//else
	if (j != len)
		for( k=len-1-j; k>=0; k--)
		{
			//cout<<j<<endl;
			cout<<alist -> element[k];
		}
	else
		cout<<"0"<<endl;
		return 0;
}
}
	//else
	//	for (i=len-1; i>=0; i--)
	///	{
//j = 0;
		//	if (alist -> element[i] = 0)
	///			j++;
	//		for( k=len-1-j; k>=0; k--)
	//	{
	//		cout<<alist -> element[k];
			//i--;
//		}
	//		return 0;
	//	}
int max(int a,int b)
{
	if(a>b)
		return a;
	else
		return b;
}
int main()
{
	char a[300],b[300],t;
	int i,flag=0,aa,bb;
	memset(a,0,300);
	memset(b,0,300);
	cin.getline(a,300);
	cin.getline(b,300);
	aa=strlen(a);
	bb=strlen(b);
	if(aa==1&&bb==1&&a[0]=='0'&&b[0]=='0')
	{
		cout<<"0";
		return 0;
	}
	for(i=aa;i<=max(aa,bb);i++)
	{
		a[i]='0';
	}
	for(i=bb;i<=max(aa,bb);i++)
	{
		b[i]='0';
	}
	for(i=0;i<aa/2;i++)
	{
		t=a[aa-i-1];
		a[aa-i-1]=a[i];
		a[i]=t;
	}
	for(i=0;i<bb/2;i++)
	{
		t=b[bb-i-1];
		b[bb-i-1]=b[i];
		b[i]=t;
	}
	for(i=0;i<=max(aa,bb)+1;i++)
	{
		a[i]=a[i]+b[i]-'0';
		if(a[i]>'9')
		{
			a[i]=(char)(a[i]-10);
			a[i+1]+=1;
		}
	}
	
	for(i=max(aa,bb)+1;i>=0;i--)
	{
		if(flag==0&&a[i]>=49&&a[i]<=57)
		{
			cout<<a[i];
			flag=1;
		}
		else if(flag==1)
		{
			cout<<a[i];
		}
	}
	return 0;
}