#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
#define MAX 300
int prom[MAX] = {,,,,,,,,,,,,,,,,,,,,,,,,,,,};
char A[MAX];
char B[MAX];
int ans[MAX];
int isNEnd() {
if(strcmp(A,"") == && strcmp(B,"") == ) {
return ;
}
else {
return ;
}
}
int main(int argc, char const *argv[])
{
memset(A,-,sizeof(A));
memset(B,-,sizeof(B));
scanf("%s %s",A,B);
while(isNEnd()) {
int lenA = strlen(A);
int lenB = strlen(B);
int i = lenA - , j = lenB - ;
int wtemp = ;
int bitb = ;
int bitc = ;
while(i >= || j >= ) {
int i0 = i;
int j0 = j;
int numa = , numb = ;
while(i >= && A[i] != ',') {
//printf("%d\n",A[i]);
i--;
}
if(i0 >= ) {
for(int k = i + ; k <= i0; k++) {
numa = numa * + A[k] - '';
}
}
while(j >= && B[j] != ',') {
//printf("%d\n",B[j]);
j--;
}
if(j0 >= ) {
for(int k = j + ; k <= j0; k++) {
numb = numb * + B[k] - '';
}
}
int bit = numa + numb + bitc;
bitb = bit % prom[wtemp];
bitc = bit / prom[wtemp];
ans[wtemp] = bitb;
i--;
j--;
wtemp++;
}
if(bitc != ) {
ans[wtemp] = bitc;
wtemp++;
}
for(int i = wtemp -; i >= ; i--) {
printf("%d,",ans[i]);
}
printf("%d\n",ans[]);
scanf("%s %s",A,B);
}
return ;
}