#include <bits/stdc++.h>
using namespace std;
int main()
{
char a1[5005],b1[5005],c1[5005];
int a[5005],b[5005],c[5005];
memset(a,0,sizeof(a)); memset(b,0,sizeof(b));
memset(c,0,sizeof(c));
scanf("%s%s",a1,b1);
int lena = strlen(a1);
int lenb = strlen(b1);
if(lena < lenb || (lena == lenb) && strcmp(a1,b1) < 0)
{
strcpy(c1,a1);
strcpy(a1,b1);
strcpy(b1,c1);
printf("-");
swap(lena,lenb); }
for(int i = 0;i < lena;i++) {
a[lena - i] = a1[i] - '0';
}
for(int i = 0;i < lenb;i++) {
b[lenb - i] = b1[i] - '0';
}
int i = 1; while(i <= lena || i <= lenb) {
if(a[i] < b[i])
{
a[i] += 10;
a[i + 1]--; }
c[i] = a[i] - b[i];
i++;
}
int lenc = i;
while((c[lenc] == 0) && (lenc > 1))
{
lenc--; }
for(int i = lenc;i >= 1;i--)
{
printf("%d",c[i]);
}
printf("\n");
return 0;
}