//高精度加法
#include <bits/stdc++.h>
using namespace std;
int main() {
char a1[5005], b1[5005];
int a[5005], b[5005], c[5005];
int la, lb, lc = 1, x=0, i;
memset(a, 0, sizeof(a));
memset(b, 0, sizeof(b));
memset(c, 0, sizeof(c));
cin>>a1>>b1;
la = strlen(a1);
lb = strlen(b1);
for(i=0; i<la; i++) a[la - i] = a1[i] - '0';
for(i=0; i<lb; i++) b[lb - i] = b1[i] - '0';
while(lc <= la || lc <= lb) {
c[lc] = a[lc] + b[lc] + x;
x = c[lc] / 10;
c[lc] %= 10;
lc++;
}
c[lc] = x;
if(c[lc] == 0) {
lc--;
}
for(int i=lc; i>=1; i--) {
cout<<c[i];
}
return 0;
}
//高精度减法
#include <bits/stdc++.h>
using namespace std;
int main() {
char a1[5005], b1[5005],l1[5005];
int a[5005], b[5005], c[5005];
int la, lb, lc, x=0, i;
memset(a, 0, sizeof(a));
memset(b, 0, sizeof(b));
memset(c, 0, sizeof(c));
cin>>a1>>b1;
la = strlen(a1);
lb = strlen(b1);
if(la<lb||(la==lb&&strcmp(a1,b1)<0)) {
strcpy(l1,a1);
strcpy(a1,b1);
strcpy(b1,l1);
cout<<"-";
}
for(i=0; i<la; i++) a[la - i] = a1[i] - '0';
for(i=0; i<lb; i++) b[lb - i] = b1[i] - '0';
while(lc <= la || lc <= lb) {
if(a[lc]<b[lc])
{
a[lc]+=10;
a[lc+1]--;
}
c[lc]=a[lc]-b[lc];
lc++;
}
c[lc] = x;
if(c[lc] == 0) {
lc--;
}
for(int i=lc; i>=1; i--) {
cout<<c[i];
}
return 0;
}