#include<bits/stdc++.h>
#define do_not_copy return 0;
using namespace std;
enum tnum{
a=1,b=2,c=3,d=4,e=5,f=6,g=7,h=8,i=9,j=0
};
short stoi(tnum aa){
return short(aa);
}
tnum itos(short aa){
return tnum(aa);
}
struct s_int{
queue<tnum> q;
void int_in(){
char cc;
while(q.size())q.pop();
while(cc!=' '&&cc!='\n')
{
cc=getchar();
if(cc==' ')break;
tnum t;
switch(cc){
case '0':t=j;break;
case '1':t=a;break;
case '2':t=b;break;
case '3':t=c;break;
case '4':t=d;break;
case '5':t=e;break;
case '6':t=f;break;
case '7':t=g;break;
case '8':t=h;break;
case '9':t=i;break;
default:return;
}
q.push(t);
}
}
void int_out(){
queue<tnum> tempq=q;
while(tempq.size()){
if(tempq.size())
cout<<tempq.front();
tempq.pop();
}
}
s_int operator + (s_int b)
{
queue<tnum> aq=q,bq=b.q;
stack<tnum> ts1,ts2,ts3;
while(aq.size()){
ts1.push(aq.front());
aq.pop();
}
while(bq.size()){
ts2.push(bq.front());
bq.pop();
}
bool c=0;
while(ts1.size()||ts2.size()){
short a=ts1.top(),b=ts2.top();
ts1.pop(),ts2.pop();
ts3.push(itos((a+b+c)%10));
c=(a+b)/10;
}
while(ts1.size()){
ts3.push(itos(stoi(ts1.top())+1));
ts1.pop();
}
while(ts2.size()){
ts3.push(itos(stoi(ts2.top())+1));
ts2.pop();
}
s_int d;
while(ts3.size()){
d.q.push(ts3.top());
ts3.pop();
}
return d;
}
};
int main(){
s_int a,b;
a.int_in();
b.int_in();
s_int c=a+b;
c.int_out();
do_not_copy
}