semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
	char a[30000],b[30000];
	int i,j,h[30000];
	scanf("%s",a);
	scanf("%s",b);
	if(strlen(a)>=strlen(b))
	{
		    for(i=strlen(a)-1;i>=0;i--)
		    {
			j=i-(strlen(a)-strlen(b));
			if(j>=0)
			h[i]=a[i]-'0'+b[j]-'0';
			else
			h[i]=a[i]-'0';
			}
			for(i=strlen(a)-1;i>0;i--)
			{
				if(h[i]>=10)
			    {
			        h[i]=h[i]-10;
			        h[i-1]=h[i-1]+1;
		        }
				//printf("%d\n",h[i]);
			}
			if(h[0]>=10)
		    {
			    printf("1%c",h[0]+'&');
		    }
		    if(h[i]>0&&h[i]<10)
		    {
				printf("%c",h[0]+'0');
			}
			for(i=0;i<strlen(a);i++)
		    {
			    if(h[i]!=0)
			    break;
		    }
		    if(i==strlen(a))
		    printf("0");
		    else{
		    for(i=1;i<strlen(a);i++)
		    {
			    printf("%c",h[i]+'0');
		    }}
			
    }
    if(strlen(a)<strlen(b))
	{
		    for(i=strlen(b)-1;i>=0;i--)
		    {
			j=i-(strlen(b)-strlen(a));
			if(j>=0)
			h[i]=b[i]-'0'+a[j]-'0';
			else
			h[i]=b[i]-'0';
			}
			for(i=strlen(b)-1;i>0;i--)
			{
				if(h[i]>=10)
			    {
			        h[i]=h[i]-10;
			        h[i-1]=h[i-1]+1;
		        }
				//printf("%d\n",h[i]);
			}
    
	if(h[0]>=10)
		    {
			    printf("1%c",h[0]+'&');
		    }
		    if(h[i]>0&&h[i]<10)
		    {
				printf("%c",h[0]+'0');
			}
			for(i=0;i<strlen(b);i++)
		    {
			    if(h[i]!=0)
			    break;
		    }
		    if(i==strlen(b))
		    printf("0");
		    else{
		    for(i=1;i<strlen(b);i++)
		    {
			    printf("%c",h[i]+'0');
		    }
		}
		}
	return 0;
}
int main()
{
   const int maxlen=250;
   int an1[maxlen],an2[maxlen];
   char str1[maxlen+1],str2[maxlen+1];
   cin.getline(str1,maxlen+1);
   cin.getline(str2,maxlen+1);
   int len1=strlen(str1);
   int len2=strlen(str2);
   if(len1==1&&len2==1&&str1[0]=='0'&&str2[0]=='0')
	   cout<<0<<endl;
   else
  { memset(an1,0,sizeof(an1));
   memset(an2,0,sizeof(an2));
   int i,j=0;
   for(int i=len1-1;i>=0;i--)
	   an1[j++]=str1[i]-'0';
   j=0;
    for(int i=len2-1;i>=0;i--)
	   an2[j++]=str2[i]-'0';
	for(int i=0;i<maxlen;i++)
	{
		an1[i]=an1[i]+an2[i];
		if(an1[i]>9)
		{
			an1[i]=an1[i]-10;
			an1[i+1]++;
		}
	}
	i=maxlen-1;
	while(an1[i]==0)
		i--;
	for(;i>=0;i--)
		cout<<an1[i];
	cout<<endl;
   }
return 0;
}
char input1[260],input2[260];
int int1[260],int2[260],len1,len2;
void sum(int index, int carry){
	if(carry == 0 && index >= len1 && index >= len2)
		return ;
	int1[index] += int2[index] + carry;
	carry = int1[index] / 10;
	int1[index] %= 10;
	sum(index + 1, carry);
	return ;
}
int main(){
	cin >> input1 >> input2;
	memset(int1,0,sizeof(int1));
	memset(int2,0,sizeof(int2));
	int i,j;
	len1 = strlen(input1);
	for(i=len1-1,j=0;i>=0;i--,j++)
		int1[j] = input1[i]-'0';
	len2 = strlen(input2);
	for(i=len2-1,j=0;i>=0;i--,j++)
		int2[j] = input2[i]-'0';
	sum(0, 0);
	for(i = len1>len2?len1:len2;i >= 0;i --)
		if(int1[i] != 0)
			break;
	if(i < 0)
		cout << 0;
	else{
		for(;i >= 0;i--)
			cout << int1[i];
	}
	return 0;
}
int main()
{
	int i,j,m,n,max;
	char a[250],b[250],c[1000],d[250],e[250];
	for(i=0;i<=249;i++) c[i]=0;
	gets(a);
	gets(b);
	m=strlen(a);
	n=strlen(b);
	for(i=m-1,j=0;i>=0;j++,i--) d[j]=a[i];
	for(;j<=249;j++) d[j]='0';
	for(i=n-1,j=0;i>=0;j++,i--) e[j]=b[i];
	for(;j<=249;j++) e[j]='0';
	max=(m>n)? m:n;
	for(i=0;d[i]>'0'||e[i]>'0'||i<=max;i++)
	{
		c[i]=d[i]+e[i]-'0';
		if(c[i]>'9')
		{
			c[i]=c[i]-10;
			d[i+1]=d[i+1]+1;
	        
		}
	}
	for(i=249;i>=0;i--)
	{
		if(c[i]>'0')
		break;
	}
	
	if(i<0) printf("0\n");
	else
	{
		for(;i>=0;i--)
	    {
		    printf("%c",c[i]);
	    }
	}
	return 0;
}
int main()
{
	char a[251],b[252];
	int c[251]={0},d[251]={0},s[251]={0},len1,len2,j=0,i;
	cin>>a;
	cin>>b;
	len1=strlen(a);
	len2=strlen(b);
	for(i=len1-1;i>=0;i--)
	{
		c[j]=a[i]-'0';
		j++;
	}
	j=0;
	for(i=len2-1;i>=0;i--)
	{
		d[j]=b[i]-'0';
		j++;
	}
	for(i=0;i<len1||i<len2;i++)
	{
		s[i]=c[i]+d[i]+s[i];
		if(s[i]>=10)
		{
			s[i+1]++;
			s[i]=s[i]-10;
		}
	}
	i=250;
	while(s[i]==0&&i>0)
	{
		i--;
	}
	for(j=i;j>=0;j--)
		cout<<s[j];
	cout<<endl;
	return 0;
}
int max(int a,int b)
   { 
      if(a>=b)
        return a;
      else
        return b;
    }    
