primes = [True] * 100 for i in range(2, 10): if primes[i]: for j in range(i * i, 100, i): primes[j] = False primes = [i for i in range(2, 100) if primes[i]] a, b = input().split() a = a.split(',')[::-1] b = b.split(',')[::-1] carry = 0 result = [] for i in range(max(len(a), len(b))): digit_a = int(a[i]) if i < len(a) else 0 digit_b = int(b[i]) if i < len(b) else 0 total = digit_a + digit_b + carry carry = total // primes[i] result.append(total % primes[i]) if carry: result.append(carry) print(','.join(map(str, result[::-1])))