#include <iostream>
#include <cstring>
using namespace std;
char sum[510], s1[510], s2[510];
void swap(char* p, char* q) {
char temp = *p;
*p = *q;
*q = temp;
}
void rev(char ch[510]) {
int l = strlen(ch);
for (int i = 0, j = l - 1; i < j; i++, j--) {
swap(ch[i], ch[j]);
}
}
void add(char* p, char* q, char* s) {
int cx = 0, i = 0;
while (*p) {
int t = (*p - '0') + (*q - '0') + cx;
*s = '0' + t % 10;
cx = t / 10;
p++;
q++;
s++;
}
while (*q) {
int t = *q - '0' + cx;
cout << t << endl;
*s = t % 10 + '0';
cx = t / 10;
q++;
s++;
}
if (cx) {
*s = '1';
s++;
}
rev(sum);
}
int main() {
cin >> s1 >> s2;
rev(s1);
rev(s2);
if (strlen(s1) > strlen(s2)) {
swap(s1, s2);
}
add(s1, s2, sum);
cout << sum << endl;
return 0;
}