def two_sum(nums,target):
result = []
n = len(nums)
for i in range(n):
for j in range(i+1,n):
#print()
sum_nums = nums[i]+nums[j]
#print(sum_nums)
if sum_nums == target:
result.append(nums[i])
result.append(nums[j])
return result
x = input()
nums = x.split(’,’)
nums = [int(nums[i]) for i in range(len(nums))]
nums = list(set(nums))
target = int(input())
two_sum(nums,target)