while 1:
try:
nums, target = input().split()
target = int(target)
nums = list(map(int, nums.split(","
while 1:
try:
nums, target = input().split()
target = int(target)
nums = list(map(int, nums.split(","