1,0,1
1,1,1,0
1,0,0,0,0,0
#include<stdio.h>
int p[26]={1,2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97};
int main()
{
int a[26],b[26],sum[26];
int m,n,i,j,k,add,x,y,max;
char c;
while(1)
{
for(i=0;i<=25;i++)
{
a[i]=0;b[i]=0;sum[i]=0;
}
for(i=1;i<=25;i++)
{
scanf("%d",&a[i]);
scanf("%c",&c);
if(c==' ')break;
}m=i;
for(i=1;i<=25;i++)
{
scanf("%d",&b[i]);
scanf("%c",&c);
if(c=='\n')break;
}n=i;
if(a[1]==0&&b[1]==0)break;
k=m>n?m:n;
for(i=1,add=0,max=k;i<=max;i++)
{
if(m>=1)x=a[m--];
else x=0;
if(n>=1)y=b[n--];
else y=0;
sum[k--]=(x+y+add)%p[i];
add=(x+y+add)/p[i];
}
sum[0]=add;
if(sum[0]!=0)printf("%d,",sum[0]);
for(i=1;i<max;i++)
printf("%d,",sum[i]);
printf("%d\n",sum[max]);
}
return 0;
}