/*********************************
* Class: MAGSHIMIM C2 *
* Week 1 *
**********************************/
#include <stdio.h>
#include <math.h>
char *strrev(char *str){
char c, *front, *back;
if (!str || !*str)
return str;
for (front = str, back = str + strlen(str) - 1; front < back; front++, back--){
c = *front; *front = *back; *back = c;
}
return str;
}
char numA[1000101] = { 0 };
char numB[1000101] = { 0 };
char result[1000101] = { 0 };
int main(void)
{
int i = 0, currentAlsd = 0, currentBlsd = 0, currentDigit = 0;
scanf("%s", numA);
scanf("%s", numB);
int aIndex = strlen(numA) - 1;
int bIndex = strlen(numB) - 1;
//printf("Lengths %d %d ", aIndex, bIndex);
int maxLength = strlen(numA) > strlen(numB) ? strlen(numA) : strlen(numB);
//printf("MaxLength : %d", maxLength);
//system("pause");
for (i = 0; i < maxLength; i++)
{
currentAlsd = aIndex < 0 ? 0 : numA[aIndex--] - '0';
currentBlsd = bIndex < 0 ? 0 : numB[bIndex--] - '0';
currentDigit = (currentAlsd + currentBlsd) % 10;
result[i] = currentDigit + '0';
//puts(result);
//printf("iteration %d : A lsd: %d B lsd: %d", i, currentAlsd, currentBlsd);
}
int numOfZeroes = strspn(result, "0");
//printf("num of zeroes :%d\n", numOfZeroes);
puts(numOfZeroes == strlen(result) ? "0" : strrev(result));
system("Pause");
}