main()
{
      char s1[250],s2[250],s3[250],t;
      scanf("%s",s1);
      scanf("%s",s2);
      int a,b,c,d,i;
      a=strlen(s1);
      b=strlen(s2);
      int f=max(a,b);
      for(i=0;i<=(int)(a-1)/2;i++)
            {
              t=s1[i];
              s1[i]=s1[a-1-i];
              s1[a-1-i]=t; 
            } 
      for(i=0;i<=(int)(b-1)/2;i++)
            {
              t=s2[i];
              s2[i]=s2[b-1-i];
              s2[b-1-i]=t; 
            }
      if (a>=b)
        {  
          for(i=b;i<=a;i++)
              s2[i]='0';
          s1[a]='0';
        }  
      else
        {    
          for(i=a;i<=b;i++)
              s1[i]='0';
          s2[b]='0';    
        } 
      for(i=0;i<=f;i++)
        {
          c=(s1[i]-'0')+(s2[i]-'0');
          if (c>=10)
             {  
               d=c%10;
               s3[i]=d+'0';
               s1[i+1]=s1[i+1]-'0'+1+'0';
             } 
          else 
             s3[i]=c+'0';
        } 
      for(i=0;i<=(int)f/2;i++)
        {
          t=s3[i];
          s3[i]=s3[f-i];
          s3[f-i]=t; 
        }
      for (i=0;i<=f;i++)
          if (s3[i]-'0'!=0||i==f)
             for(i;i<=f;i++)       
                 printf ("%c",s3[i]);
}
main()
{
	int i,j,k,s,t=0,q=0; 
	char x[250],y[250],z[251]; 
	scanf("%s",&x);
	scanf("%s",&y);
	
	for(i=0;;i++)
	if(x[i]==0)break; 
	for(j=0;;j++)
	if(y[j]==0)break;
	
	for(k=1;;k++)
	{
		if(k<=i&&k<=j)
		{
			s=x[i-k]+y[j-k]-96+t;
		    z[k]=s%10+48;t=s/10; 
		    } 
		if(k>i&&k<=j)
		{
			s=y[j-k]-48+t;
		    z[k]=s%10+48;t=s/10; 
			} 
		if(k<=i&&k>j)
		{
			s=x[i-k]-48+t;
		    z[k]=s%10+48;t=s/10; 
			} 
		if(k>i&&k>j)
		{
			z[k]=t+48;
			break;
			} 
		} 

	for(;k>0;k--)
	if(z[k]!=48||q!=0)
	{
		q++;
		printf("%c",z[k]);
		} 
	if(q==0)printf("0"); 

	return 0; 
	}
