include [HTML_REMOVED]
include [HTML_REMOVED]
using namespace std;
bool PAN(vector[HTML_REMOVED] X, vector[HTML_REMOVED] Y)
{
if (X.size() > Y.size())
return true;
if (X.size() < Y.size())
return false;
for (int i = X.size() - 1; i >= 0; i–)
{
if (X[i] > Y[i])
return true;
if (X[i] < Y[i])
return false;
}
return true;
}
vector [HTML_REMOVED] Sub(vector[HTML_REMOVED] X, vector[HTML_REMOVED] Y)
{
vector[HTML_REMOVED] Z;
int t = 0;
for (int i = 0; i < X.size(); i++)
{
t = X[i] - t;
if (i < Y.size())
t -= Y[i];
Z.push_back((t + 10) % 10);
if (t < 0)
t = 1;
else
t = 0;
}
while (Z.size() > 1 && Z.back() == 0)
Z.pop_back();
return Z;
}
int main()
{
string a, b;
vector[HTML_REMOVED] A,B;
cin >> a >> b;
for (int i = a.size() - 1; i >= 0; i–)
A.push_back(a[i] - ‘0’);
for (int i = b.size() - 1; i >= 0; i–)
B.push_back(b[i] - ‘0’);
if (PAN(A, B))
{
vector<int> E = Sub(A, B);
for (int i = E.size() - 1; i >= 0; i--)
cout << E[i];
}
else
{
vector<int> E = Sub(B, A);
cout << '-';
for (int i = E.size() - 1; i >= 0; i--)
cout << E[i];
}
return 0;
}