#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
class BigInteger
{
private:
int sign;
string num;
string add(string &s);
string sub(string &a, string &b);
public:
BigInteger(const string& s);
const BigInteger operator+(BigInteger& a);
friend void debug(BigInteger& a)
{
string::size_type begin_idx = a.num.find_first_not_of("0");
if (begin_idx == string::npos)
{
cout << "0" << endl;
}
else
{
cout << (a.sign==1?"-":"") << a.num.substr(begin_idx) << endl;
}
}
};
BigInteger::BigInteger(const string& s)
{
if (s[0] == '-')
{
sign = 1;
num = string(s, 1, string::npos);
}
else
{
sign = 0;
num = s;
}
}
string BigInteger::add(string &s)
{
int max_len=max(s.length(), num.length()), min_len=min(s.length(), num.length());
string res(max_len+1, '0');
int carry = 0;
string::reverse_iterator a_iter=num.rbegin();
string::reverse_iterator b_iter=s.rbegin();
int i = res.size()-1;
for (;a_iter != num.rend() && b_iter != s.rend() ;a_iter++, b_iter++, i--)
{
res[i] = *a_iter - '0' + *b_iter - '0' + carry;
carry = res[i]/10;
res[i] = res[i] % 10 + '0';
}
for (;a_iter != num.rend();a_iter++, i--)
{
res[i] = *a_iter - '0' + carry;
carry = res[i]/10;
res[i] = res[i] % 10 + '0';
}
for (;b_iter != s.rend() ;b_iter++, i--)
{
res[i] = *b_iter - '0' + carry;
carry = res[i]/10;
res[i] = res[i] % 10 + '0';
}
res[i] = carry+'0';
return res;
}
string BigInteger::sub(string &a, string &b)
{ // a > b
int max_len=max(a.length(), b.length()), min_len=min(a.length(), b.length());
string res(max_len, '0');
int recede = 0;
string::reverse_iterator a_iter=a.rbegin();
string::reverse_iterator b_iter=b.rbegin();
int i = res.size()-1;
for (;a_iter != a.rend() && b_iter != b.rend() ;a_iter++, b_iter++, i--)
{
res[i] = *a_iter - *b_iter - recede;
if (res[i] < 0)
{
recede = 1;
res[i] = res[i] + 10 + '0';
}
else
{
recede = 0;
res[i] = res[i] + '0';
}
}
for (;a_iter != a.rend();a_iter++, i--)
{
res[i] = *a_iter - '0' - recede;
if (res[i] < 0)
{
recede = 1;
res[i] = res[i] + 10 + '0';
}
else
{
recede = 0;
res[i] = res[i] + '0';
}
}
for(;b_iter != b.rend() ;b_iter++, i--)
{
res[i] = *b_iter - '0' - recede;
if (res[i] < 0)
{
recede = 1;
res[i] = res[i] + 10 + '0';
}
else
{
recede = 0;
res[i] = res[i] + '0';
}
}
return res;
}
const BigInteger BigInteger::operator+(BigInteger &a)
{
if (a.sign == sign)
{
num = add(a.num);
}
else
{
if (num.size()>a.num.size() || (num.size() == a.num.size() && num > a.num))
{
num = sub(num, a.num);
}
else
{
num = sub(a.num, num);
sign = a.sign;
}
}
return *this;
}
int main()
{
string sa, sb;
while (cin >> sa >> sb)
{
BigInteger a = BigInteger(sa);
BigInteger b = BigInteger(sb);
BigInteger c = a + b;
debug(c);
}
return 0;
}