int main()
{
	char a[300],b[300];
	unsigned int a1[300],b1[300];
	memset(a1, 0, sizeof(a1));
	memset(b1, 0,sizeof(b1));
	int i,j=0,k,l;
	cin.getline(a,300);
	cin.getline(b,300);
	int len1=strlen(a);
	int len2=strlen(b);
    for(i=len1-1;i>=0;i--)
	{
		a1[j]=a[i]-'0';
		j++;
	}
	j=0;
	for(i=len2-1;i>=0;i--)
	{
		b1[j]=b[i]-'0';
		j++;
	}
	for( i=0;i<250;i++)
	{
		a1[i]=a1[i]+b1[i];
		if(a1[i]>=10)
		{
			a1[i]=a1[i]-10;
			a1[i+1]++;
		}
	}
	j=251;
	while(a1[j]==0 && j > 0) j--;
	for(i=j;i>=0;i--)
		cout<<a1[i];
	cout << endl;
	return 0;
}
/*
 * 11.282.3.cpp
 *
 *  Created on: 2012-11-25
 *      Author: Administrator
 */
char str1[270];
char str2[270];
char str3[270];
void huanwei(char x[],int y)//??????????
{
	int i,j;
	char t;
	for(i=0,j=y-1;i<j;i++,j--)
	{
		t=x[i];
		x[i]=x[j];
		x[j]=t;
	}

}
int main()
{
	int t,g=0,m,r=0;
	int i,len1,len2;
	cin.getline(str1,270);
	cin.getline(str2,270);
	len1=strlen(str1);
	len2=strlen(str2);
	str1[len1]='0';
	str1[len1+1]='\0';
	str2[len2]='0';
	str2[len2+1]='\0';//????????0.
	huanwei(str1,len1);
	huanwei(str2,len2);
	if(len2>len1)//????1??2????
	{
		strcpy(str3,str1);
		strcpy(str1,str2);
		strcpy(str2,str3);
		t=len1;
		len1=len2;
		len2=t;

	}

	for(i=0;i<=len2;i++)
	{
		m=str1[i]+str2[i]+g-96;//????
		if(m>=10)
		{
			m=m%10;
			str1[i]=m+48;
			g=1;
		}
		else
		{
			str1[i]=m+48;
			g=0;
		}
	}

	for(i=len2+1;i<=len1;i++)//?2?????????????
	{
		if(str1[i]+g==58)
		{
			str1[i]=48;
			g=1;
		}
		else  if(str1[i]+g!=58&&g==1)
		{
			str1[i]++;
			g=0;
	}
	}
	for(i=len1;i>=0;i--)
	{
		if(str1[i]==48)//???????0.
			r++;
		else
			break;
	}
	if(r<=len1)
	{
	for(i=len1-r;i>=0;i--)
		cout<<str1[i];

}
	else
		cout <<"0";
	return 0;
}
int main()
{
	const int max = 251 ;
	int an1[251] = {0} , an2[251] = {0} ;
	char line1[251] = {0},line2[251] = {0} ;
	cin>>line1 ;
	cin>>line2 ;
	int lenth1 = strlen(line1) ;
	int lenth2 = strlen(line2) ;
	int i = 0 , j = 0 ;
	for(i = lenth1 - 1 ; i>= 0 ; i--)
	{
		an1[j++] = line1[i] - '0' ;
	}
	for(i = lenth2 - 1 , j = 0 ; i>= 0 ; i--)
	{
		an2[j++] = line2[i] - '0' ;
	}
	int flag = 0 ;
	for(i = 0 ; i<max ; i++)
	{
		an1[i] = an1[i] +an2[i] ;
		if(an1[i]>=10)
		{
			an1[i+1] += an1[i]/10 ;
			an1[i] = an1[i]%10 ;
		}
		if(an1[i])
			flag = i ;
	}
	for(j = flag ; j>=0 ; j--)
		cout<<an1[j] ;
	return 0 ;
}
int main()
{
	char a[255],b[255],*p;
	int i,m,c[255],*q=c;
	cin.getline(a,252);
	cin.getline(b,252);
	memset(c,0,sizeof(c));
	for(p=a;*p!='\0';)
		p++;
	m=a+252-p;
	for(;p>=a;p--)
		*(p+m)=*p;
	p+=m;
	for(;p>=a;p--)
		*p='0';
	for(p=b;*p!='\0';)
		p++;
	m=b+252-p;
	for(;p>=b;p--)
		*(p+m)=*p;
	p+=m;
	for(;p>=b;p--)
		*p='0';
	for(i=0;i<253;i++)
		c[i]=a[i]+b[i]-96;
	for(i=252;i>0;i--)
		if(c[i]>9)
		{
			c[i]-=10;
			c[i-1]++;
		}
	while(*q==0)
		q++;
	if(q>=c+252)
		cout<<"0";
	while(q<c+252)
		cout<<*q++;
	cout<<endl;
	return 0;
}
int main()
{
	char ca[251];
	char cb[251];
	char tempc;
	int ia[251] = {0};
	int ib[251] = {0};
	int result[251] = {0};
	int numa = 0;
	int numb = 0;
	int jinwei = 0;
	int weishu = 0;
	int resultweishu = 0;
	cin >> ca;
	cin >> cb;
	numa = strlen(ca);
	numb = strlen(cb);
	//cout << numa << " " << numb << endl;
	memset(ia,0,sizeof(int));
	memset(ib,0,sizeof(int));
	memset(result,0,sizeof(int));
	if(numa > numb)
		weishu = numa;
	else
		weishu = numb;
	for(int i = 0;i < numa;i ++)
	{
		tempc = ca[numa - i - 1];
		ia[i] = atoi(&tempc);
	}
	for(int i = 0;i < numb;i ++)
	{
		tempc = cb[numb - i - 1];
		ib[i] = atoi(&tempc);
	}
	for(int i = 0;i <= weishu;i ++)
	{
		result[i] = ia[i] + ib[i] + jinwei;
		if(result[i] > 9)
		{
			result[i] = result[i] - 10;
			jinwei = 1;
		}
		else
			jinwei = 0;
	}
	for(int i = 250;i >= 0;i --)
	{
		if(result[i] != 0)
		{
			resultweishu = i;
			break;
		}
	}
	for(int i = resultweishu;i >= 0; i --)
		cout << result[i];
	cout << endl;
}


