#include<bits/stdc++.h>
using namespace std;
#define el "\n"
#define ll long long
#define ull unsigned long long
#define se second
#define fi first
#define be begin()
#define en end()
#define Faster cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
int main()
{
Faster;
string a, b; cin >> a >> b;
int ok = 0;
string s = "";
if(a.size() < b.size())
{
swap(a,b);
ok = 1;
}
if(a.size() == b.size() && a < b)
{
swap(a,b);
ok = 1;
}
string tmp = "";
for(int i = 0; i < a.size() - b.size(); i++)
{
tmp += '0';
}
b= tmp + b;
int du = 0;
for(int i = a.size() - 1; i >= 0; i--)
{
int x = a[i] - '0';
int y = b[i] - '0' + du;
if(x < y)
{
x += 10;
du = 1;
}
else
{
du = 0;
}
s += to_string(x - y);
}
if(s.size() > 1 && s.back() == '0') s.pop_back();
if(ok == 1) cout << "-";
reverse(s.begin(), s.end());
cout << s;
return 0;
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKI2RlZmluZSBlbCAiXG4iCiNkZWZpbmUgbGwgbG9uZyBsb25nCiNkZWZpbmUgdWxsIHVuc2lnbmVkIGxvbmcgbG9uZwojZGVmaW5lIHNlIHNlY29uZAojZGVmaW5lIGZpIGZpcnN0CiNkZWZpbmUgYmUgYmVnaW4oKQojZGVmaW5lIGVuIGVuZCgpCiNkZWZpbmUgRmFzdGVyIGNpbi50aWUoMCk7IGNvdXQudGllKDApOyBpb3NfYmFzZTo6c3luY193aXRoX3N0ZGlvKDApOwoKaW50IG1haW4oKQp7CiAgICBGYXN0ZXI7CiAgICBzdHJpbmcgYSwgYjsgY2luID4+IGEgPj4gYjsKICAgIGludCBvayA9IDA7CiAgICBzdHJpbmcgcyA9ICIiOwogICAgaWYoYS5zaXplKCkgPCBiLnNpemUoKSkKICAgIHsKICAgICAgICBzd2FwKGEsYik7CiAgICAgICAgb2sgPSAxOwogICAgfQogICAgaWYoYS5zaXplKCkgPT0gYi5zaXplKCkgJiYgYSA8IGIpCiAgICB7CiAgICAgICAgc3dhcChhLGIpOwogICAgICAgIG9rID0gMTsKICAgIH0KICAgIHN0cmluZyB0bXAgPSAiIjsKICAgIGZvcihpbnQgaSA9IDA7IGkgPCBhLnNpemUoKSAtIGIuc2l6ZSgpOyBpKyspCiAgICB7CiAgICAgICAgdG1wICs9ICcwJzsKICAgIH0KICAgIGI9IHRtcCArIGI7CiAgICBpbnQgZHUgPSAwOwogICAgZm9yKGludCBpID0gYS5zaXplKCkgLSAxOyBpID49IDA7IGktLSkKICAgIHsKICAgICAgICBpbnQgeCA9IGFbaV0gLSAnMCc7CiAgICAgICAgaW50IHkgPSBiW2ldIC0gJzAnICsgZHU7CiAgICAgICAgaWYoeCA8IHkpCiAgICAgICAgewogICAgICAgICAgICB4ICs9IDEwOwogICAgICAgICAgICBkdSA9IDE7CiAgICAgICAgfQogICAgICAgIGVsc2UKICAgICAgICB7CiAgICAgICAgICAgIGR1ID0gMDsKICAgICAgICB9CiAgICAgICAgcyArPSB0b19zdHJpbmcoeCAgLSB5KTsKICAgIH0KICAgIGlmKHMuc2l6ZSgpID4gMSAmJiBzLmJhY2soKSA9PSAnMCcpIHMucG9wX2JhY2soKTsKICAgIGlmKG9rID09IDEpIGNvdXQgPDwgIi0iOwogICAgcmV2ZXJzZShzLmJlZ2luKCksIHMuZW5kKCkpOwogICAgY291dCA8PCBzOwogICAgcmV0dXJuIDA7Cn0K