主函数直接用符号
#include<bits/stdc++.h>
using namespace std;
const int N=5005,best=10000;
struct bign{
int len,x[N];
bign(){
len=1;
memset(x,0,sizeof(x));
}
};
bign read(string s){
bign a;
int k=0,t=1,cnt=1;
int ls=s.size();
for(int i=ls;i>0;i--){
k=k+(s[i-1]-'0')*t;
t*=10;
if(t==best){
a.x[cnt]=k;
a.len++;
cnt++;
k=0;t=1;
}
}
if(t>1){
a.x[a.len]=k;
}
return a;
}
void print(bign a){
cout<<a.x[a.len];
for(int i=a.len-1;i>0;i--){
printf("%04d",a.x[i]);
}
cout<<endl;
}
bign fix(bign a){
for(int i=1;i<a.len;i++){
while(a.x[i]<0){
a.x[i]+=best;
a.x[i+1]--;
}
a.x[i+1]+=a.x[i]/best;
a.x[i]%=best;
}
while(a.x[a.len] >= best){
a.x[a.len + 1] += a.x[a.len] / best;
a.x[a.len] %= best;
a.len ++;
}
while(a.x[a.len]==0&&a.len>1)a.len--;
return a;
}
bign operator +(bign a,int b){
a.x[1]+=b;
return fix(a);
}
bign operator +(bign a,bign b){
bign c;
c.len=max(a.len,b.len);
for(int i=1;i<=c.len;i++){
c.x[i]=a.x[i]+b.x[i];
}
return fix(c);
}
bool operator <(bign a,bign b){
if(a.len!=b.len){
return a.len<b.len;
}else{
for(int i=a.len;i>0;i--){
if(a.x[i]!=b.x[i])return a.x[i]<b.x[i];
}
}
return 0;
}
bool operator >=(bign a,bign b){
if(a.len!=b.len){
return a.len>=b.len;
}else{
for(int i=a.len;i>0;i--){
if(a.x[i]!=b.x[i])return a.x[i]>=b.x[i];
}
}
return 1;
}
bign operator -(bign a,int b){
a.x[1]-=b;
return fix(a);
}
bign operator -(bign a,bign b){
bign c;
c.len=max(a.len,b.len);
for(int i=1;i<=c.len;i++){
c.x[i]=a.x[i]-b.x[i];
}
return fix(c);
}
bign operator *(bign a,int b){
bign c;
for(int i=1;i<=a.len;i++){
c.x[i]=a.x[i]*b;
}
return fix(c);
}
bign operator *(bign a,bign b){
bign c;
c.len=a.len+b.len+1;
for(int i=1;i<=a.len;i++){
for(int j=1;j<=b.len;j++){
c.x[i+j-1]+=a.x[i]*b.x[j];
c.x[i+j]+=c.x[i+j-1]/best;
c.x[i+j-1]%=best;
}
}
return fix(c);
}
bign operator /(bign a,int b){
bign c;
c.len=a.len;
long long v=0;
for(int i=c.len;i>0;i--){
v=v*best+a.x[i];
c.x[i]=v/b;
v%=b;
}
return fix(c);
}
int main(){
string a,b;
bign x,y,z;
cin>>a>>b;
x = read(a);
y = read(b);
z = x + y;
print(z);
return 0;
}