/*#include<iostream>

int mycmp(const void *a, const void *b)
{
	return *(int *)a - *(int *)b;
}

int main()
{
	int n = 0;
	cin >> n;
	int tianji[1000] = {0};
	int qiwang[1000] = {0};
	int isusedt[1000] = {0};
	int isusedq[1000] = {0};
	int tempt = 0;
	int tempq = 0;
	while(n != 0)
	{
		memset(tianji,0,sizeof(int));
		memset(qiwang,0,sizeof(int));
		memset(isusedt,0,sizeof(int));
		memset(isusedq,0,sizeof(int));
		tempt = 0;
		tempq = 0;
		for(int i = 0;i < n;i ++)
			cin >> tianji[i];
		for(int i = 0;i < n;i ++)
			cin >> qiwang[i];
		qsort(tianji,n,sizeof(int),mycmp);
		qsort(qiwang,n,sizeof(int),mycmp);
		for(int i = tempt;i < n;i ++)
		{
		}
		cin >> n;
	}
	return 0;
}*/
int main()
{
    char str1[250],str2[250];    
    int a[250],b[250],c[250]={0};  
    int x1,x2,i,j,k=0,l;
  scanf("%s\n",str1);
  scanf("%s",str2);
  x1=strlen(str1);
  x2=strlen(str2);
    for(i=0;i<x1;i++)
        a[i]=str1[i]-'0';
    for(i=0;i<x2;i++)
        b[i]=str2[i]-'0';                 
    for(i=x1-1,j=x2-1;j>=0&&i>=0;j--,i--)
    {
        c[k]=a[i]+b[j]+c[k];
        c[k+1]=c[k]/10;
        c[k]=c[k]%10;
        k++;
    }                                                
    if(i>=0)                            
        for(l=i;l>=0;l--)
        {
            c[k]=a[l]+c[k];
            c[k+1]=c[k]/10;
            c[k]=c[k]%10;
            k++;
        }
    else                                                          
        for(l=j;l>=0;l--)
        {
            c[k]=b[l]+c[k];
            c[k+1]=c[k]/10;
            c[k]=c[k]%10;
            k++;
        }
        int r=k;
       for(i=0;i<=k-1;i++)
         {if(c[k-i]==0)
           r=k-i-1;
           else
           i=k+1;
           
         }
    for(l=r;l>=0;l--)
        printf("%d",c[l]);
  
}
int main()
{
	const int maxlen = 202;
	char szline1[maxlen];
	char szline2[maxlen];
	int an1[maxlen];
	int an2[maxlen];
	gets(szline1);
	gets(szline2);
	int len1 = strlen(szline1);
	int len2 = strlen(szline2);
	memset(an1, 0, sizeof (an1));
	memset(an2, 0, sizeof(an2));
	for (int i = len1 - 1, j = 0; i >= 0; i --)
		an1[j ++] = szline1[i] - '0';
	for (int i = len2 - 1, j = 0; i >= 0; i --)
		an2[j ++] = szline2[i] - '0';
	int begin;
	for (int i = 0; i < maxlen - 1; i ++)
	{
		an1[i] += an2[i];
		if (an1[i] >= 10)
		{
			an1[i] -= 10;
			an1[i + 1] ++;
		}
		if (an1[i])
			begin = i;
	}
	for (int i = begin; i >= 0; i --)
		printf("%d", an1[i]);
	
	return 0;
}
int main()
{
	int i,la,lb,max;
	char a[260],b[260];
	int	a2[260]={0},b2[260]={0},c[260]={0};
	scanf("%s %s",a,b);
	la=strlen(a);
	lb=strlen(b);
	for(i=0;i<la;i++)
	{
		a2[i]=a[la-i-1]-'0';
	}
	for(i=0;i<lb;i++)
	{
		b2[i]=b[lb-i-1]-'0';
	}
	if(la>lb){max=la;}
	else {max=lb;}
	
	for(i=0;i<max;i++)
	{

			if(a2[i]+b2[i]+c[i]>=10)
			{c[i]=(c[i]+a2[i]+b2[i])%10;
			c[i+1]++;
			}
			else {c[i]=(c[i]+a2[i]+b2[i])%10;}			
		if(a2[max-1]+b2[max-1]+c[max-1]>=10)
		{
		max++;
		}
	}
	while(c[max-1]==0&&max>1)max--;

	for(i=max-1;i>=0;i--)
	{
		printf("%d",c[i]);

	}
}
int main()
{
	char str1[251], str2[251];
	int i = 0, j = 0, len1, len2, a[251], b[251], c[251], pos = 0;
	memset(a,0,sizeof(a));
    memset(b,0,sizeof(b));
//    memset(c,0,sizeof(c));
	cin >> str1 >> str2;
	len1 = strlen(str1);
	len2 = strlen(str2);
	for(i = len1 - 1;i >= 0;i--)
		a[j++] = str1[i] - '0';
	j = 0;
	for(i = len2 - 1;i >= 0;i--)
		b[j++] = str2[i] - '0';
	for(i = 0;i < len1 || i < len2;i++)
	{
		a[i] = a[i] + b[i];
		if(a[i] >= 10)
		{
			a[i] = a[i] - 10;
			a[i+1] = a[i+1] + 1;
		}
	}
	for(i = 250; i >= 0;i--)
		if(a[i] != 0)
		{
			pos = i;
			break;
		}
	for(i = pos;i >= 0;i--)
		cout << a[i];
	return 0;
}
main()
{
      char a[251],b[251],c[251];
      gets (a);
      gets (b);
      int i,j,m,n;
      
      for (i = 0;i <= 250;i++)
      if (a[i] == '\0')
      break;         
      
      for (j = 0;j <= 250;j++)
      if (b[j] == '\0')
      break;         

      if (i >= j)
      {
         m = i - j;
         for (;j >= 0;j--)
         b[j + m] = b[j];
         while (m >0)
         {
               b[m - 1] = '0';
               m--;
         }      
         n = i; 
      }
      if (i < j)
      {
         m = j - i;
         for (;i >= 0;i--)
         a[i + m] = a[i];
         while (m >0)
         {
               a[m - 1] = '0';
               m--;
         }      
         n = j; 
      }
      for (i = n - 1;i >= 0;i--)
      {
          c[i] = a[i] + b[i] -'0';
          if ((int)c[i] >= 10 + '0')
          {
             c[i] = c[i] - 10;
             a[i - 1]++;         
          }
      }
      
      if (a[0] + b[0] > 9 + '0' + '0')
      {
         printf ("1");
         for (i = 0;i <= n - 1;i++)
         printf ("%c",c[i]);
      }
      else
      for (i = 0;i <= n - 1;i++)
      {
          if ((int)c[0] == 0 + '0' && n != 1)
          for (i = 1;i <= n - 1;i++)
          printf ("%c",c[i]);
          else
          printf ("%c",c[i]);
      }
}
main()
{
	int a=0,b=0,c=0,d=0;
	char str1[250],str2[250],str3[250],str[250],str4[250],str5[250];
	scanf("%s",str1);
	scanf("%s",str2);
	a=strlen(str1);
	b=strlen(str2);
	if(str1[0]==48)
	{
		for(int i=0;i<a;i++)
		{
			if(str1[i]!='0')
			{
				c=i;
//				printf("%d\n",c);
				break;
			}
		}	
		for(int i=0;i<(a-c);i++)
		{
			str4[i]=str1[i+c];
	    }
	    for(int i=0;i<(a-c);i++)
	    {
			str1[i]=str4[i];
		}
		str1[a-c]='\0';
		a=a-c;
	}
	if(str2[0]==48)
	{
		for(int i=0;i<b;i++)
		{
			if(str2[i]!='0')
			{
				c=i;
				break;
			}
		}	
		for(int i=0;i<(b-c);i++)
		{
			str5[i]=str2[i+c];
	    }
	    for(int i=0;i<(b-c);i++)
	    {
			str2[i]=str5[i];
		}
		str2[b-c]='\0';
		b=b-c;
	}	
//	printf("%s %s\n",str1,str2);
	if(a>=b)
	{
		for(int i=0;i<b;i++)
		{
			str3[i+a-b]=str2[i];
	    }
	    for(int i=0;i<a;i++)
	    {
			str2[i]='0';
		}
		for(int i=0;i<b;i++)
		{
			str2[i+a-b]=str3[i+a-b];
	    }
//		printf("%s\n",str2);	    
	}
	else
	{
		for(int i=0;i<a;i++)
		{
			str3[i+b-a]=str1[i];
	    }
	    for(int i=0;i<b;i++)
	    {
			str1[i]='0';
		}
		for(int i=0;i<a;i++)
		{
			str1[i+b-a]=str3[i+b-a];
	    }
//		printf("%s\n",str1);		
	}
	if(a<=b)
	a=b;
	for(int i=0;i<a;i++)
	{
	    str[i]=str1[i]+str2[i]-48;
	}
 //   printf("%d,%d,%d\n",str1[0],str2[0],str[0]);
//	printf("%d\n",a-1);
//	printf("%d,%d,%d,%d\n",str[3],str[2],str1[2],str2[2]);	
	for(int i=a-1;i>0;i=i-1)
	{
		if(str[i]>=58)
		{
			str[i]=str[i]-10;
			str[i-1]=str[i-1]+1;
//			printf("%d,%d\n",str[i],str[i-1]);
	    }
	}
	str[a]='\0';
	if(str[0]>=('0'+10))
	{
		str[0]=str[0]-10;
		printf("1%s\n",str);
//		printf("%s\n",str);
	}

	else
	printf("%s",str);	
}
main()
{
    char a[250],b[250],m[250];
    int c,d,i,e,j,k;
    scanf("%s %s",a,b);
    c=strlen(a);
    d=strlen(b);
    k=0;
    if(c<d)
    {
           for(i=0;i<d;i++)
           {
              m[i]=a[i];
              a[i]=b[i];
              b[i]=m[i];             
           }
           e=c;
           c=d;
           d=e;
    }
    if(c>d)
    {
           for(i=c-1;i>=c-d;i--)
           b[i]=b[i+d-c];
           for(i=0;i<c-d;i++)
           b[i]='0';
    }
    for(i=c-1;i>0;i--)
    {
           m[i]=a[i]+b[i]-'0';
           if(m[i]>'9')
           {
              m[i]=m[i]-10;
              a[i-1]=a[i-1]+1;
           }
    }
    m[0]=a[0]+b[0]-'0';
    if(m[0]>'9')
    {
       m[0]=m[0]-10;
       printf("1");
       for(i=0;i<c;i++)
       printf("%c",m[i]);
    }
    else
    {
        for(i=0;i<c;i++)
        {
        if(m[i]!='0')
        {
        for(j=i;j<c;j++)
        printf("%c",m[j]);
        k=1;
        }
       if(k==1)
       break;
        }
        k=0;
        for(i=0;i<c;i++)
        {if(m[i]!='0')
        k=k+1;
        }
        if(k==0)
        printf("0");
    }
 
}
int main()
{
	int i,r,j=0;
	int A,B,C,D;
	int counta=0,countb=0;
	char a[250],b[250],c[250];
	char num[10]={'0','1','2','3','4','5','6','7','8','9'};
	gets(a);
	gets(b);
	for(i=0;a[i];i++) counta++;
	for(i=0;b[i];i++) countb++;
	if(counta>=countb)
	{
		for(i=counta-1;i>=(counta-countb);i--) b[i]=b[i-counta+countb];
		for(i=0;i<(counta-countb);i++) b[i]='0';
	}
    if(counta<countb)
	{
		for(i=countb-1;i>=(countb-counta);i--) a[i]=a[i-countb+counta];
		for(i=0;i<(countb-counta);i++) a[i]='0';
		counta=countb;
	}
    for(i=0;i<=counta;i++) c[i]='0';
    for(i=counta-1;i>=0;i--)
	{
		A=a[i]-'0';
		B=b[i]-'0';
		C=A+B;
		D=c[i+1]-'0';
		if(C+D<10)
			c[i+1]=num[C+D];
		else
		{
			c[i]='1';
			c[i+1]=num[C+D-10];}
		}
		for(i=0;i<=counta;i++)
			if(c[i]=='0') j++;
		if(j==counta+1) printf("0\n");
		else
		{
			for(i=0;i<=counta;i++)
			{	
				if(c[i]!='0')
				{
					r=i;
					break;
				}
			}
			for(i=r;i<=counta;i++) printf("%c",c[i]);
		}
		printf("\n");
	return 0;
}
/*
 *  ?????.cpp
 *  Created on: 2012-11-24
 *  Author: ???
 */
