#include <bits/stdc++.h>
using namespace std;
const int MAX = 1500;
int main() {
string a, b;
int na[MAX] = {0}, nb[MAX] = {0};
int c[MAX] = {0};
cin >> a >> b;
reverse(a.begin(), a.end());
reverse(b.begin(), b.end());
int la = a.length();
int lb = b.length();
for (int i = 0; i < la; i++) {
na[i] = a[i] - '0';
}
for (int i = 0; i < lb; i++) {
nb[i] = b[i] - '0';
}
int times = max(la, lb);
bool bos = false;
if (la < lb || (la == lb && a < b)) {
swap(a, b);
swap(na, nb);
swap(la, lb);
bos = true;
}
int borrow = 0;
for (int i = 0; i < times; i++) {
int mi = na[i] - nb[i] - borrow;
if (mi < 0) {
mi += 10;
borrow = 1;
} else {
borrow = 0;
}
c[i] = mi;
}
while (times > 1 && c[times - 1] == 0) {
times--;
}
if (bos) {
cout << '-';
}
for (int i = times - 1; i >= 0; i--) {
cout << c[i];
}
return 0;
}