#include <iostream>
#include <cstring>
#include <cstdlib>
#include <cstdio>
using namespace std;
const int MAX = 110;
class CHugeInt {
private:
char buf[220];
void reverse()
{
int tmp;
int len = strlen(buf);
for (int i = 0; i < len / 2; i ++)
{
tmp = buf[i];
buf[i] = buf[len - 1 - i];
buf[len - 1 - i] = tmp;
}
}
public:
CHugeInt(int n)
{
memset(buf, 0, sizeof(buf));
sprintf(buf, "%d", n);
reverse();
}
CHugeInt(char *s)
{
memset(buf, 0, sizeof(buf));
strcpy(buf, s);
reverse();
}
CHugeInt operator+(const CHugeInt b){
CHugeInt tmp(0);
int lena = strlen(buf), lenb = strlen(b.buf);
int len = max(lena, lenb);
int t = 0, i;
for (i = 0; i < len; i ++)
{
if (i < lena) t = t + buf[i] - '0';
if (i < lenb) t = t + b.buf[i] - '0';
tmp.buf[i] = t % 10 + '0';
t /= 10;
}
if (t) tmp.buf[i] = t + '0';
return tmp;
}
CHugeInt operator+(int n)
{
return *this + CHugeInt(n);
}
friend CHugeInt operator+(int n,CHugeInt &a)
{
return a + n;
}
friend ostream & operator<<(ostream &o, const CHugeInt &a)
{
int len = strlen(a.buf);
for (int i = len - 1; i >= 0; i --)
cout << a.buf[i];
return o;
}
CHugeInt operator++()
{
*this = *this + 1;
return *this;
}
CHugeInt operator++(int k)
{
CHugeInt tmp = *this;
*this = *this + 1;
return tmp;
}
CHugeInt operator+=(int n)
{
*this = *this + n;
return *this;
}
};
int main()
{
char s[210];
int n;
while (cin >> s >> n) {
CHugeInt a(s);
CHugeInt b(n);
cout << a + b << endl;
cout << n + a << endl;
cout << a + n << endl;
b += n;
cout << ++ b << endl;
cout << b++ << endl;
cout << b << endl;
}
return 0;
}