char a[300], b[300], c[300], tem[300];//a?b??????????????c??????
int i, len1, len2, len3, firstout;//len1?len2???a?b???
int plu(int n, int add) {//???????????
	if (n == 0) {//?????1?0??
		if (a[0] + b[0] + add >= 106) {//????????
			c[0] = a[0] + b[0] + add - 58;//??1?????
			for(i=len3;i>=1;i--){//????????
				c[i]=c[i-1];
			}
			c[0]='1';len3=len3+1;//?1??1
		} else {//?????
			c[0] = a[0] + b[0] + add - 48;//????1?
		}
	} else {//?????1?
		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;
}
int an1[MAX_LEN+10];
int an2[MAX_LEN+10];
char szLine1[MAX_LEN+10];
char szLine2[MAX_LEN+10];

int main()
{
    scanf("%s", szLine1);
    scanf("%s", szLine2);
    int i, j;
    memset( an1, 0, sizeof(an1));
    memset( an2, 0, sizeof(an2));
     int nLen1 = strlen( szLine1);
     j = 0;
     for( i = nLen1 - 1;i >= 0 ; i --)
          an1[j++] = szLine1[i] - '0';

     int nLen2 = strlen(szLine2);
     j = 0;
     for( i = nLen2 - 1;i >= 0 ; i--)
          an2[j++] = szLine2[i] - '0';

     for( i = 0;i < MAX_LEN ; i ++ )
     {
         an1[i] += an2[i];
         if( an1[i] >= 10 )
         {
                 an1[i] -= 10;
                 an1[i+1] ++;
         }
     }

     char bStartOutput = false;
     for( i = MAX_LEN; i >= 0; i-- )
     {
          if( bStartOutput)
              printf("%d", an1[i]);
          else if( an1[i] ) {
               printf("%d", an1[i]);
               bStartOutput = true;
          }
     }
     if(!bStartOutput)
          printf("0");

     
     return 0;
}
char inputA[260], inputB[260];
int a[260] = {0}, b[260] = {0};

int main() {
	cin.getline(inputA, 260);
	cin.getline(inputB, 260);

	int alen = strlen(inputA), blen = strlen(inputB);
	for(int i = alen - 1, j = 0; i >= 0; i --, j ++)
		a[j] = inputA[i] - '0';
	for(int i = blen - 1, j = 0; i >= 0; i --, j ++)
		b[j] = inputB[i] - '0';

	int len = max(alen, blen);
	for(int i = 0; i < len; i ++) {
		b[i] += a[i];
		if(b[i] >= 10) {
			b[i] -= 10;
			b[i + 1] += 1;
		}
	}

	int index = 0;
	for(int i = 259; i >= 0; i--)
		if(b[i] > 0) {
			index = i;
			break;
		}

	for(int i = index; i >= 0; i --)
		cout << b[i];
	cout << endl;
	return 0;
}
/*
 * 12.10.cpp
 *
 *  Created on: 2011-12-2
 *      Author: wuch
 */

int main(){
	char a[250],b[250];   //??????a?b
	int c[251],i,aa,bb,len1,len2;
	cin.getline(a,250);  //??a?b
	cin.getline(b,250);
	len1=strlen(a);      //??a?b???
	len2=strlen(b);
	for (i=0;i<=250;i++) c[i]=0;
	if (len1>len2) {     //?????????0??????????
		for (i=len1-1;i>=len1-len2;i--) b[i]=b[i-len1+len2];
		for (i=0;i<len1-len2;i++) b[i]='0';
		len2=len1;
	}
	if (len1<len2) {
			for (i=len2-1;i>=len2-len1;i--) a[i]=a[i-len2+len1];
			for (i=0;i<len2-len1;i++) a[i]='0';
			len1=len2;
		}
	for (i=0;i<len1;i++){ //?????i???????
		switch (a[len1-i-1]) //??a?????i?
		{
		case'0':aa=0;break;
		case'1':aa=1;break;
		case'2':aa=2;break;
		case'3':aa=3;break;
		case'4':aa=4;break;
		case'5':aa=5;break;
		case'6':aa=6;break;
		case'7':aa=7;break;
		case'8':aa=8;break;
		case'9':aa=9;break;
		default:break;
		}
		switch (b[len1-i-1])  //??b?????i?
		{
		case'0':bb=0;break;
		case'1':bb=1;break;
		case'2':bb=2;break;
		case'3':bb=3;break;
		case'4':bb=4;break;
		case'5':bb=5;break;
		case'6':bb=6;break;
		case'7':bb=7;break;
		case'8':bb=8;break;
		case'9':bb=9;break;
		default:break;
		}
		c[i]=c[i]+aa+bb;  //????
		if (c[i]>9) {  //???9???
			c[i+1]=1;
			c[i]=c[i]-10;
		}
	}
	for (i=250;i>0;i--) if (c[i]!=0) break; //???????0?
	len2=i;
	for (i=len2;i>=0;i--) cout<<c[i];  //??????0????????
	return 0;
}
// A+B ??.cpp : Defines the entry point for the console application.
//

//#include "stdafx.h"

int main()
{
	char a[251],b[251],j[260]={'\0'},A[251]={'\0'},B[251]={'\0'};
	int ac,bc,i,k,c,j1,j2,jw=0,p=0;
	gets (a);
	gets (b);
	ac=strlen(a);
	bc=strlen(b);
	if (ac>bc)
	{
		c=ac;
		for (i=0;i<ac-bc;i++)
			B[i]='0';
		B[i]='\0';
		strcat(B, b);
		strcpy(A,a);
	}
	if (ac<bc)
	{
		c=bc;
		for (i=0;i<bc-ac;i++)
			A[i]='0';
		A[i]='\0';
		strcat(A, a);
		strcpy(B, b);
	}
	if (ac==bc)
	{
		c=ac;
		strcpy(A,a);
		strcpy(B,b);
	}
	for (i=c-1,k=0;i>=0;i--,k++)
	{
		j1=A[i]-'0';
		j2=B[i]-'0';
		if (j1+j2+jw<=9)
		{
			j[k]=j1+j2+jw+'0';
			jw=0;
		}
		else
		{
			j[k]=j1+j2+jw-10+'0';
			jw=1;
		}
		if (i==0&&jw==1)
			j[k+1]='1';
	}
	if (j[0]=='0'&&j[1]=='\0')
		printf("0");
	c=strlen(j);
	for (i=c-1;i>=0;i--)
	{
		if (j[i]!='0'||p==1)
		{
			printf("%c", j[i]);
			p=1;
		}
		
	}

	return 0;
}
int main()
{
	char a[251],b[251];
	int c[251]={0},d[251]={0};
	cin>>a>>b;
	int m=strlen(a),n=strlen(b);
	for(int i=m-1,j=0;i>=0;i--,j++)
	{
		c[j]=a[i]-'0';
	}
	for(int k=n-1,j=0;k>=0;k--,j++)
	{
		d[j]=b[k]-'0';
	}
	for(int i=0;i<251;i++)
	{
		if(c[i]+d[i]<10)
			c[i]+=d[i];
		else
		{
			c[i]=c[i]+d[i]-10;
			c[i+1]++;
		}
	}
	int i=250;
	for(;c[i]==0&&i>=0;i--);
	if(i==-1)
	{
		cout<<0;
	}
	else
	{
	for(;i>=0;i--)
		cout<<c[i];
	}
	return 0;
}