Polycarp has guessed three positive integers $a$, $b$ and $c$. He keeps these numbers in secret, but he writes down four numbers on a board in arbitrary order — their pairwise sums (three numbers) and sum of all three numbers (one number). So, there are four numbers on a board in random order: $a+b$, $a+c$, $b+c$ and $a+b+c$.

You have to guess three numbers $a$, $b$ and $c$ using given numbers. Print three guessed integers in any order.

Pay attention that some given numbers $a$, $b$ and $c$ can be equal (it is also possible that $a=b=c$).


-----Input-----

The only line of the input contains four positive integers $x_1, x_2, x_3, x_4$ ($2 \le x_i \le 10^9$) — numbers written on a board in random order. It is guaranteed that the answer exists for the given number $x_1, x_2, x_3, x_4$.


-----Output-----

Print such positive integers $a$, $b$ and $c$ that four numbers written on a board are values $a+b$, $a+c$, $b+c$ and $a+b+c$ written in some order. Print $a$, $b$ and $c$ in any order. If there are several answers, you can print any. It is guaranteed that the answer exists.


-----Examples-----
Input
3 6 5 4

Output
2 1 3

Input
40 40 40 60

Output
20 20 20

Input
201 101 101 200

Output
1 100 100

Difficulty: EASY
Tags: Mathematics

Starter code:

Solutions:
my_list = list(map(int, input().split()))
sum_of_3 = max(my_list)
answer = []
for i in my_list:
	if i != sum_of_3:
		answer.append(sum_of_3 - i)
print(*answer)


A = list(map(int, input().split()))
A.sort()
c = A[3] - A[0]
b = A[3] - A[1]
a = A[3] - A[2]
print(a, b, c)


l = list(map(int, input('').split()))
l.sort()
x = l[0]
y = l[1]
z = l[2]
w = l[3]
print(w - x, w - y, w - z)


n = list(map(int, input().split()))
maxi = 0
max_idx = 0
for i in range(4):
	if n[i] > maxi:
		maxi = n[i]
		max_idx = i
res = []
for i in range(4):
	if i != max_idx:
		res.append(maxi - n[i])
print(res[0], res[1], res[2])


nums = sorted([int(tok) for tok in input().split()])
print(nums[-1] - nums[0], nums[-1] - nums[1], nums[-1] - nums[2])


x = list(map(int, input().split()))
p = max(x)
for i in x:
	if p == i:
		continue
	else:
		print(p - i, end=' ')
print()


arr = list(map(int, input().split()))
n = max(arr)
res = ''
for i in arr:
	if n != i:
		res += str(n - i) + ' '
print(res)


from fractions import gcd
inpNum = input()
inpNumsplit = list(sorted(map(int, inpNum.split())))
print(inpNumsplit[3] - inpNumsplit[2], inpNumsplit[3] - inpNumsplit[1], inpNumsplit[3] - inpNumsplit[0])


n = [int(z) for z in input().split()]
max = max(n)
n.remove(max)
print(max - n[0], max - n[1], max - n[2])


l = [int(x) for x in input().split()]
l.sort()
a = l[-1] - l[-2]
b = l[-3] - a
c = l[-4] - a
print(a, b, c)


a = [int(x) for x in input().split()]
a.sort()
b = a[-1] - a[0]
c = a[-1] - a[1]
d = a[-1] - a[2]
print(b, c, d)


num1 = input()
a = []

def get_the_data(count, num, arr):
	for i in range(0, len(num)):
		if num[i] == ' ':
			arr.append(int(num[count:i]))
			count = i + 1
		elif i == len(num) - 1:
			arr.append(int(num[count:len(num)]))
	return arr
numbers = get_the_data(0, num1, a)
numbers.sort()
sum_of_all = numbers[len(numbers) - 1]
result = ''
a = sum_of_all - numbers[0]
result += str(a) + ' '
b = sum_of_all - numbers[1]
result += str(b) + ' '
c = sum_of_all - numbers[2]
result += str(c)
print(result)


import math
inp = lambda cast=int: list(map(cast, input().split()))
ns = inp()
(ab, ca, bc, abc) = sorted(ns)
b = ab + bc - abc
a = ab + ca - abc
c = bc + ca - abc
print('{} {} {}'.format(a, b, c))


an = list(map(int, input().split()))
an.sort()
print(an[3] - an[0], an[3] - an[1], an[3] - an[2])


nums = input().split()
nums = list(map(int, nums))
x1 = nums[0]
x2 = nums[1]
x3 = nums[2]
x4 = nums[3]
s = (x1 + x2 + x3 + x4) / 3
if s == x1:
	print(int(s - x2), end=' ')
	print(int(s - x3), end=' ')
	print(int(s - x4), end=' ')
elif s == x2:
	print(int(s - x1), end=' ')
	print(int(s - x3), end=' ')
	print(int(s - x4), end=' ')
elif s == x3:
	print(int(s - x1), end=' ')
	print(int(s - x2), end=' ')
	print(int(s - x4), end=' ')
elif s == x4:
	print(int(s - x1), end=' ')
	print(int(s - x2), end=' ')
	print(int(s - x3), end=' ')


l = list(map(int, input().split()))
for i in l:
	if i == max(l):
		continue
	else:
		print(max(l) - i, end=' ')


def solve():
	numbers = [int(x) for x in input().split()]
	totalsum = max(numbers)
	for i in range(4):
		numbers[i] = totalsum - numbers[i]
	numbers.remove(0)
	print(*numbers)
	return
solve()


(x1, x2, x3, x4) = map(int, input().split())
max_num = max(x1, x2, x3, x4)
item = [x1, x2, x3, x4]
item.remove(max_num)
ans = []
for a in item:
	ans.append(max_num - a)
for a in ans:
	print(a, end=' ')
print()


(x1, x2, x3, x4) = sorted([int(num) for num in input().split()])
print(x4 - x3, x4 - x2, x4 - x1)


(sum1, sum2, sum3, sum4) = map(int, input().split())
sum = max(sum1, sum2, sum3, sum4)
if sum == sum4:
	x1 = sum - sum1
	x2 = sum - sum2
	x3 = sum - sum3
elif sum == sum3:
	x1 = sum - sum1
	x2 = sum - sum2
	x3 = sum - sum4
elif sum == sum2:
	x1 = sum - sum1
	x2 = sum - sum3
	x3 = sum - sum4
else:
	x1 = sum - sum2
	x2 = sum - sum3
	x3 = sum - sum4
print(x1, x2, x3)


numbers = list(map(int, input().rstrip().split()))
max_num = max(numbers)
numbers.remove(max_num)
number = []
for i in range(3):
	print(max_num - numbers[i], end=' ')


n = list(map(int, input().split(' ')))
max_m = max(n)
for i in range(4):
	if max_m - n[i] != 0:
		print(max_m - n[i], end=' ')


import sys
inp = list(map(int, sys.stdin.readline().split()))
sorted_inp = sorted(inp, reverse=True)
a_b_c = sorted_inp[0]
b_c = sorted_inp[-1]
a_b = sorted_inp[2]
a = a_b_c - b_c
b = abs(a_b - a)
c = a_b_c - (a + b)
print(a, b, c)


n = [int(n) for n in input().split()]
n.sort()
a = n[3] - n[1]
b = n[1] + n[2] - n[3]
c = n[3] - n[2]
print(a, b, c)


(x, y, w, z) = [int(a) for a in input().split()]
list = [x, y, w, z]
list.sort()
i = list[3]
q = i - list[0]
print(q)
e = i - list[1]
print(e)
t = i - list[2]
print(t)


a = sorted([int(k) for k in input().split(' ')])
b = [a[3] - a[i] for i in range(3)]
print(*b)


l = [int(i) for i in input().split()]
l.sort()
a = l[3] - l[0]
b = l[3] - l[2]
c = l[3] - l[1]
print(b, a, c, end=' ')


x = input()
y = x.split(' ')
for i in range(len(y)):
	y[i] = int(y[i])
y = sorted(y)
a = abs(y[3] - y[0])
b = abs(y[3] - y[1])
c = abs(y[3] - y[2])
print(str(a) + ' ' + str(b) + ' ' + str(c))


numbers = list(map(int, input().split()))
numbers.sort(reverse=True)
print(numbers[0] - numbers[1], numbers[0] - numbers[2], numbers[0] - numbers[3])


def main():
	a = list(map(int, input().split(' ')))
	m = max(a)
	a.remove(m)
	print(' '.join([str(m - e) for e in a]))
main()


a = list(map(int, input().split()))
m = max(a)
for i in a:
	if i == m:
		continue
	print(m - i, end=' ')


list1 = list(map(int, input().strip().split()))
list1.sort()
d = list1[-1]
c = d - list1[0]
b = d - list1[1]
a = d - list1[2]
print(a, b, c)


(x1, x2, x3, x4) = input().split()
x1 = int(x1)
x2 = int(x2)
x3 = int(x3)
x4 = int(x4)
s = [x1, x2, x3, x4]
s.sort()
c = max(s) - s[0]
print(c)
a = s[1] - c
a = s[1] - c
print(a)
b = s[0] - a
print(b)


arr = list(map(int, input().split()))
for i in arr:
	if max(arr) - i != 0:
		print(max(arr) - i, end=' ')


array = list(map(int, input().split()))
array.sort()
max = max(array)
ac = array[0]
ab = array[1]
bc = array[2]
b = max - ac
c = max - ab
a = max - bc
print(a, b, c)


import os
import sys

def log(*args, **kwargs):
	if os.environ.get('CODEFR'):
		print(*args, **kwargs)
ns = list(map(int, input().split()))
m = max(ns)
im = ns.index(m)
r = []
for i in range(4):
	if i == im:
		continue
	r.append(m - ns[i])
print(r[0], r[1], r[2])


x = [int(x) for x in input().split()]
x.sort()
print(x[3] - x[2], x[3] - x[1], x[3] - x[0])


import sys

def main():
	numbers = list(map(int, sys.stdin.readline().split()))
	value = max(numbers)
	for i in numbers:
		if value != i:
			sys.stdout.write(f'{value - i} ')
main()


abc = input()
x = [0] * 4
j = 0
a = ''
for i in range(len(abc)):
	if abc[i] != ' ':
		a += abc[i]
	if abc[i] == ' ' or i == len(abc) - 1:
		x[j] = int(a)
		a = ''
		j += 1
total = max(x)
for num in x:
	if num == total:
		x.remove(num)
for i in range(3):
	print(total - x[i])


l = list(map(int, input().split()))
e = max(l)
l.sort()
for i in range(0, len(l) - 1):
	print(e - l[i], end=' ')


(x1, x2, x3, x4) = input().split()
x1 = int(x1)
x2 = int(x2)
x3 = int(x3)
x4 = int(x4)
numeros = [x1, x2, x3, x4]
soma = max(x1, x2, x3, x4)
linha = ''
for numero in numeros:
	if numero != soma:
		linha = linha + str(soma - numero) + ' '
print(linha)


(a, v, c, z) = map(int, input().split())
q = max(a, v, c, z)
if q == a:
	b1 = q - v
	b2 = q - c
	b3 = q - z
elif q == v:
	b1 = q - a
	b2 = q - c
	b3 = q - z
elif q == c:
	b1 = q - a
	b2 = q - v
	b3 = q - z
elif q == z:
	b1 = q - a
	b2 = q - v
	b3 = q - c
print(b1, b2, b3)


from sys import stdin
inp = stdin.readline
x = [int(k) for k in inp().strip().split()]
for i in range(4):
	c = x[(i + 3) % 4] - x[i % 4]
	a = x[(i + 1) % 4] - c
	b = x[i % 4] - a
	if a > 0 and b > 0 and (c > 0):
		break
print(a, b, c)


l = list(map(int, input().split()))
l.sort(reverse=True)
(r1, r2, r3) = (l[0] - l[1], l[0] - l[2], l[0] - l[3])
print(' '.join(map(str, (r1, r2, r3))))


x = list(map(int, input().split()))
z = max(x)
l = [str(z - n) for n in x if z != n]
print(' '.join(l))


l = list(map(int, input().split()))
l.sort()
for i in range(len(l) - 1):
	print(l[-1] - l[i], end=' ')
print()


(a, b, c, d) = list(map(int, input().strip().split()))
l1 = [a, b, c, d]
l1.sort()
print(l1[3] - l1[0], l1[3] - l1[1], l1[3] - l1[2])


def solve_equation(b1, b2, b3):
	x2 = (b1 - b2 + b3) / 2
	x3 = b3 - x2
	x1 = b2 - x3
	return (int(x1), int(x2), int(x3))
input_ = input().split()
x1 = int(input_[0])
x2 = int(input_[1])
x3 = int(input_[2])
x4 = int(input_[3])
if x1 == (x2 + x3 + x4) / 2:
	tmp = solve_equation(x2, x3, x4)
	print(tmp[0], tmp[1], tmp[2])
if x2 == (x1 + x3 + x4) / 2:
	tmp = solve_equation(x1, x3, x4)
	print(tmp[0], tmp[1], tmp[2])
if x3 == (x1 + x2 + x4) / 2:
	tmp = solve_equation(x1, x2, x4)
	print(tmp[0], tmp[1], tmp[2])
if x4 == (x1 + x2 + x3) / 2:
	tmp = solve_equation(x1, x2, x3)
	print(tmp[0], tmp[1], tmp[2])


a = input().split(' ')
k = []
for i in range(len(a)):
	k.append(int(a[i]))
a.remove(str(max(k)))
t = []
for i in range(len(a)):
	t.append(max(k) - int(a[i]))
print(*t)


sums = list(map(int, input().split()))
sums.sort()
elements = list()
elements.append(sums[3] - sums[0])
elements.append(sums[2] - elements[0])
elements.append(sums[1] - elements[0])
for element in elements:
	print(element, end=' ')


a = list(map(int, input().split()))
a.sort()
print(a[-1] - a[0], a[-1] - a[1], a[-1] - a[2])


lst = list(map(int, input().split()))
s = ''
x = max(lst)
lst.remove(x)
for i in range(len(lst)):
	s += str(x - lst[i]) + ' '
print(s)


k = input().split()
f = []
i = 0
while i < len(k):
	f.append(int(k[i]))
	i += 1
f.sort()
print(f[3] - f[2], f[3] - f[1], f[3] - f[0], flush=True)


a = list(map(int, input().split()))
b = []
m = 0
for x in a:
	if m < x:
		m = x
for x in a:
	if m != x:
		b.append(m - x)
print(' '.join(map(str, b)))


arr = list(map(int, input().split()))
maxm = max(arr)
for i in arr:
	if maxm - i != 0:
		print(maxm - i, end=' ')
	else:
		continue


dat = map(int, input().split())
dat = list(dat)
dat.sort()
a = dat[3] - dat[0]
b = dat[3] - dat[1]
c = dat[3] - dat[2]
print('{0} {1} {2}'.format(a, b, c))


(a, b, c, d) = map(int, input().split())
f = [a, b, c, d]
f = sorted(f)
print(abs(f[-1] - f[0] - f[1]), abs(f[-1] - f[2] - f[1]), abs(f[-1] - f[0] - f[2]))


a = list(map(int, input().split()))
a.remove(max(a))
p = (a[0] - a[1] + a[2]) // 2
print(p, a[0] - p, a[2] - p)


str = [int(i) for i in input().split()]
max = 0
for i in str:
	if i > max:
		max = i
for i in str:
	if i != max:
		print(max - i, end=' ')


n = list(map(int, input().split()))
x = max(n)
n.remove(x)
for i in n:
	print(x - i, end=' ')


a = list(map(int, input().split()))
z = max(a)
ind = a.index(z)
for i in range(4):
	if ind != i:
		print(z - a[i], end=' ')


A = list(map(int, str(input()).split()))
A.sort()
print(A[-1] - A[0], A[-1] - A[1], A[-1] - A[2], sep=' ')


(num1, num2, num3, num4) = map(int, input().split())
maxNum = max(num1, num2, num3, num4)
if maxNum == num1:
	print(maxNum - num2, maxNum - num3, maxNum - num4)
elif maxNum == num2:
	print(maxNum - num1, maxNum - num3, maxNum - num4)
elif maxNum == num4:
	print(maxNum - num2, maxNum - num3, maxNum - num1)
else:
	print(maxNum - num2, maxNum - num1, maxNum - num4)


(x1, x2, x3, x4) = map(int, input().split())
if x1 + x2 + x3 == 2 * x4:
	print('{} {} {}'.format(x4 - x1, x4 - x2, x4 - x3))
elif x1 + x2 + x4 == 2 * x3:
	print('{} {} {}'.format(x3 - x1, x3 - x2, x3 - x4))
elif x1 + x3 + x4 == 2 * x2:
	print('{} {} {}'.format(x2 - x1, x2 - x3, x2 - x4))
else:
	print('{} {} {}'.format(x1 - x2, x1 - x3, x1 - x4))


from collections import Counter, defaultdict
BS = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'

def to_base(s, b):
	res = ''
	while s:
		res += BS[s % b]
		s //= b
	return res[::-1] or '0'
alpha = 'abcdefghijklmnopqrstuvwxyz'
from math import floor, ceil, pi
import re
pattern = '0+'
nums = list(map(int, input().split()))
for m in nums:
	if m != max(nums):
		print(max(nums) - m, end=' ')


import sys
import os
import math
import operator
mod = 1000000007
Mod = 998244353

def Pow(a, b):
	return pow(a, b) % mod

def modInv(a, m):
	return Pow(a, m - 2)
Arr = [int(x) for x in sys.stdin.readline().split()]
Arr.sort()
a = Arr[3] - Arr[0]
b = Arr[3] - Arr[1]
c = Arr[3] - Arr[2]
print(a, b, c)


(x1, x2, x3, x4) = map(int, input().split())
high = max(x1, x2, x3, x4)
found = False
answers = []
if high == x1:
	l = [x2, x3, x4]
elif high == x2:
	l = [x1, x3, x4]
elif high == x3:
	l = [x1, x2, x4]
else:
	l = [x1, x2, x3]
for num in l:
	print(high - num, end=' ')


(*x, summation) = sorted(map(int, input().split()))
print(*[summation - x for x in x])


s = list(map(int, input().split()))
s.sort()
print(f'{s[3] - s[1]} {s[3] - s[0]} {s[3] - s[2]}')


(s, s1, s2, s3) = list(map(int, input().split()))
l = [s, s1, s2, s3]
i_max = l.index(max(l))
so = l[i_max]
l.remove(so)
a = so - l[0]
b = so - l[1]
c = so - l[2]
print(a, b, c)


nums = [int(i) for i in input().split(' ')]
m = max(nums)
idx = nums.index(m)
s = tuple([m - nums[i] for i in range(len(nums)) if i != idx])
print('%d %d %d' % s)


(x1, x2, x3, x4) = map(int, input().split())
l = []
l.append(x1)
l.append(x2)
l.append(x3)
l.append(x4)
l.sort()
print(l[0] + l[1] - l[3], l[0] + l[2] - l[3], l[1] + l[2] - l[3])


x = sorted(map(int, input().split()))
c = x[3] - x[0]
print(x[1] - c, x[2] - c, c)


a = sorted(list(map(int, input().split())))
x = []
x.append(a[3] - a[0])
x.append(a[3] - a[1])
x.append(a[3] - a[2])
for i in x:
	print(i, end=' ')


def ad(ls):
	m = max(ls)
	ls.remove(m)
	for i in ls:
		print(m - i, end=' ')
ls = [int(i) for i in input().split()]
ad(ls)


(p, q, r, s) = [int(x) for x in input().split()]
if p > q and p > r and (p > s):
	a = p - r
	b = p - q
	c = p - s
	print(a, b, c)
elif q > p and q > r and (q > s):
	a = q - p
	b = q - r
	c = q - s
	print(a, b, c)
elif r > p and r > q and (r > s):
	a = r - p
	b = r - q
	c = r - s
	print(a, b, c)
elif s > p and s > q and (s > r):
	a = s - p
	b = s - q
	c = s - r
	print(a, b, c)


arr = [int(x) for x in input().split()]
arr.sort()
a = arr[3] - arr[0]
b = arr[3] - arr[2]
c = arr[3] - arr[1]
print(a, b, c)


(q, w, e, r) = input().split()
q = int(q)
w = int(w)
e = int(e)
r = int(r)
s = [q, w, e, r]
s.sort()
q = s[0]
w = s[1]
e = s[2]
r = s[3]
print(str(r - q) + ' ' + str(r - w) + ' ' + str(r - e))


lst = input().split()
lst = [int(i) for i in lst]
lst.sort()
print(lst[3] - lst[0], lst[3] - lst[1], lst[3] - lst[2])


t = list(map(int, input('').split(' ')))
p = max(t)
q = t.index(max(t))
for i in range(len(t)):
	if i == q:
		continue
	else:
		print(p - t[i], sep=' ', end=' ')


s = input().split()
s = map(int, s)
x = sorted(s, reverse=True)
m = int(x[0])
y = x[1:]
print(m - int(y[0]), end=' ')
print(m - int(y[1]), end=' ')
print(m - int(y[2]), end='')


b = list(map(int, input().split()))
b.sort()
print(b[-1] - b[0])
print(b[-1] - b[1])
print(b[-1] - b[2])


a = input()
b = []
b = a.split()
n = 4
max = 0
for i in range(n):
	k = int(b[i])
	if k > max:
		max = k
		j = i
b[j] = 0
for i in range(n):
	k = int(b[i])
	if k != 0:
		print(max - k, end=' ')


a = sorted(list(map(int, input().split())))
d = a[0] + a[1] - a[3]
e = a[1] + a[2] - a[3]
f = a[2] + a[0] - a[3]
print(d, e, f)


test = list(map(int, input().split()))
test.sort()
test = list(map(lambda x: test[-1] - x, test))
for i in test[:3]:
	print(i)


arr = sorted(list(map(int, input().split())))
s = max(arr)
ac = arr[0]
ab = arr[1]
bc = arr[2]
a = s - bc
b = ab - a
c = bc - b
print(a, b, c)


inputs = input().split(' ')
w = int(inputs[0])
x = int(inputs[1])
n = int(inputs[2])
v = int(inputs[3])
max = 0
if w > x and w > n and (w > v):
	max = w
	a = w - x
	b = w - n
	c = w - v
	print(str(a) + ' ' + str(b) + ' ' + str(c))
elif x > n and x > v and (x > w):
	max = x
	a = x - n
	b = x - v
	c = x - w
	print(str(a) + ' ' + str(b) + ' ' + str(c))
elif n > v and n > w and (n > x):
	max = n
	a = n - v
	b = n - w
	c = n - x
	print(str(a) + ' ' + str(b) + ' ' + str(c))
else:
	max = v
	a = v - w
	b = v - x
	c = v - n
	print(str(a) + ' ' + str(b) + ' ' + str(c))


L = list(map(int, input().split()))
s = max(L)
L.remove(max(L))
a = s - L[0]
b = s - L[1]
c = s - L[2]
print(a, b, c)


p = list(map(int, input().split()))
k = max(p)
p.remove(k)
print(f'{k - p[0]} {k - p[1]} {k - p[2]}')


a = list(map(int, input().split()))
a.sort(reverse=True)
x = a[0] - a[1]
y = a[0] - a[2]
z = a[0] - a[3]
print(x, y, z)


l = sorted(list(map(int, input().split())))
c = l[3] - l[0]
print(c, l[1] - c, l[2] - c)


arr = [int(n) for n in input().split()]
list.sort(arr)
print(arr[3] - arr[0], end=' ')
print(arr[3] - arr[1], end=' ')
print(arr[3] - arr[2], end=' ')


gi = lambda : list(map(int, input().strip().split()))
(x, y, z, t) = sorted(gi())
c = t - x
b = t - y
a = t - z
print(a, b, c)


l = list(map(int, input().split()))
m = max(l)
for i in range(4):
	l[i] = m - l[i]
l.remove(0)
print(*l)


l = [0, 0, 0, 0]
(l[0], l[1], l[2], l[3]) = map(int, input().split())
z = max(l)
l.remove(z)
print(z - l[0], z - l[1], z - l[2], end='')


e = [int(s) for s in input().split()]
vmax = max(e)
e.pop(e.index(vmax))
print(*[vmax - v for v in e])


i = tuple(map(int, input().split()))
m = max(i)
for x in range(4):
	r = m - i[x]
	if r:
		print(r, end=' ')


n = list(map(int, input().split()))
t = max(n)
n.remove(max(n))
k = max(n)
n.remove(max(n))
l = max(n)
n.remove(max(n))
m = max(n)
c = t - k
a = t - l
b = t - m
print(a, b, c)


(l, u, n, d) = sorted(map(int, input().split()))
print(d - l, d - u, d - n)


nums = list(map(int, input().split()))
abcindex = nums.index(max(nums))
abc = max(nums)
nums.pop(abcindex)
a = abc - nums[0]
b = abc - nums[1]
c = abc - nums[2]
print(a, b, c)


(a, b, c, d) = map(int, input().split())
e = max(a, b, c, d)
if e == d:
	a1 = a + b - e
	a2 = b + c - e
	a3 = a + c - e
if e == a:
	a1 = c + b - e
	a2 = b + d - e
	a3 = d + c - e
if e == b:
	a1 = a + d - e
	a2 = d + c - e
	a3 = a + c - e
if e == c:
	a1 = a + d - e
	a2 = d + b - e
	a3 = a + b - e
print(a1, '', a2, '', a3, '')


inp = [int(x) for x in input().split()]
inp.sort()
abc = inp[-1]
print(*[abc - inp[0], abc - inp[1], abc - inp[2]])


test = True
while True:
	numbers = [int(x) for x in list(input().split())]
	for i in range(len(numbers)):
		if numbers[i] < 2 or numbers[i] > 10 ** 9:
			test = False
			break
	if test == True:
		break
sum_idx = max(zip(numbers, range(len(numbers))))[1]
a = 0
for i in range(len(numbers)):
	if i != sum_idx:
		a = numbers[sum_idx] - numbers[i]
		print(a, ' ')


a = list(map(int, input().split()))
x = 0
if sum(a) % 3 == 0:
	for i in range(1, 4):
		if a[x] < a[i]:
			x = i
	temp = a[x]
	a[x] = a[3]
	a[3] = temp
else:
	print('No result !')
	exit(1)
print(a[0] + a[1] - a[3], a[0] + a[2] - a[3], a[1] + a[2] - a[3])


l = input().split()
for a in range(4):
	l[a] = int(l[a])
l.sort()
a = int((l[0] - l[1] + l[2]) / 2)
b = l[0] - a
c = l[2] - a
print(a, b, c)


s = list(map(int, input().split()))
s.sort()
x = s[3] - s[0]
y = s[3] - s[2]
z = s[3] - s[1]
print(x, y, z, sep='\n')


x = list(map(int, input().split()))
p = max(x)
x.remove(p)
a = p - x[0]
b = p - x[1]
c = p - x[2]
print(a, b, c)


a = list(map(int, input().split()))
a.sort()
x1 = a[3] - a[0]
x2 = a[3] - a[1]
x3 = a[3] - a[2]
print(x1, x2, x3)


a = [int(i) for i in input().split()]
max_val = max(a)
a.remove(max_val)
print(max_val - a[0], max_val - a[1], max_val - a[2])


numbers = [int(i) for i in input('').split()]
numbers = sorted(numbers)
print(str(numbers[3] - numbers[0]) + ' ' + str(numbers[3] - numbers[1]) + ' ' + str(numbers[3] - numbers[2]))


(a, b, c, d) = list(map(int, input().split()))
x = max(a, b, c, d)
if x == a:
	print(x - b, x - c, x - d)
elif x == b:
	print(x - a, x - c, x - d)
elif x == c:
	print(x - b, x - a, x - d)
elif x == d:
	print(x - b, x - c, x - a)


l = list(map(int, input().split(' ')))
l.sort()
d = l[3]
l1 = []
l1.append(l[3] - l[0])
l1.append(l[3] - l[1])
l1.append(l[3] - l[2])
for i in l1:
	print(i, end=' ')


IN = input().split(' ')
IN.sort()
(x1, x2, x3, x4) = IN
(x1, x2, x3, x4) = (int(x1), int(x2), int(x3), int(x4))
a = abs(x4 - x1)
b = abs(x2 - a)
c = abs(x3 - a)
print(a, b, c)


def main():
	arr = list(map(int, input().split()))
	arr.sort()
	ab = arr[0]
	ac = arr[1]
	bc = arr[2]
	abc = arr[3]
	(a, b, c) = (0, 0, 0)
	b = abs(abc - ab - bc)
	a = ab - b
	c = abc - ab
	print(a, b, c)
main()


X = list(map(int, input().split()))
sum_abc = max(X)
X.remove(sum_abc)
res = []
for i in range(2):
	for j in range(i + 1, 3):
		res.append(X[i] + X[j] - sum_abc)
print(*res)


a = [int(i) for i in input().split()]
s = max(a)
a.sort()
print(s - a[0], s - a[1], s - a[2])


lis = list(map(int, input().split()))
sumall = max(lis)
lis.remove(sumall)
for i in lis:
	print(sumall - i, end=' ')


def main():
	x_ary = [int(i) for i in input().split()]
	x_ary.sort()
	a = x_ary[3] - x_ary[0]
	b = x_ary[3] - x_ary[1]
	c = x_ary[3] - x_ary[2]
	print(a, b, c)
main()


(x1, x2, x3, x4) = map(int, input().split())
k = (x1 + x2 + x3 + x4) // 3
a = [k - x1, k - x2, k - x3, k - x4]
a.remove(0)
for j in a:
	print(j, end=' ')


l1 = list(map(int, input().split()))
l1.sort()
print(l1[-1] - l1[0], l1[-1] - l1[1], l1[-1] - l1[2])


a = sorted([int(i) for i in input().split(' ')])
print(a[3] - a[2], a[3] - a[1], a[1] + a[2] - a[3])


l = list(map(int, input().split()))
temp = max(l)
l.remove(temp)
(a, b, c) = [temp - i for i in l]
print(a, b, c)


(x1, x2, x3, x4) = map(int, input().split())
if x1 > x2 and x1 > x3 and (x1 > x4):
	(x1, x4) = (x4, x1)
elif x2 > x3 and x2 > x4:
	(x2, x4) = (x4, x2)
elif x3 > x4:
	(x3, x4) = (x4, x3)
print(x4 - x1, x4 - x3, x4 - x2)


k = list(map(int, input().split()))
m = max(k)
k.sort()
for i in range(len(k) - 1):
	print(m - k[i], end=' ')


(a, b, c, d) = map(int, input().split())
e = max(a, b, c, d)
l = [a, b, c, d]
l.remove(e)
li = [l[0] + l[1], l[1] + l[2], l[2] + l[0]]
f = abs(li[0] - e)
g = abs(li[1] - e)
h = abs(li[2] - e)
print(f, g, h)


from collections import Counter

def __starting_point():
	d = list(map(int, input().split()))
	d.sort()
	a = d[0]
	b = d[1]
	c = d[2]
	d = d[3]
	x = d - a
	y = d - b
	z = d - c
	print(x, y, z)
__starting_point()


(a, b, c, d) = map(int, input().split())
l = [a, b, c, d]
l.sort()
s = l[-1]
print('%s ' % (s - l[0]))
print('%s ' % (s - l[1]))
print('%s' % (s - l[2]))


from math import *
x = list(map(int, input().split()))
x.sort()
print(x[3] - x[0], x[3] - x[1], x[3] - x[2])


a = list(map(int, input().split()))
a.sort(reverse=True)
s = a[0]
print(s - a[1], s - a[2], s - a[3])


(a, b, c, d) = input().split()
a = int(a)
b = int(b)
c = int(c)
d = int(d)
numbers = list()
numbers.extend([a, b, c, d])
numbers.sort()
print(numbers[3] - numbers[0], end=' ')
print(numbers[3] - numbers[1], end=' ')
print(numbers[3] - numbers[2])


def restore3(x1, x2, x3, x4):
	if x1 > x4:
		(x1, x4) = (x4, x1)
	if x2 > x4:
		(x2, x4) = (x4, x2)
	if x3 > x4:
		(x3, x4) = (x4, x3)
	assert x4 == max(x1, x2, x3, x4)
	return (x4 - x1, x4 - x2, x4 - x3)

def main():
	(x1, x2, x3, x4) = [int(x) for x in input().split()]
	(a, b, c) = restore3(x1, x2, x3, x4)
	print(f'{a} {b} {c}')
main()


lista = []
nums = input().split(' ')
for _ in range(len(nums)):
	lista.append(int(nums[_]))
lista = sorted(lista)
a = int(lista[3] - int(lista[2]))
b = int(lista[0] - a)
c = int(lista[2] - b)
print(a, b, c)


def Restoring_Three_Numbers(x1, x2, x3, x4):
	li = [x1, x2, x3, x4]
	(x1, x2, x3, x4) = sorted(li)
	Sum = max(x1, x2, x3, x4)
	a = Sum - x1
	b = Sum - x2
	c = Sum - x3
	return (a, b, c)
(x1, x2, x3, x4) = map(int, input().split())
(a, b, c) = Restoring_Three_Numbers(x1, x2, x3, x4)
print(a, '', b, '', c)


(a, b, c, d) = input().split(' ')
(a, b, c, d) = (int(a), int(b), int(c), int(d))
lista = [a, b, c, d]
max = lista[0]
y = 0
for i in range(len(lista)):
	if lista[i] > max:
		max = lista[i]
		y = i
del lista[y]
print(max - lista[0], max - lista[1], max - lista[2])


(x, y, z, v) = [int(l) for l in input().split()]
o = max(x, y, z, v)
if o == x:
	(x, v) = (v, x)
elif o == y:
	(y, v) = (v, y)
elif o == z:
	(z, v) = (v, z)
print(str(o - x) + ' ' + str(o - y) + ' ' + str(o - z))


line = [int(x) for x in input().split()]
abc = max(line)
line.remove(abc)
res = list()
for elem in line:
	res.append(str(abc - elem))
print(' '.join(res))


l = [int(x) for x in input().split()]
(x, y, z, t) = [x for x in sorted(l)]
a = x + y - t
b = x + z - t
c = y + z - t
print(a, b, c)


x = sorted([int(i) for i in input().split()])
a = x[-1] - x[0]
b = x[2] - a
c = x[1] - a
print(a, b, c)


inputs = list(map(int, input().split()))
sumOfThree = max(inputs)
inputs.remove(sumOfThree)
print(str(sumOfThree - inputs[0]) + ' ' + str(sumOfThree - inputs[1]) + ' ' + str(sumOfThree - inputs[2]))


a = input().split()
c = list(map(int, a))
b = max(c)
li = []
for i in range(0, 4, 1):
	d = b - c[i]
	if d > 0:
		li.append(d)
print(*li, sep=' ')


ara = list(map(int, input().split()))
ara.sort()
print('%d %d %d' % (ara[3] - ara[0], ara[3] - ara[1], ara[3] - ara[2]))


a = list(map(int, input().strip().split()))
a.sort()
print(a[3] - a[0], a[3] - a[1], a[3] - a[2])


nums = list(map(int, input().split()))
nums.sort()
max_ = nums.pop(-1)
for i in nums:
	print(max_ - i, end=' ')


l = list(map(int, input().split()))
m = max(l)
l.remove(max(l))
l = l[::-1]
for i in range(len(l)):
	print(m - l[i], end=' ')


line = input()
nums = sorted(map(int, line.split()))
print(' '.join([str(int(nums[-1]) - int(x)) for x in nums[:3]]))


arr = [int(i) for i in input().split()]
m = max(arr)
ans = []
for i in arr:
	ans.append(m - i)
ans.remove(0)
for i in range(2):
	print(ans[i], end=' ')
print(ans[-1])


(m, n, o, p) = input().split()
m = int(m)
n = int(n)
o = int(o)
p = int(p)
maximo = max(m, n, o, p)
ans = []
if maximo != m:
	ans.append(str(maximo - m))
if maximo != n:
	ans.append(str(maximo - n))
if maximo != o:
	ans.append(str(maximo - o))
if maximo != p:
	ans.append(str(maximo - p))
print(' '.join(ans))


h = list(map(int, input().split()))
(x1, x2, x3, x4) = h
maximum = max(h)
h.pop(h.index(maximum))
h.sort()
(ab, bc, ca) = h
c1 = (ab - bc - ca) // 2 * -1
b1 = bc - c1
a1 = ab - b1
print(a1, b1, c1)


x = list(map(int, input().split()))
abc = sum(x) // 3
for y in x:
	if y != abc:
		print(abc - y, end=' ')


(x_1, x_2, x_3, x_4) = map(int, input().split())
i = [x_1, x_2, x_3, x_4]
i.sort()
a = i[3] - i[2]
b = i[0] - a
c = i[1] - a
print(a, b, c)


problem_input = input()
numbers_list_in_str = problem_input.split()
numbers = []
for i in range(4):
	numbers.append(int(numbers_list_in_str[i]))
numbers.sort()
result = ''
for i in range(3):
	result = result + str(numbers[3] - numbers[i]) + ' '
print(result.strip())


nums = list(map(int, input().split()))
abc = max(nums)
for each in nums:
	if abc - each != 0:
		print(abc - each, end=' ')


(a1, a2, a3, a4) = map(int, input().split())
k = [a1, a2, a3, a4]
k = sorted(k)
print(k[3] - k[0])
print(k[3] - k[1])
print(k[3] - k[2])


s = input().split()
for i in range(4):
	s[i] = int(s[i])
s.sort()
print(s[3] - s[0], ' ', s[3] - s[1], ' ', s[3] - s[2])


li = list(map(int, input().split()))
ma = max(li)
li.remove(ma)
for i in reversed(li):
	print(ma - i, end=' ')


w = list(map(int, input().split()))
w.sort()
for i in range(3):
	print(w[-1] - w[i], end=' ')


arr = list(map(int, input().split(' ')))
arr.sort()
string = ''
string += str(arr[0] + arr[1] - arr[3])
string += ' '
string += str(arr[1] + arr[2] - arr[3])
string += ' '
string += str(arr[2] + arr[0] - arr[3])
print(string)


numbers = list(map(int, input().split()))
m = max(numbers)
abc = []
for n in numbers:
	if m != n:
		abc.append(m - n)
print(*abc)


from builtins import int
arr = [int(num) for num in input().split()]
arr.reverse()
a = max(arr)
for i in range(len(arr)):
	if a != arr[i]:
		print(str(a - arr[i]), end=' ')


li = [int(i) for i in input().split()]
m = max(li)
li.remove(m)
print(m - li[2], end=' ')
print(m - li[1], end=' ')
print(m - li[0], end=' ')


l = list(map(int, input().split()))
n = len(l)
ok = 0
for i in range(n):
	for j in range(n):
		for k in range(n):
			for t in range(n):
				if i == j or i == k or i == t or (j == k) or (j == t) or (t == k):
					continue
				a = l[i]
				b = l[j]
				c = l[k]
				d = l[t]
				x = (b - a + c) / 2
				y = int(x)
				if x == y and b - y > 0 and (c - y > 0) and (y + c - y + b - y == d):
					if ok == 0:
						print(b - y, c - y, y)
					ok = 1


(s1, s2, s3, s4) = [int(i) for i in input().strip().split(' ')]
if s1 == max(s1, s2, s3, s4):
	(abc, ab, ac, bc) = (s1, s2, s3, s4)
elif s2 == max(s1, s2, s3, s4):
	(abc, ab, ac, bc) = (s2, s1, s3, s4)
elif s3 == max(s1, s2, s3, s4):
	(abc, ab, ac, bc) = (s3, s1, s2, s4)
else:
	(abc, ab, ac, bc) = (s4, s1, s2, s3)
a = ab + ac - abc
b = ab - a
c = ac - a
print(a, b, c)


numbers = list(map(int, input().split()))
last_num = max(numbers)
numbers.remove(last_num)
numbers = [str(last_num - x) for x in numbers]
print(' '.join(numbers))


a = list(map(int, input().strip().split()))
temp = max(a)
a.remove(temp)
l = (a[0] + a[1] - a[2]) // 2
(m, n) = (a[0] - l, a[1] - l)
print(l, m, n)


from sys import stdin, setrecursionlimit
setrecursionlimit(10 ** 6)
input = stdin.readline
x = sorted([int(i) for i in input().split()], reverse=1)
abc = x[0]
ans = []
for i in range(1, 4):
	ans.append(abc - x[i])
print(*ans)


i_list = [int(x) for x in input().split()]
max_num = max(i_list)
i_list.remove(max_num)
o_list = [max_num - x for x in i_list]
print(*o_list)


arr = [int(i) for i in input().split()]
x = arr.sort()
e = arr[3] - arr[0]
f = arr[3] - arr[1]
g = arr[3] - arr[2]
print(e, f, g)


(x1, x2, x3, x4) = sorted([int(i) for i in input().split()])
a = x4 - x1
b = x4 - x2
c = x4 - x3
print(a, b, c)


n = input()
num = []
num = n.split()
num = [int(i) for i in num]
num.sort()
a = num[0]
b = num[1]
c = num[2]
d = num[3]
z = d - a
y = d - b
x = d - z - y
print(x, y, z)


L = list(map(int, input().split()))
suma = L[L.index(max(L))]
L.pop(L.index(max(L)))
numeros = [suma - i for i in L]
print(*numeros)


a = list(map(int, input().split()))
k = max(a)
e = [i for i in a if i != k]
e.sort()
c = (e[1] - e[0] + (e[2] - e[1]) + e[1]) // 2
b = e[1] - c
a = e[0] - b
print(a, b, c)


arr = [int(x) for x in input().split(' ')]
mx = max(arr)
q = [str(mx - x) for x in arr if x != mx]
print(' '.join(q))


from sys import stdin, stdout
(a, b, c, d) = sorted(map(int, stdin.readline().rstrip().split()))
stdout.write(str(d - c) + ' ' + str(d - b) + ' ' + str(d - a))


max = 0
a = input().split(' ')
for i in range(4):
	a[i] = int(a[i])
	if a[i] > max:
		max = a[i]
for i in range(4):
	if a[i] < max:
		print(max - a[i], end=' ')


n = list(map(int, input().split()))
n1 = max(n)
n2 = n.remove(n1)
for i in n:
	ans = n1 - i
	print(ans, end=' ')


inp = [int(x) for x in input().split()]
maximal = max(inp)
inp.remove(maximal)
string = ''
for x in inp:
	string += str(maximal - x) + ' '
print(string[:-1])


def A1154():
	alist = sorted(list(map(int, input().split())))
	a = alist[3] - alist[0]
	b = alist[3] - alist[1]
	c = alist[3] - alist[2]
	print(a, b, c)
A1154()


x = list(map(int, input().split()))
x.sort()
print(x[3] - x[0], x[3] - x[1], x[3] - x[2])


List = list(map(int, input().split()))
List.sort(reverse=True)
List[:] = [List[0] - x for x in List]
print(*List[1:], sep=' ')


import math
a = sorted([int(i) for i in input().split()])
print(int(math.fabs(a[0] - a[3])), int(math.fabs(a[1] - a[3])), int(math.fabs(a[2] - a[3])))


liste = list(map(int, input().split()))
a = max(liste)
liste.remove(a)
for i in liste:
	print(a - i, end=' ')


nums = [int(s) for s in input().split(' ')]
print(' '.join([str(max(nums) - num) for num in nums if max(nums) - num]))


(w, x, y, z) = [int(w) for w in input().split()]
if z > w and z > x and (z > y):
	a = z - y
	b = z - w
	c = z - x
	print(a, b, c)
elif w > z and w > x and (w > y):
	a = w - y
	b = w - x
	c = w - z
	print(a, b, c)
elif y > z and y > x and (y > w):
	a = y - x
	b = y - z
	c = y - w
	print(a, b, c)
else:
	a = x - y
	b = x - w
	c = x - z
	print(a, b, c)


a = [int(i) for i in input().split()]
m = a.index(max(a))
del a[m]
c = (a[2] + a[1] - a[0]) // 2
b = a[2] - c
a1 = a[0] - b
print(a1, b, c)


array = list(map(int, input().split()))
array.sort()
print(' '.join(map(str, list(map(lambda t: array[-1] - t, array))[:-1])))


lis = list(map(int, input().split()))
maxi = max(lis)
for i in lis:
	if maxi - i == 0:
		pass
	else:
		print(maxi - i, end=' ')


def main():
	nums = [int(i) for i in input().split()]
	all_sum = max(nums)
	nums.remove(all_sum)
	og_nums = []
	for num in nums:
		og_nums.append(all_sum - num)
	print(' '.join([str(i) for i in og_nums]))
main()


from itertools import permutations
a = list(map(int, input().split()))
p = list(permutations(a))
for pc in p:
	a = pc[0] - pc[3]
	b = pc[0] - pc[2]
	c = pc[0] - pc[1]
	if a > 0 and b > 0 and (c > 0):
		break
print(a, b, c)


(x1, x2, x3, x4) = map(int, input().split())
l = [x1, x2, x3, x4]
l.sort()
a = l[-1] - l[0]
b = l[-1] - l[1]
c = l[-1] - l[2]
print(a, b, c)


num = [int(x) for x in input().split()]
num.sort()
z = num[3] - num[0]
x = num[2] - z
y = num[1] - z
print(x, y, z)


arr = list(map(int, input().split()))
arr = sorted(arr)
s = arr[-1]
a = s - arr[0]
b = s - arr[1]
c = s - arr[2]
print('{} {} {}'.format(a, b, c))


li = list(map(int, input().split()))
li.sort()
fi = li[0]
se = li[1]
th = li[2]
fo = li[3]
c = li[3] - li[0]
b = li[2] - c
a = li[0] - b
print(a, b, c)


x = [int(s) for s in input().split()]
s = max(x)
for xx in x:
	if xx == s:
		continue
	print(s - xx, end=' ')


num = [int(i) for i in input().split()]
abc = max(num)
num.remove(max(num))
a = abc - num[0]
b = abc - num[1]
c = abc - num[2]
print(a, b, c, sep=' ')


m = [int(i) for i in input().split()]
n = m.index(max(m))
z = []
for i in range(len(m)):
	if i != n:
		z.append(m[n] - m[i])
for i in z:
	print(i, end=' ')


import math
(a, b, c, d) = [int(x) for x in input().split()]
maximun = max(a, b, c, d)
list = (a, b, c, d)
for i in list:
	if i != maximun:
		print(maximun - i, end=' ')


inp = list(map(int, input().split()))
m = max(inp)
ans = []
for i in range(len(inp)):
	if m - inp[i] != 0:
		ans.append(m - inp[i])
print(*ans)


(a, b, c, d) = [int(x) for x in input().split(' ')]
abc = max(a, b, c, d)
ans = [abc - x for x in [a, b, c, d]]
for item in ans:
	if item != 0:
		print(item, end=' ')


a = [int(e) for e in input().split()]
a.sort()
A = a[-1] - a[0]
B = a[-1] - a[1]
C = a[-1] - a[2]
print(A, B, C)


l = list(map(int, input().split()))
l.sort()
a = l[0]
b = l[1]
c = l[2]
d = l[3]
n1 = d - a
n2 = d - b
n3 = d - c
print(n1, n2, n3)


data = list(map(int, input().split()))
max_num = max(data)
data.remove(max_num)
for i in data:
	print(max_num - i, end=' ')


lis = list(map(int, input().split()))
maxx = max(lis)
lis.remove(maxx)
print(str(-maxx + lis[0] + lis[1]) + ' ' + str(-maxx + lis[0] + lis[2]) + ' ' + str(-maxx + lis[1] + lis[2]))


(a, b, c, d) = map(int, input().split())
e = max(a, b, c, d)
if e - a != 0:
	print(e - a, end=' ')
if e - b != 0:
	print(e - b, end=' ')
if e - c != 0:
	print(e - c, end=' ')
if e - d != 0:
	print(e - d, end=' ')


(x1, x2, x3, x4) = map(int, input().split())
big = max(x1, x2, x3, x4)
a = abs(big - x1)
b = abs(big - x2)
c = abs(big - x3)
d = abs(big - x4)
ist = [a, b, c, d]
for i in ist:
	if i == 0:
		ist.remove(i)
print(' '.join((str(x) for x in ist)))


(x, y, z, k) = [int(x) for x in input().split()]
sum = (x + y + z + k) // 3
if sum - x != 0:
	print(sum - x, end=' ')
if sum - y != 0:
	print(sum - y, end=' ')
if sum - z != 0:
	print(sum - z, end=' ')
if sum - k != 0:
	print(sum - k, end=' ')


(p, q, r, s) = input().split()
(p, q, r, s) = (int(p), int(q), int(r), int(s))
m = max(p, q, r, s)
for i in [p, q, r, s]:
	if m - i != 0:
		print(m - i, end=' ')


a = list(map(int, input().split()))
sum1 = 0
b = []
for i in range(len(a)):
	sum1 = sum1 + a[i]
sum1 = sum1 // 3
for i in range(len(a)):
	if sum1 - a[i] == 0:
		continue
	else:
		b.append(sum1 - a[i])
for i in range(len(b)):
	print(b[i], end=' ')


(a, b, c, d) = map(int, input().split())
x = max(a, b, c, d)
num = []
num.append(x - a)
num.append(x - b)
num.append(x - c)
num.append(x - d)
for i in num:
	if i > 0:
		print(i, end=' ')


(a, b, c, d) = sorted([int(i) for i in input().split()])
print(d - c, d - b, d - a)


a = list(map(int, input().split()))
h = max(a)
for i in range(4):
	a[i] -= h
	if a[i] != 0:
		print(-a[i], end=' ')


def random():
	abcd = input()
	li = abcd.split(' ')
	for i in range(0, len(li)):
		li[i] = int(li[i])
	li.sort()
	a = li[3] - li[0]
	b = li[3] - li[1]
	c = li[3] - li[2]
	print('%d %d %d' % (a, b, c))
random()


(x1, x2, x3, x4) = map(int, input().split())
n = [x1, x2, x3, x4]
x = max(n)
n.remove(x)
print(x - n[0], x - n[1], x - n[2])


l = list(map(int, input().split(' ')))
l.sort()
print(l[3] - l[0], ' ', l[3] - l[2], ' ', l[3] - l[1])


l = list(map(int, input().split()))
a = max(l)
for i in range(len(l)):
	l[i] = a - l[i]
l.remove(0)
print(*l)


n = list(map(int, input().split()))
n.sort()
print(n[3] - n[0], n[3] - n[1], n[3] - n[2])


array = [int(i) for i in input().split(' ')]
max_num = max(array)
array.remove(max_num)
a = max_num - array[0]
b = max_num - array[1]
c = max_num - array[2]
print(f'{a} {b} {c}')


a = list(map(int, input().split()))
a.sort()
for i in range(3):
	print(a[3] - a[i], end=' ')


k = list(map(int, input().split()))
k.sort()
(p, q, r, z) = map(int, k)
a = z - q
c = z - p
b = z - r
print(a, b, c)


d = list(input().split(' '))
d = [int(i) for i in d]
largest_val = d.pop(d.index(max(d)))
c = largest_val - d[0]
b = d[1] - c
a = largest_val - (c + b)
print(a, b, c)


numbers = input()
number_list = [int(number) for number in numbers.split()]
number_list.remove(max(number_list))
lista = []
x1 = int((number_list[0] + number_list[1] - number_list[2]) / 2)
x2 = int((number_list[0] - number_list[1] + number_list[2]) / 2)
x3 = int((-number_list[0] + number_list[1] + number_list[2]) / 2)
lista.append(str(x1))
lista.append(str(x2))
lista.append(str(x3))
print(' '.join(lista))


arr = list(map(int, input().split()))
arr = sorted(arr)
(a, b, c) = (0, 0, 0)
a = abs(arr[0] + arr[1] - arr[3])
b = abs(arr[0] - a)
c = abs(arr[1] - a)
print(a, b, c)


a = input().split(' ')
for i in range(len(a)):
	a[i] = int(a[i])
m = max(a)
a.remove(m)
ans = []
for i in a:
	ans.append(str(m - i) + ' ')
ans = ''.join(ans)
print(ans[:-1])


n = sorted(list(map(int, input().split())))
(minimum, middle, maximum) = (0, 0, 0)
minimum = n[3] - n[2]
middle = n[0] - minimum
maximum = n[1] - minimum
print(minimum, middle, maximum)


n = list(map(int, input().split()))
n.sort()
(a, b, c, d) = (n[0], n[1], n[2], n[3])
print(d - a, d - b, d - c)


def main():
	nums = [int(i) for i in input().split()]
	nums.sort()
	print(nums[-1] - nums[0], nums[-1] - nums[1], nums[-1] - nums[2])
main()


a = list(map(int, input().split()))
p = max(a)
for i in a:
	if p != i:
		print(p - i, end=' ')


arr = [int(s) for s in input().split()]
arr.sort()
mx = arr[len(arr) - 1]
for i in range(len(arr) - 1):
	print(mx - arr[i], end=' ')


import math
a = input().split()
numbers = []
for i in a:
	numbers.append(int(i))
t = max(numbers)
for i in numbers:
	if t == i:
		continue
	else:
		print(t - i)


(a, b, c, d) = input().split()
a = int(a)
b = int(b)
c = int(c)
d = int(d)
m = max(a, b, c, d)
arr = []
if m - a != 0:
	arr.append(m - a)
if m - b != 0:
	arr.append(m - b)
if m - c != 0:
	arr.append(m - c)
if m - d != 0:
	arr.append(m - d)
print(str(arr[0]) + ' ' + str(arr[1]) + ' ' + str(arr[2]))


arr = list(map(int, input().split(' ')))
total = max(arr)
rm = arr.index(max(arr))
arr.pop(rm)
for item in arr:
	print(str(total - item), end=' ')


arr = list(map(int, input().split()))
arr = sorted(arr)
for i in range(3):
	print(arr[3] - arr[i], end=' ')


n = list(map(int, input().split()))
l = []
m = max(n)
n.remove(m)
for i in range(len(n)):
	if m - n[i] >= 0:
		a = m - n[i]
		l.append(a)
		for j in n[:i] + n[i + 1:]:
			l.append(j - a)
		break
print(' '.join(map(str, l)))


a = list(map(int, input().split()))
s = max(a)
for v in a:
	if s != v:
		print(s - v, end=' ')


xs = [int(x) for x in input().split()]
ind = xs.index(max(xs))
(xs[ind], xs[0]) = (xs[0], xs[ind])
d = xs[0] - xs[1]
print(d, xs[2] - d, xs[3] - d)


l = list(map(int, input().split()))
l.sort()
abc = l[-1]
ab = l[0]
bc = l[1]
ac = l[2]
c = abc - ab
b = abc - ac
a = abc - bc
print(a, b, c)


x = sorted([int(i) for i in input().split()])[::-1]
for i in range(1, len(x)):
	print(x[0] - x[i], end=' ')


li = [int(x) for x in input().split()]
li.sort(reverse=True)
ans = [li[0] - li[1], li[0] - li[2], li[0] - li[3]]
print(*ans)


lst = list(map(int, input().split()))
m = max(lst)
lst.remove(m)
for i in lst:
	print(m - i, end=' ')


l = map(int, input().split())
l = sorted(l)
print(l[3] - l[0], l[3] - l[1], l[3] - l[2])


numbers = sorted([int(x) for x in input().split(' ')])
maximum_number = numbers[3]
a = maximum_number - numbers[0]
b = maximum_number - numbers[1]
c = maximum_number - numbers[2]
print(f'{a} {b} {c}')


numbers = [int(x) for x in input().split()]
max_num = max(numbers)
for num in numbers:
	if num != max_num:
		print(max_num - num, end=' ')


(a, b, c, d) = map(int, input().split())
key = max(a, b, c, d)
arr = [0] * 4
arr[0] = key - a
arr[1] = key - b
arr[2] = key - c
arr[3] = key - d
arr.remove(0)
print(*arr)


alist = list(map(int, input().split()))
maaax = max(alist)
alist.remove(maaax)
print(maaax - alist[0], maaax - alist[1], maaax - alist[2])


l = list(map(int, input().split()))
s = l.pop(l.index(max(l)))
print(-(s - (l[0] + l[1])), -(s - (l[1] + l[2])), -(s - (l[0] + l[2])))


l = [int(i) for i in input().split(' ')]
l = sorted(l)
print(l[-1] - l[0], l[-1] - l[1], l[-1] - l[2])


num = list(map(int, input().split()))
num.sort()
print(num[-1] - num[2], num[-1] - num[1], num[-1] - num[0])


n = list(map(int, input().split()))
max_n = max(n)
n.remove(max_n)
for elem in n:
	print(max_n - elem, end=' ')


kk = lambda : map(int, input().split())
ll = lambda : list(kk())
(x, y, z, m) = sorted(ll())
print(m - x, m - y, m - z)


(x, y, z, k) = map(int, input().split())
v = [x, y, z, k]
v.sort()
a = int((v[0] + v[1] - v[2]) / 2)
print(a, v[0] - a, v[1] - a)


l = list(map(int, input().split()))
l.sort(reverse=1)
c = l[0]
a = c - l[1]
b = c - l[2]
d = c - l[3]
print(a, b, d)


twod_list = []
a = input()
A = a.split(' ')
for i in A:
	twod_list.append(int(i))
twod_list.sort()
for i in range(3):
	print(twod_list[3] - twod_list[i], end=' ')
print('\n')


l = list(map(int, input().split()))
s = max(l)
l.remove(s)
print(s - l[0], s - l[1], s - l[2])


def main():
	nums = sorted(list(map(int, input().split())))
	print(nums[3] - nums[0], nums[3] - nums[1], nums[3] - nums[2])
main()


lst = list(map(int, input().split()[:4]))
m = max(lst)
lst.pop(lst.index(m))
lst.sort()
a = m - lst[0]
b = m - lst[1]
c = m - lst[2]
print(str(a) + ' ' + str(b) + ' ' + str(c))


(a, b, c, d) = map(int, input().split())
num = [a, b, c, d]
num.sort()
largest = num[-1]
num.pop(3)
print(largest - num[0], largest - num[1], largest - num[2])


li = [int(x) for x in input().split()]
n4 = max(li)
li.remove(n4)
l = []
for i in range(3):
	n = n4 - li[i]
	l.append(n)
print(l[2], l[1], l[0])


p = list(input().split())
newp = list(map(int, p))
n = []
for i in newp:
	if i != max(newp):
		n.append(i)
a = max(newp) - n[0]
b = max(newp) - n[1]
c = max(newp) - n[2]
print(a, b, c)


from sys import stdin
(a, b, c, d) = map(int, stdin.readline().split())
all = max(a, b, c, d)
print(' '.join([str(all - i) for i in (a, b, c, d) if all - i != 0]))


def program(n):
	num = []
	for i in n:
		num.append(maximum - i)
	return ' '.join(map(str, num))
n = list(map(int, input().strip().split()))
maximum = max(n)
n.remove(maximum)
print(program(n))


l = [int(x) for x in input().split()]
l.sort()
[a, b, c, d] = l
print('%d %d %d' % (d - c, d - b, d - a))


t = list(map(int, input().split()))
e = max(t)
for i in t:
	if e - i != 0:
		print(e - i, end=' ')


a = list(map(int, input().split(' ')))
d = sorted(a)
for i in range(3):
	print(max(a) - d[i], end=' ')


(x1, x2, x3, x4) = map(int, input().strip().split())
k = max(x1, x2, x3, x4)
f1 = k - x1
f2 = k - x2
f3 = k - x3
f4 = k - x4
if f1 == 0:
	print(f2, f3, f4)
if f2 == 0:
	print(f1, f3, f4)
if f3 == 0:
	print(f2, f1, f4)
if f4 == 0:
	print(f2, f3, f1)


(w, x, y, z) = sorted(map(int, input().split()))
print(z - y, z - w, z - x)


nums = list(map(int, input().split(' ')))
nums.sort(reverse=True)
c = nums[0] - nums[1]
b = nums[2] - c
a = nums[1] - b
print(a, b, c)


def compute(nums):
	max_num = max(nums)
	for i in nums:
		if i == max_num:
			pass
		else:
			print(max_num - i, end=' ')

def main():
	nums = list(map(int, input().split(' ')))
	compute(nums)
main()


(w, x, y, z) = map(int, input().split())
p = [w, x, y, z]
p.sort()
p.reverse()
a = int(p[0] - p[1])
b = int(p[0] - p[2])
c = int(p[0] - p[3])
d = [a, b, c]
for i in range(len(d)):
	print(d[i], end=' ')


ln = input().split()
for i in range(len(ln)):
	ln[i] = int(ln[i])
m = max(ln)
for i in range(4):
	ln[i] = m - ln[i]
for i in range(4):
	if ln[i] != 0:
		print(ln[i])


a = list(map(int, input().split(' ')))
a.sort()
c = a[-1] - a[-2]
b = a[-3] - c
a = a[-4] - c
print(f'{a} {b} {c}')


(a, b, c, d) = map(int, input().split(' '))
x = int(max(a, b, c, d))
s = ''
if x != a:
	s += str(x - a) + ' '
if x != b:
	s += str(x - b) + ' '
if x != c:
	s += str(x - c) + ' '
if x != d:
	s += str(x - d) + ' '
print(s.strip())


sums = list(map(int, input().split()))
allSum = max(sums)
ans = [str(allSum - x) for x in sums if x != allSum]
print(' '.join(ans))


import sys
from random import choice, randint
inp = sys.stdin.readline
out = sys.stdout.write
flsh = sys.stdout.flush
sys.setrecursionlimit(10 ** 9)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def MI():
	return map(int, inp().strip().split())

def LI():
	return list(map(int, inp().strip().split()))

def LLI():
	return [list(map(int, l.split())) for l in sys.stdin.readlines().strip()]

def LI_():
	return [int(x) - 1 for x in inp().strip().split()]

def LF():
	return [float(x) for x in inp().strip().split()]

def LS():
	return inp().strip().split()

def I():
	return int(inp().strip())

def F():
	return float(inp().strip())

def S():
	return inp().strip()

def pf(s):
	return out(s + '\n')

def JA(a, sep):
	return sep.join(map(str, a))

def JAA(a, s, t):
	return s.join((t.join(map(str, b)) for b in a))

def main():
	l = LI()
	l.sort()
	(x1, x2, x3, x4) = l
	a = (x1 + x2 - x3) // 2
	b = x1 - a
	c = x2 - a
	print(a, b, c)
main()


def bigest(x, y, z, w):
	if x >= y and x >= z and (x >= w):
		k = 0
	if y >= x and y >= z and (y >= w):
		k = 1
	if z >= x and z >= y and (z >= w):
		k = 2
	if w >= x and w >= y and (w >= z):
		k = 3
	return k

def main():
	nums = list(map(int, input().split()))
	x = nums[0]
	y = nums[1]
	z = nums[2]
	w = nums[3]
	big = bigest(x, y, z, w)
	for i in range(0, len(nums)):
		if i == big:
			continue
		print(nums[big] - nums[i])
main()


(p, q, r, s) = [int(i) for i in input().split()]
m = max(p, q, r, s)
if m == p:
	print(p - q, p - r, p - s)
elif m == q:
	print(q - p, q - r, q - s)
elif m == r:
	print(r - p, r - q, r - s)
else:
	print(s - p, s - q, s - r)


(a, b, c, d) = map(int, input().split())
m = max(a, b, c, d)
if m - a != 0:
	print(m - a)
if m - b != 0:
	print(m - b)
if m - c != 0:
	print(m - c)
if m - d != 0:
	print(m - d)


(a, b, c, d) = map(int, input().split())
maxx = 0
f = (a + b + c + d) // 3
if a != f:
	print(f - a)
if b != f:
	print(f - b)
if c != f:
	print(f - c)
if d != f:
	print(f - d)


L = list(map(int, input().split()))
A = []
a = max(L)
for val in L:
	if val < a:
		A.append(a - val)
for i in range(3):
	print(A[i], end=' ')


a = list(map(int, input().split()))
b = a.index(max(a))
c = max(a)
del a[b]
for i in range(3):
	print(c - a[i], end=' ')


a = [int(i) for i in input().split()]
a.sort()
for i in range(3):
	print(a[-1] - a[i], end=' ')


a = [int(n) for n in input().split()]
k = max(a)
b = [abs(x - k) for x in a if x != k]
b.reverse()
print(*b)


(w, x, y, z) = map(int, input().split())
li = [w, x, y, z]
li.sort()
(w, x, y, z) = (li[0], li[1], li[2], li[3])
(a, b, c) = (z - y, z - x, z - w)
print(a, b, c)


l = [int(i) for i in input().split()]
l.sort()
print(max(l) - l[0], max(l) - l[1], max(l) - l[2])


def main(a):
	index = 0
	p = []
	max = maxx(a)
	while index < len(a):
		if a[index] != max:
			b = max - a[index]
			p.append(b)
		index = index + 1
	return p

def maxx(arr):
	index = 0
	max = arr[0]
	while index < len(arr):
		if arr[index] > max:
			max = arr[index]
		index = index + 1
	return max
a = list(map(int, input().rstrip().split()))
res = main(a)
print(*res)


mas = []
(num1, num2, num3, num4) = map(int, input().split())
mas.append(num1)
mas.append(num2)
mas.append(num3)
mas.append(num4)
maximum = max(mas)
del mas[mas.index(max(mas))]
a = maximum - mas[0]
b = maximum - mas[1]
c = maximum - mas[2]
print(a, b, c)


a = list(map(int, input().rstrip().split(' ')))
a.sort()
last = a[-1]
a = a[0:-1]
x = a[0] + a[1] - last
y = a[1] + a[2] - last
z = a[2] + a[0] - last
print(x, y, z)


a = [int(i) for i in input().split()]
a = sorted(a)
for i in range(3):
	print(a[3] - a[i], sep=' ', end=' ')


a = input()
listad = a.split()
listad1 = [int(listad[0]), int(listad[1]), int(listad[2]), int(listad[3])]
lista = sorted(listad1)
c = int(lista[3]) - int(lista[0])
b = int(lista[2]) - c
a = int(lista[1]) - c
print(a, b, c)


import sys
import math
t = list(input().split())
t = [int(i) for i in t]
t.sort()
t.reverse()
print(*[t[0] - t[1], t[0] - t[2], t[0] - t[3]], sep=' ')


(a, b, c, d) = input().split()
a = int(a)
b = int(b)
c = int(c)
d = int(d)
if a > b and a > c and (a > d) and (a == (b + c + d) // 2):
	print(a - b)
	print(a - c)
	print(a - d)
elif b > a and b > c and (b > d) and (b == (a + c + d) // 2):
	print(b - a)
	print(b - c)
	print(b - d)
elif c > a and c > d and (c > b) and (c == (a + b + d) // 2):
	print(c - a)
	print(c - b)
	print(c - d)
else:
	print(d - a)
	print(d - b)
	print(d - c)


(a, b, c, d) = input().split()
a = int(a)
b = int(b)
c = int(c)
d = int(d)
k = max(a, b, c, d)
a = k - a
b = k - b
c = k - c
d = k - d
if a == 0:
	print(b, c, d)
if b == 0:
	print(a, c, d)
if c == 0:
	print(a, b, d)
if d == 0:
	print(a, b, c)


abcd = list(map(int, input().strip().split(' ')))
maxm = abcd[0]
ans = []
for i in abcd[1:]:
	if maxm < i:
		maxm = i
for i in abcd:
	if maxm - i:
		ans.append(maxm - i)
for i in ans:
	print(i, end=' ')


a = input().split(' ')
a.sort(key=lambda x: int(x), reverse=True)
for i in range(1, 4):
	print(int(a[0]) - int(a[i]), end=' ')


xs = [int(elm) for elm in input().split(' ')]
max_x = max(xs)
outs = [str(max_x - x) for x in xs if max_x != x]
out = ' '.join(outs)
print(out)


def solve(n):
	n.sort(reverse=True)
	res = []
	for i in n[1:]:
		res.append(n[0] - i)
	return ' '.join((str(x) for x in res))
n = list(map(int, input().split()))
print(solve(n))


list_ = list(map(int, input().split()))[:4]
list_ = sorted(list_)
a = list_[3] - list_[2]
b = list_[3] - list_[1]
c = list_[3] - list_[0]
print(a, b, c)


(x, y, z, a) = input().split()
x = int(x)
y = int(y)
z = int(z)
a = int(a)
if x >= y and x >= z and (x >= a):
	p = x - y
	q = x - z
	r = x - a
elif y >= x and y >= z and (y >= a):
	p = y - x
	q = y - z
	r = y - a
elif z >= x and z >= y and (z >= a):
	p = z - x
	q = z - y
	r = z - a
else:
	p = a - x
	q = a - y
	r = a - z
print(str(p) + ' ' + str(q) + ' ' + str(r))


s = input()
l = s.split(' ')
three = max(l, key=int)
l.remove(three)
a = int(three) - int(l[0])
b = int(three) - int(l[1])
c = int(three) - int(l[2])
print('{} {} {}'.format(a, b, c))


nums = list(sorted(map(int, input().split())))
print(f'{nums[3] - nums[0]} {nums[3] - nums[1]} {nums[3] - nums[2]}')


from math import *
n = list(map(int, input().split()))
a = max(n)
index = n.index(a)
for i in range(4):
	if index != i:
		print(a - n[i], end=' ')


args = sorted(list(map(int, input().split())), reverse=True)
print(abs(args[0] - args[1]), abs(args[0] - args[2]), abs(args[0] - args[3]))


li = list(map(int, input().split()))
li.sort()
print(li[3] - li[0], li[3] - li[1], li[3] - li[2])


numbers = input()
listNum = numbers.split()
listNum = [int(i) for i in listNum]
listNum.sort()
a = max(listNum)
ans = []
for i in range(3):
	n = a - listNum[i]
	ans.append(n)
for i in ans:
	print(i, end=' ')
print()


n = input().split()
num = []
nums = []
for word in n:
	num.append(int(word))
num.sort()
for index in range(len(num) - 1):
	nums.append(num[-1] - num[index])
print(nums[0], nums[1], nums[2])


from sys import stdin, stdout
board = sorted(list(map(int, stdin.readline().split())))
stdout.write('%d %d %d\n' % (board[3] - board[1], board[3] - board[2], board[3] - board[0]))


nums = sorted([int(x) for x in input().split()])
s = nums.pop()
ans = [s - num for num in nums]
print(*ans)


(x, y, z, s) = map(int, input().split())
d = max(x, y, z, s)
if d == x:
	a = d - y
	b = d - z
	c = d - s
elif d == y:
	a = d - x
	b = d - z
	c = d - s
elif d == z:
	a = d - y
	b = d - x
	c = d - s
elif d == s:
	a = d - y
	b = d - z
	c = d - x
print(a, b, c, end=' ')


(a, b, c, d) = sorted([int(x) for x in input().split()])
z = int((c + b - a) / 2)
y = int(a - b + z)
x = int(a - y)
print(x, y, z)


inp = list(map(int, input().split()))
(a, b, c, d) = inp
n = max(a, b, c, d)
inp.remove(n)
for i in inp:
	print(n - i, end=' ')


(a, b, c, d) = map(int, input().split(' '))
if a > b and a > c and (a > d):
	print(a - b, a - c, a - d)
if b > a and b > c and (b > d):
	print(b - a, b - c, b - d)
if c > a and c > b and (c > d):
	print(c - b, c - a, c - d)
if d > a and d > c and (d > b):
	print(d - b, d - c, d - a)


def Max(lst):
	max1 = lst[0]
	for i in lst:
		if int(i) >= int(max1):
			max1 = i
	return max1
list1 = input().split()
max2 = Max(list1)
ans = ''
list1.remove(max2)
for i in list1:
	a = int(max2) - int(i)
	ans += str(a)
	ans += ' '
print(ans)


from sys import stdin
inp = stdin.readline
x = [int(k) for k in inp().strip().split()]
x = sorted(x)
c = x[3] - x[0]
a = x[1] - c
b = x[0] - a
print(a, b, c)


N = list(map(int, input().split()))
print(sorted(N)[3] - sorted(N)[2], sorted(N)[3] - sorted(N)[1], sorted(N)[3] - sorted(N)[0])


a = list(map(int, input().split()))
k = max(a)
a.remove(k)
for i in range(3):
	a[i] = k - a[i]
print(*a)


list_number = input().split(' ')
nums = list(map(int, list_number))

def number(x1, x2, x3, x4):
	max_input = max(x1, x2, x3, x4)
	if max_input is x1:
		a = max_input - x2
		b = max_input - x3
		c = max_input - x4
	elif max_input is x2:
		a = max_input - x1
		b = max_input - x3
		c = max_input - x4
	elif max_input is x3:
		a = max_input - x1
		b = max_input - x2
		c = max_input - x4
	elif max_input is x4:
		a = max_input - x1
		b = max_input - x2
		c = max_input - x3
	return (a, b, c)
re = number(nums[0], nums[1], nums[2], nums[3])
for i in re:
	print(i, end=' ')


x = sorted((int(_) for _ in input().split()))
print(x[3] - x[2], x[3] - x[1], x[3] - x[0])


l = list(map(int, input().split()))
m = max(l)
l1 = [m - i for i in l if i != m]
l2 = []
l2 = l1[::-1]
print(l2[0], l2[1], l2[2])


ans = []
a = sorted(list(map(int, input().split())), reverse=True)
a1 = a[0] - a[1]
a2 = a[0] - a[2]
a3 = a[0] - a[3]
print(a1, a2, a3)


l = list(map(int, input().split()))
m = max(l)
res = ''
for x in l:
	if x != m:
		res += str(m - x) + ' '
print(res)


(a, b, c, d) = sorted(map(int, input().split()))
print(d - a, d - b, d - c)


from math import ceil

def main():
	vals = [int(v) for v in input().split()]
	vals.sort()
	print(vals[3] - vals[1], vals[3] - vals[0], vals[3] - vals[2])
main()


a = list(map(int, input().split()))
a.sort()
_max = max(a)
for x in a[:-1]:
	print(_max - x, end=' ')


def main():
	x = [0 for i in range(4)]
	(x[0], x[1], x[2], x[3]) = map(int, input().strip().split())
	x = sorted(x)
	a = x[3] - x[2]
	b = x[3] - x[1]
	c = x[3] - x[0]
	print('{0} {1} {2}'.format(a, b, c))
main()


x = list(map(int, input().split()))
maxc = max(x)
minc = min(x)
t = maxc - minc
x.remove(max(x))
x.remove(min(x))
a = x[0] - t
b = x[1] - t
print(t, a, b)


a = list(map(int, input().split()))
b = []
c = range(len(a) - 1)
a = sorted(a, reverse=False)
for n in c:
	if int(a[-1]) - int(a[n]) != 0:
		d = int(a[-1]) - int(a[n])
		b.append(d)
	else:
		print('error')
		break
if int(a[-1]) - int(a[n]) != 0:
	print(b[0], b[1], b[2])


a = list(map(int, input().split()))
a.sort()
n = len(a) - 1
print(a[n] - a[0], a[n] - a[1], a[n] - a[2])


a = list(map(int, input().split()))
maks = 0

def biggest(data, maks):
	minus = []
	for i in data:
		if i >= maks:
			maks = i
		else:
			continue
	for i in data:
		if i != maks:
			minus.append(i)
		else:
			continue
	for i in minus:
		print(maks - i, end=' ')
biggest(a, maks)


numbers = list(map(int, input().split()))
guessed_num = []
for num in numbers:
	guessed_num.append(max(numbers) - num)
guessed_num.remove(0)
guessed_num.sort()
print(guessed_num[0], guessed_num[1], guessed_num[2])


sums = [int(item) for item in input().split()]
maxV = sums.pop(sums.index(max(sums)))
result = ''
for item in sums:
	result += str(maxV - item) + ' '
print(result)


l = list(map(int, input().split()))
m = max(l)
ll = []
for i in range(0, len(l)):
	if l[i] < m:
		a = abs(l[i] - m)
		ll.append(a)
for i in range(0, len(ll)):
	print(ll[i], end=' ')


x = list(map(int, input().split()))
i = 0
while max(x) - x[i] == 0:
	i += 1
nom_a = i
a = max(x) - x[i]
Sum = max(x)
b_c = Sum - a
i = 0
while x[i] != b_c:
	i += 1
nom_b_c = i
ans = [str(a)]
for i in range(len(x)):
	if i != nom_a and i != nom_b_c and (x[i] != Sum):
		ans.append(str(x[i] - a))
print(' '.join(ans))


inps = [int(x) for x in input().split(' ')]
max_val = max(inps)
for i in inps:
	if i != max_val:
		print(max_val - i)


x = sorted(list(map(int, input().split())))
print(x[3] - x[2], x[3] - x[1], x[3] - x[0])


nums = [int(x) for x in input().split(' ')]
d = max(nums)
nums.remove(d)
answers = []
for num in nums:
	answers.append(d - num)
print('{} {} {}'.format(answers[0], answers[1], answers[2]))


(a, b, c, d) = sorted([int(x) for x in input().split()])
print(d - a, d - b, d - c)


a = [int(x) for x in input().strip().split()]
m = max(a)
a = [m - i for i in a]
for i in a:
	if i != 0:
		print(i, end=' ')


s = list(map(int, input().split()))
l = max(s)
m = []
for i in range(1):
	s.remove(l)
for i in range(len(s)):
	j = l - s[i]
	m.append(j)
print(*m)


def mp():
	return map(int, input().split())
a = list(mp())
a.sort(reverse=True)
print(a[0] - a[1], a[0] - a[2], a[0] - a[3])


x = input().split()
z = []
for i in x:
	z.append(int(i))
	m = int(max(z))
re = ''
for i in z:
	if int(i) == m:
		continue
	else:
		a = m - int(i)
		re = re + str(a) + ' '
print(re)


y = [int(x) for x in input().split()]
a = max(y)
y.remove(a)
for i in y:
	print(a - i, end=' ')


s = ' '
lis = [int(i) for i in input().split()]
a = max(lis)
lis.remove(a)
lis = [str(a - lis[i]) for i in range(len(lis))]
s = ' '.join(lis[::-1])
print(s)


n = list(map(int, input().split()))
k = max(n)
n.remove(k)
print(k - n[0], k - n[1], k - n[2])


x = list(map(int, input().split()))
s = max(x)
x.remove(s)
print(s - x[2], s - x[1], s - x[0], sep=' ')


nums = [int(x) for x in input().split()]
nums = sorted(nums)
c = nums[3] - nums[0]
b = nums[3] - nums[1]
a = nums[3] - nums[2]
print('{} {} {}'.format(a, b, c))


numbers = input().split()
for i in range(4):
	numbers[i] = int(numbers[i])
add = max(numbers)
numbers.remove(add)
a = add - numbers[0]
b = add - numbers[1]
c = add - numbers[2]
print(a, b, c)


import itertools as it
(d, e, f, g) = map(int, input().split())
a = 0
b = 0
c = 0

def ch(x):
	return x == int(x) and x > 0
for i in it.permutations([d, e, f, g], 4):
	(d1, e1, f1, g1) = i
	a = (d1 + e1 - f1) / 2
	b = d1 - a
	c = g1 - (a + b)
	if ch(a) and ch(b) and ch(c) and (c == e1 - a) and (b == f1 - c):
		print(int(a), int(b), int(c))
		break


(n, m, o, p) = sorted(map(int, input().split()))
print(p - o, p - m, p - n)


def main():
	x = list(map(int, input().split()))
	max1 = max(x)
	x.remove(max1)
	x = [max1 - i for i in x]
	print(*x, sep=' ')
main()


arr = list(map(int, input().split()))
arr.sort()
print(*[arr[-1] - arr[i] for i in range(3)])


x = [int(i) for i in input().split()]
d = max(x)
x.remove(d)
a = d - x[0]
b = d - x[1]
c = d - x[2]
print(a, b, c)


import sys
num = [int(i) for i in input().split()]
num.sort()
a = num[3] - num[0]
b = num[3] - num[1]
c = num[3] - num[2]
print('{} {} {}'.format(a, b, c))


(a, b, c, d) = map(int, input().split())
l = []
l.append(a)
l.append(b)
l.append(c)
l.append(d)
l.sort()
print(l[3] - l[0], l[3] - l[1], l[3] - l[2])


X = [int(x) for x in input().split()]
x = sorted(X)
a = x[3] - x[0]
b = x[3] - x[1]
c = x[3] - x[2]
print(a, b, c)


arr = list(map(int, input().split()))
ma = max(arr)
arr.remove(ma)
print(ma - arr[0], ma - arr[1], ma - arr[2])


a = sorted(list(map(int, input().split())))
print(*[a[-1] - a[i] for i in range(len(a) - 1)])


angka = list(map(int, input().split()))
maks_number = angka.pop(angka.index(max(angka)))
b = (angka[0] + angka[1] - angka[2]) // 2
a = angka[0] - b
c = angka[2] - a
print(*[a, b, c])


arr = list(map(int, input().split()))
otv = list()
for _ in range(3):
	otv.append(max(arr) - min(arr))
	arr.pop(arr.index(min(arr)))
print(' '.join(list(map(str, otv))))


a = input().split()
for i in a:
	a[a.index(i)] = int(i)
a.sort(reverse=True)
print(int(a[0]) - int(a[1]), end=' ')
print(int(a[0]) - int(a[2]), end=' ')
print(int(a[0]) - int(a[3]), end='')


numb = list(map(int, list(input().split())))
comp = [numb[0], numb[1], numb[2], numb[3]]
s = sorted(comp)
print(s[3] - s[0], s[3] - s[1], s[3] - s[2])


(a, b, c, d) = map(int, input().split())
l = max(a, b, c, d)
p = [0] * 4
p[0] = l - a
p[1] = l - b
p[2] = l - c
p[3] = l - d
m = [0] * 3
g = 0
for k in range(4):
	if p[k] != 0:
		m[g] = p[k]
		g += 1
print(*m)


list1 = list(map(int, input().split()))
list1.sort()
list1[0] = list1[3] - list1[0]
list1[1] = list1[3] - list1[1]
list1[2] = list1[3] - list1[2]
print(*list1[0:3], sep=' ')


lin = [int(i) for i in input().split()]
lin.sort()
print(lin[3] - lin[0], end=' ')
print(lin[3] - lin[1], end=' ')
print(lin[3] - lin[2])


(q, w, e, r) = [int(i) for i in input().split()]
a = max(q, w, e, r)
if q != a:
	print(a - q)
if r != a:
	print(a - r)
if e != a:
	print(a - e)
if w != a:
	print(a - w)


l = list(map(int, input().split()))
mx = max(l)
l.sort()
for x in range(len(l) - 1):
	print(l[-1] - l[x], end=' ')


import sys
line = sys.stdin.readline().strip()
x = list(map(int, line.split()))
x.sort()
res = []
for xi in x[:3]:
	res.append(x[3] - xi)
print(' '.join(list(map(str, res))))


lis = list(map(int, input().split()))
(m, n, o, p) = lis
max_ = max(m, n, o, p)
xd = []
for i in lis:
	if i == max_:
		continue
	else:
		xd.append(max_ - i)
for i in xd:
	print(i, end=' ')


(a, b, c, d) = map(int, input().split())
e = [a, b, c, d]
e.sort(reverse=True)
tam = 0
f = []
for i in range(1, len(e)):
	tam = e[0] - e[i]
	f.append(tam)
for i in range(0, len(f)):
	print(f[i], end=' ')


(x1, x2, x3, x4) = map(int, input().split())
n = [x1, x2, x3, x4]
a = max(n)
if a - x1 == 0:
	print(a - x2, a - x3, a - x4)
elif a - x2 == 0:
	print(a - x1, a - x3, a - x4)
elif a - x3 == 0:
	print(a - x1, a - x2, a - x4)
elif a - x4 == 0:
	print(a - x1, a - x2, a - x3)


lista = input()
lista = lista.split(' ')
for i in range(0, len(lista)):
	lista[i] = int(lista[i])
x = int(lista.pop(lista.index(max(lista))))
a = x - int(lista[0])
b = x - int(lista[1])
c = x - int(lista[2])
print(a, b, c)


arr = [int(x) for x in input().split()]
arr.sort()
print(arr[-1] - arr[0], arr[-1] - arr[1], arr[-1] - arr[2])


x = list(map(int, input().split()))
ans = []
x.sort()
m = x[-1]
x.pop(-1)
for i in range(3):
	ans.append(str(m - x[i]))
print(*ans)


(a, b, c, d) = input().split()
a = int(a)
b = int(b)
c = int(c)
d = int(d)
s = [a, b, c, d]
s.sort()
c = max(s) - s[0]
print(c)
a = s[1] - c
print(a)
x = s[0] - a
print(x)


(x, y, z, t) = map(int, input().split())
s = x + y + z + t
s //= 3
q = [s - x, s - y, s - z, s - t]
p = q.index(0)
q.pop(p)
print(*q)


(x1, x2, x3, x4) = map(int, input().split())
total = max((x1, x2, x3, x4))
for x in (x1, x2, x3, x4):
	if total - x != 0:
		print(total - x, end=' ')


arr = [int(val) for val in input().split()]
xi = max(arr)
for x in arr:
	if xi - x > 0:
		print(xi - x, end=' ')


from sys import stdin, stdout
n = sorted([int(x) for x in stdin.read().strip('\n').split()])[::-1]
stdout.write('{} {} {}'.format(n[0] - n[1], n[0] - n[2], n[0] - n[3]))


x = list(map(int, input().split()))
b = sorted(x)
for i in range(len(x) - 1):
	print(max(x) - b[i], end=' ')


nums = list(map(int, input().split()))
abc = max(nums)
nums.remove(abc)
for nin in nums:
	print(abc - nin, end=' ')


(a, b, c, d) = input().split(' ')
a = int(a)
b = int(b)
c = int(c)
d = int(d)
sort = [a, b, c, d]
sort.sort()
x = sort[3] - sort[0]
y = sort[3] - sort[1]
z = sort[3] - sort[2]
print(x, y, z)


xs = input('').split(' ')
xs = [int(x) for x in xs]
(x1, x2, x3, x4) = xs
max_num = max(xs)
xs.remove(max_num)
sol = [max_num - x for x in xs]
print(*sol)


x = list(map(int, input().split()))
sumi = max(x)
for i in x:
	if sumi - i > 0:
		print(sumi - i, end=' ')


x = list(map(int, input().split(' ')))
maxElement = int(max(x))
for element in x:
	if element != maxElement:
		print(abs(element - maxElement), end=' ')


x = sorted(list(map(int, input().split())))
print(x[-1] - x[-2], x[-1] - x[-3], x[-1] - x[-4])


li = [int(x) for x in input().split()]
mx = max(li)
li.remove(mx)
li.insert(0, mx)
x4 = int(li[0])
x3 = int(li[1])
x2 = int(li[2])
x1 = int(li[3])
print(x4 - x3)
print(x4 - x2)
print(x4 - x1)


numbers = list(map(int, input().split()))
numbers = sorted(numbers)
a_b_c = numbers[-1]
a = a_b_c - numbers[0]
c = a_b_c - numbers[1]
b = a_b_c - numbers[2]
print(f'{a} {b} {c}')


def solve():
	words = input().split()
	n = len(words)
	nums = [int(i) for i in words]
	mmax = max(nums)
	first = True
	rets = []
	for i in nums:
		if i == mmax and first:
			first = False
			continue
		rets.append(str(mmax - i))
	print(' '.join(rets))
solve()


import pdb
(a, b, c, d) = sorted(map(int, input().split()))
print(d - c, d - b, d - a)


import sys

def solve():
	x = list(map(int, input().split()))
	x.sort()
	n1 = x[3] - x[0]
	n2 = x[3] - x[1]
	n3 = x[3] - x[2]
	print(str(n1) + ' ' + str(n2) + ' ' + str(n3))
solve()


ns = input().split()
for i in range(len(ns)):
	ns[i] = int(ns[i])
m = max(ns)
ns.remove(m)
for i in range(len(ns)):
	if i != len(ns) - 1:
		print(m - ns[i], end=' ')
	else:
		print(m - ns[i])


nums = [int(i) for i in input().split()]
maxn = nums.pop(nums.index(max(nums)))
print(maxn - nums[0], maxn - nums[1], maxn - nums[2])


x = list(map(int, input().split()))
x.sort()
abc = x[3]
ac = x[2]
ab = x[1]
bc = x[0]
b = abc - ac
a = ab - b
c = bc - b
print(str(a) + ' ' + str(b) + ' ' + str(c))


n = [int(i) for i in input().split()]
for i in range(len(n)):
	for j in range(i + 1, len(n)):
		if n[i] >= n[j]:
			(n[i], n[j]) = (n[j], n[i])
a = n[-1] - n[0]
b = n[-1] - n[1]
c = n[-1] - (a + b)
print(a, b, c)


(x, s, r, t) = map(int, input().split())
h = max(x, s, r, t)
if x == h:
	a = h - s
	b = h - r
	c = h - t
elif s == h:
	a = h - x
	b = h - r
	c = h - t
elif r == h:
	a = h - x
	b = h - s
	c = h - t
else:
	a = h - x
	b = h - s
	c = h - r
print(a, b, c)


num = list(map(int, input().split()))
num.sort()
x = sum(num) // 3
for i in range(3):
	print(x - num[i], end=' ')


ls = [int(item) for item in input().split(' ')]
q = max(ls)
p = ls.index(q)
ls.pop(p)
for x in range(3):
	print(q - ls[x], end=' ')


x = sorted(list(map(int, input().split())))
print(x[len(x) - 1] - x[0], x[len(x) - 1] - x[1], x[len(x) - 1] - x[2])


array = [int(i) for i in input().split(' ')]
_max = max(array)
array.remove(_max)
res = [_max - i for i in array]
print(*res)


(x1, x2, x3, x4) = input().split(' ')
x1 = int(x1)
x2 = int(x2)
x3 = int(x3)
x4 = int(x4)
x = [x1, x2, x3, x4]
abc = max(x)
index_abc = x.index(abc)
x_sans_abc = x
del x_sans_abc[index_abc]
a = abs(abc - (x_sans_abc[0] + x_sans_abc[1]))
b = abs(abc - (x_sans_abc[0] + x_sans_abc[2]))
c = abs(abc - (x_sans_abc[1] + x_sans_abc[2]))
print(a, b, c)


nums = [int(i) for i in input().split()]
nums.sort()
x1 = nums[3]
x4 = nums[0]
(_, x2, x3, _) = nums
b = int((x2 + x4 - x3) / 2)
c = int(x4 - b)
a = int(x2 - b)
print(a, b, c)


import sys
input = sys.stdin.readline

def inlt():
	return list(map(int, input().split()))
ls = inlt()
ls.sort()
ab = ls[0]
ac = ls[1]
bc = ls[2]
abc = ls[3]
a = abc - bc
b = abc - ac
c = abc - ab
print(a)
print(b)
print(c)


(x, y, z, w) = (int(i) for i in input().split())
s = (x + y + z + w) // 3
for i in (x, y, z, w):
	temp = s - i
	if s - i > 0:
		print(s - i, end=' ')


n = [int(i) for i in input().split()]
s = max(n)
n.remove(s)
print(s - n[2], s - n[1], s - n[0])


sums = [int(i) for i in input().split()]
max_sum = max(sums)
sums.sort()
a = max_sum - sums[0]
b = max_sum - sums[1]
c = max_sum - sums[2]
print(a, b, c)


(a, b, c, s) = sorted(list(map(int, input().split())))
print(s - a, s - b, s - c)


arr = list(map(int, input().split()))
suma = max(arr)
for i in arr:
	if i == suma:
		continue
	print(suma - i, end=' ')


integers = input().split(' ')
integers = [int(integer) for integer in integers]
integers = sorted(integers)
c = integers[3] - integers[0]
b = integers[2] - c
a = integers[0] - b
print(a, b, c)


import sys
s = sys.stdin.read().split()
s = [int(x) for x in s]
s.sort()
for x in range(3):
	print(s[3] - s[x], end=' ')


tab = sorted(list(map(int, input().split())))
print(tab[3] - tab[0], tab[3] - tab[1], tab[3] - tab[2])


A = [int(x) for x in input().split()]
A.sort()
print(A[-1] - A[0], A[-1] - A[1], A[-1] - A[2], end=' ')


vvod = input().split(' ')
num_list = [int(i) for i in vvod]
num_list.sort()
big = num_list.pop()
a = big - num_list[0]
b = big - num_list[1]
c = big - num_list[2]
print(a, b, c)


(V1, V2, V3, V4) = input().split()
v1 = int(V1)
v2 = int(V2)
v3 = int(V3)
v4 = int(V4)
l = [v1, v2, v3, v4]
l2 = []
maxi = 0
for i in l:
	if i > maxi:
		maxi = i
j = maxi
for i in l:
	if i != j:
		l2.append(i)
x = l2[0]
y = l2[1]
z = l2[2]
a = (x + y - z) / 2
b = (x + z - y) / 2
c = (y + z - x) / 2
print(int(a), int(b), int(c))


(apb, apc, bpc, apbpc) = sorted(map(int, input().split()))
a = apbpc - bpc
b = apbpc - apc
c = apbpc - apb
print(a, b, c)


(a, b, c, d) = input().split(' ')
a = int(a)
b = int(b)
c = int(c)
d = int(d)
buyuk = max(a, b, c, d)
m_a = buyuk - a
m_b = buyuk - b
m_c = buyuk - c
m_d = buyuk - d
if m_a > 0 and m_b > 0 and (m_c > 0) and (m_d == 0):
	print(m_a, m_b, m_c)
if m_a > 0 and m_b > 0 and (m_c == 0) and (m_d > 0):
	print(m_a, m_b, m_d)
if m_a > 0 and m_b == 0 and (m_c > 0) and (m_d > 0):
	print(m_a, m_d, m_c)
if m_a == 0 and m_b > 0 and (m_c > 0) and (m_d > 0):
	print(m_d, m_b, m_c)


arr = list(map(int, input().split()))
arr.sort()
d = arr[0]
e = arr[1]
f = arr[2]
add = arr[3]
print(add - f, add - e, add - d)


nums = list(map(int, input().split()))
l = nums.pop(nums.index(max(nums)))
print(abs(nums[0] - l), abs(nums[1] - l), abs(nums[2] - l))


def I():
	return list(map(int, input().split()))
x = I()
sum = max(x)
index = 0
for i in range(len(x)):
	if x[i] == sum:
		index = i
x.pop(index)
print(int(sum - x[0]), int(sum - x[1]), int(sum - x[2]))


(a, b, c, d) = map(int, input().split())
list = []
list.append(a)
list.append(b)
list.append(c)
list.append(d)
list.sort()
m = list[3] - list[2]
n = list[3] - list[1]
o = list[3] - list[0]
print(m, n, o)


nums = list(map(int, input().split()))
nums.sort()
k = max(nums)
print(k - nums[0], k - nums[1], k - nums[2])


import sys
x = list(map(int, input().split()))
x.sort()
os = x[3]
x[3] = -100
a = os - x[0]
b = os - x[1]
c = os - x[2]
print(a, b, c)


import atexit
import io
import sys
_I_B = sys.stdin.read().splitlines()
input = iter(_I_B).__next__
_O_B = io.StringIO()
sys.stdout = _O_B

@atexit.register
def write():
	sys.__stdout__.write(_O_B.getvalue())

def main():
	l = list(map(int, input().split()))
	m = max(l)
	l.remove(m)
	t = m - l[0]
	print(t, l[1] - t, l[2] - t)
main()


(a, b, c, d) = [int(a) for a in input().split()]
if b >= a and b >= c and (b >= d):
	x = a
	a = b
	b = x
elif c >= a and c >= b and (c >= d):
	x = a
	a = c
	c = x
elif d >= a and d >= b and (d >= c):
	x = a
	a = d
	d = x
print(a - b, a - c, a - d)


a = list(map(int, input().split()))
m = max(a)
print(*(m - v for v in a if v != m))


ans = []
l = sorted(list(map(int, input().split())))
l.pop()
for i in range(3):
	temp = int((l[0] + l[1] - l[2]) / 2)
	l.append(l.pop(0))
	ans.append(temp)
print(*ans)


Sum = list(map(int, input().split()))
Sum.sort()
Str = ''
for i in range(3):
	Str += str(Sum[-1] - Sum[i]) + ' '
print(Str)


(x1, x2, x3, x4) = map(int, input().split())
l = [x1, x2, x3, x4]
m = max(l)
l.remove(max(l))
for i in l:
	print(m - i, end=' ')


numbers = list(map(int, input().split()))
total = max(numbers)
for num in numbers:
	if num != total:
		print(total - num, end=' ')


a = [int(i) for i in input().split(' ')]
a.sort(reverse=True)
first_number = a[0] - a[1]
second_number = a[3] - first_number
third_number = a[0] - (first_number + second_number)
print(first_number, second_number, third_number)


(x1, x2, x3, x4) = input().split()
x1 = int(x1)
x2 = int(x2)
x3 = int(x3)
x4 = int(x4)
if x1 > x2 and x1 > x3 and (x1 > x4):
	c = x1 - x2
	a = x3 + x2 - x1
	b = x4 + x2 - x1
if x2 > x1 and x2 > x3 and (x2 > x4):
	c = x2 - x1
	a = x3 + x1 - x2
	b = x4 + x1 - x2
if x3 > x1 and x3 > x2 and (x3 > x4):
	c = x3 - x1
	b = x2 + x1 - x3
	a = x4 + x1 - x3
if x4 > x1 and x4 > x2 and (x4 > x3):
	c = x4 - x1
	a = x2 - x4 + x1
	b = x3 - x4 + x1
print(a)
print(b)
print(c)


x = list(map(int, input().split()))
s = max(x)
i = x.index(s)
x.pop(i)
print(s - x[0], s - x[1], s - x[2])


x = []
ans = []
sum = 0
x = list(map(int, input().split()))
for i in x:
	sum += i
sum /= 3
for i in range(4):
	if sum != x[i]:
		ans.append(int(sum - x[i]))
print(ans[0], ans[1], ans[2])


(a, b, c, d) = map(int, input().split())
summa = (a + b + c + d) // 3
lst = [summa - a, summa - b, summa - c, summa - d]
lst.remove(0)
print(lst[0], lst[1], lst[2])


def rep():
	(x1, x2, x3, x4) = map(int, input().split())
	ls = [x1, x2, x3, x4]
	ls.sort()
	b = ls[0] + ls[2] - ls[3]
	c = ls[2] - b
	a = ls[0] - b
	print(a, b, c)
rep()


s = [int(x) for x in input().split()]
n_max = max(s)
s.remove(max(s))
for i in s:
	print(n_max - i, end=' ')


inp = input()
sp = inp.split()
intl = [int(k) for k in sp]
maxi = max(intl)
rep = []
for j in intl:
	if j != maxi:
		num = maxi - j
		rep.append(num)
print(rep[0], rep[1], rep[2])


a = list(map(int, input().split()))
t = a[0] + a[1] + a[2] + a[3]
s = t / 3
for i in range(0, 4):
	if a[i] == s:
		pass
	else:
		print(int(s - a[i]), end=' ')


ar = list(map(int, input().strip().split()))
ans = max(ar)
for i in range(len(ar)):
	ar[i] = ans - ar[i]
ar.sort(reverse=True)
print(ar[0], ar[1], ar[2])


(ab, bc, ac, abc) = sorted(list(map(int, input().split())))
print(*[abc - ab, abc - bc, abc - ac])


a = list(map(int, input().split()))
a.sort()
x = []
i = 0
for i in range(0, 3):
	x.append(a[3] - a[i])
	print(x[i], end=' ')
	i = i + 1


(a, b, c, s) = map(int, input().split())
m = max(a, b, c, s)
l = []
if a != m:
	l.append(a)
if b != m:
	l.append(b)
if c != m:
	l.append(c)
if s != m:
	l.append(s)
x = (l[0] - l[1] + l[2]) / 2
y = (l[0] + l[1] - l[2]) / 2
z = m - x - y
print(int(x), int(y), int(z))


a = input()
(a, b, c, d) = a.split()
a = int(a)
b = int(b)
c = int(c)
d = int(d)
if a > b >= c >= d or a > b >= d >= c or a > c >= b >= d or (a > c >= d >= b) or (a > d >= c >= b) or (a > d >= b >= c):
	e = a - b
	f = a - c
	g = a - d
	print(g, f, e)
elif b > a >= c >= d or b > a >= d >= c or b > c >= a >= d or (b > c >= d >= a) or (b > d >= c >= a) or (b > d >= a >= c):
	e = b - a
	f = b - c
	g = b - d
	print(g, f, e)
elif c > a >= b >= d or c > a >= d >= b or c > b >= a >= d or (c > b >= d >= a) or (c > d >= b >= a) or (c > d >= a >= b):
	e = c - a
	f = c - b
	g = c - d
	print(g, f, e)
else:
	e = d - a
	f = d - b
	g = d - c
	print(g, f, e)


t = input().split()
t = [int(s) for s in t]
M = max(t)
s = [M - k for k in t if k < M]
for a in s:
	print(a, end=' ')


(x, y, z, f) = [int(x) for x in input().split()]
list = [x, y, z, f]
mi = min(list)
ma = max(list)
a = ma - mi
h = list.index(min(list))
list.pop(h)
mi = min(list)
ma = max(list)
b = ma - mi
o = list.index(min(list))
list.pop(o)
mi = min(list)
ma = max(list)
c = ma - mi
p = list.index(min(list))
list.pop(p)
print(a, b, c)


l = list(map(int, input().split()))
l.sort()
b = (l[0] - l[1] + l[2]) // 2
a = l[0] - b
c = l[1] - a
print(a, b, c)


(p, q, r, s) = map(int, input().split())
nums = [p, q, r, s]
nums = sorted(nums)
total = nums[3]
c = total - nums[2]
b = total - nums[1]
a = total - nums[0]
print(c, b, a)


a = [int(i) for i in input().split()]
c = max(a)
a.remove(c)
f = a[0]
g = a[1]
h = a[2]
x = (a[0] + a[2] - a[1]) // 2
y = a[0] - x
z = a[2] - x
print(x, y, z)


l = list(map(int, input().split()))
m = max(l)
l.remove(m)
for i in range(3):
	print(m - l[i], ' ', end='')


import sys
import math

def main(args):
	ar = sorted(map(int, input().split()))
	print('%s %s %s' % (ar[3] - ar[0], ar[3] - ar[1], ar[3] - ar[2]))
sys.exit(main(sys.argv))


import sys
local_launch = False
try:
	open('LOCAL').read()
	local_launch = True
except:
	pass
input_data = open('INPUT.txt').read() if local_launch else sys.stdin.read()
done = {'i': 0}
tokens = input_data.split()

def next_token():
	result = tokens[done['i']]
	done['i'] += 1
	return result

def next_int():
	return int(next_token())

def next_str():
	return next_token()
e = next_int()
f = next_int()
g = next_int()
h = next_int()
maz = max(e, f, g, h)
if maz - e != 0:
	print(maz - e)
if maz - f != 0:
	print(maz - f)
if maz - g != 0:
	print(maz - g)
if maz - h != 0:
	print(maz - h)


n = input().split(' ')
for i in range(len(n)):
	n[i] = int(n[i])
maxv = max(n)
res = []
for j in range(len(n)):
	if maxv - n[j] > 0:
		print(maxv - n[j], end=' ')


def restoring_three_numbers(x):
	x.remove(max(x))
	tsum = sum(x) // 2
	return [tsum - i for i in x]
x = list(map(int, input().split()))
print(' '.join(map(str, restoring_three_numbers(x))))


(a, b, c, x) = [int(p) for p in input().split()]
if a > b:
	s = a
elif a == b:
	s = b
else:
	s = b
if s < c:
	s = c
if s < x:
	s = x
a = s - a
b = s - b
c = s - c
x = s - x
if x == 0:
	print(a, b, c)
elif c == 0:
	print(b, x, a)
elif b == 0:
	print(a, x, c)
elif a == 0:
	print(c, b, x)


numbers = sorted(list(map(int, input().split())))[::-1]
for i in numbers[1:]:
	print(numbers[0] - i, end=' ')


l1 = [int(i) for i in input().split(' ')]
t = max(l1)
l2 = []
for i in l1:
	if i != t:
		l2.append(i)
a = t - l2[0]
b = t - l2[1]
c = t - l2[2]
print(a, b, c)


n = [int(x) for x in input().split()]
m = max(n)
n.remove(m)
print(m - n[0], m - n[1], m - n[2])


lis = [int(x) for x in input().split(' ')]
lis.sort()
c = lis[-1] - lis[0]
b = lis[1] - c
a = lis[0] - b
print(a, b, c)


a = list((int(i) for i in input().split()))
abc = max(a)
b = []
for i in a:
	if i != abc:
		b.append(i)
ans = []
ans.append(b[0] + b[1] - abc)
ans.append(b[1] + b[2] - abc)
ans.append(b[0] + b[2] - abc)
print(*ans)


arr = list(map(int, input().split()))
mx = max(arr)
arr.remove(mx)
c = abs(mx - arr[0])
a = abs(mx - arr[1])
b = abs(mx - arr[2])
print(a, b, c)


c = [int(i) for i in input().split()]
c = sorted(c)
print(c[3] - c[1], c[3] - c[0], c[3] - c[2])


inputs = sorted([int(x) for x in input().split()])
sumOfAll = inputs.pop()
print(*[sumOfAll - x for x in inputs])


def main():
	numbers = [int(_) for _ in input().split()]
	numbers.sort()
	[n1, n2, n3, n4] = numbers
	print(n4 - n1, n4 - n2, n4 - n3)
main()


a = [int(a) for a in input().split()]
m = max(a)
a.remove(m)
for i in a:
	print(m - i, end=' ')


arr = [int(val) for val in input().split()]
ans = []
hi = max(arr)
for x in arr:
	if hi - x > 0:
		ans.append(hi - x)
for x in ans:
	print(x, end=' ')


nums = list(map(int, input().split()))
Sum = max(nums)
nums.remove(Sum)
for i in nums:
	print(Sum - i, end=' ')


n = map(int, input().split())
n = list(n)
l = len(n)
max = n[0]
p = 0
for i in range(1, l):
	if n[i] > max:
		max = n[i]
		p = i
a = max - n[0]
b = max - n[1]
c = max - n[2]
d = max - n[3]
if a != 0:
	print(a, end=' ')
if b != 0:
	print(b, end=' ')
if c != 0:
	print(c, end=' ')
if d != 0:
	print(d, end=' ')


args = sorted([int(i) for i in input().split()])
abc = int(max(args))
a = int(args[0])
b = int(args[1])
c = int(args[2])
print('{} {} {}'.format(abs(abc - a), abs(abc - b), abs(abc - c)))


l = list(map(int, input().split(' ')))
l.sort()
x1 = l[0]
x2 = l[1]
x3 = l[2]
x4 = l[3]
ans = []
ans.append(x4 - x1)
ans.append(x4 - x2)
ans.append(x4 - x3)
for i in range(len(ans)):
	print(ans[i], end=' ')
print(' ')


(el1, el2, el3, el4) = sorted([int(x) for x in input().split(' ')])
a = el4 - el3
b = el4 - el2
c = el4 - el1
print(a, b, c)


ls = list(map(int, input().split()))
m = max(ls)
ls = [m - x for x in ls if m - x]
print(*ls)


a = list(map(int, input().split()))
a.sort()
t = a[3]
a.pop(3)
for elem in a:
	print(t - elem, end=' ')


import math
(a, b, c, d) = sorted(map(int, input().split()))
print(d - a, d - b, d - c)


numeros = input().split()
if int(numeros[0]) >= int(numeros[1]):
	a = numeros[1]
	c = numeros[0]
else:
	a = numeros[0]
	c = numeros[1]
if int(numeros[2]) >= int(numeros[3]):
	b = numeros[3]
	d = numeros[2]
else:
	b = numeros[2]
	d = numeros[3]
if int(c) > int(d):
	soma = c
	c = d
else:
	soma = d
soma = int(soma)
a = int(a)
b = int(b)
c = int(c)
a1 = soma - a
b1 = soma - b
c1 = soma - c
print(a1, b1, c1)


arr = list(map(int, input().split(' ')))
arr.sort()
m = arr[-1]
arr.pop()
for i in arr:
	print(m - i, end=' ')


a = list(map(int, input().split()))
m = max(a)
for i in range(4):
	c = m - a[i]
	if c > 0:
		print(c, end=' ')


import sys
nums = list(map(int, sys.stdin.readline().strip().split()))
n4 = max(nums)
res = []
for i in range(len(nums)):
	if nums[i] == n4:
		pass
	else:
		res.append(n4 - nums[i])
print(' '.join(list(map(str, res))))


def main():
	a = [int(i) for i in input().split()]
	total = max(a)
	pos = a.index(total)
	a.remove(a[pos])
	print(total - a[0], total - a[1], total - a[2])
main()


from sys import stdin, exit
(x, y, w, z) = list(map(int, stdin.readline().rstrip().split(' ')))
t = max(x, y, w, z)
for cur in [x, y, w, z]:
	if t - cur > 0:
		print('{} '.format(t - cur), end='')


import math

def BuubleSort(l):
	le = len(l)
	l.sort(reverse=True)
	abc = l[0]
	ab = l[1]
	c = abc - ab
	bc = l[2]
	b = bc - c
	a = abc - bc
	return [a, b, c]

def main():
	l = list(map(int, input().split()))
	ans = BuubleSort(l)
	print(*ans)
main()


a = [int(i) for i in input().split()]
i = 0
k = 0
j = 0
t = 0
if a[0] < a[1]:
	i = a[1]
else:
	i = a[0]
if i < a[2]:
	i = a[2]
if i < a[3]:
	i = a[3]
while j < 4:
	if a[j] < i:
		print(i - a[j], end=' ')
	j += 1


l = list(map(int, input().split()[:4]))
s = max(l)
l.pop(l.index(max(l)))
c = s - l[0]
b = s - l[1]
a = s - l[2]
print(a, b, c, sep=' ', end=' ')


def s(mas):
	mas.sort()
	return (mas[0], mas[1], mas[2])
mas = list(map(int, input().split()))
(a, b, c) = s(mas)
C = -(a - b - c) // 2
print(b - C, c - C, C)


x = list(map(int, input().split()))
x.sort()
y = []
for i in range(3):
	k = x[3] - x[i]
	y.append(k)
print(*y, sep=' ')


a = list(map(int, input().split(' ')))
ans = []
maximum = max(a)
for x in a:
	if x == maximum:
		continue
	ans.append(maximum - x)
print(' '.join(list(map(str, ans))))


s = sorted(list(map(int, input().split())))
assert sum(s[:3]) == 2 * s[3]
b = s[0] - s[1] + s[2]
assert b % 2 == 0
b //= 2
a = s[0] - b
c = s[2] - b
print('{} {} {}'.format(a, b, c))


(A, B, C, D) = sorted(list(map(int, input().split())))
F = D - A
print(F, abs(F - B), abs(F - C))


data = input('')
sums = list(data.split(' '))
numeric = []
for i in sums:
	num = int(i)
	numeric.append(num)
numeric.sort()
x = int(numeric[0])
y = int(numeric[1])
z = int(numeric[2])
w = int(numeric[3])
a = int((z + x - y) / 2)
b = int((x + y - z) / 2)
c = int((z + y - x) / 2)
print(a, ' ', b, ' ', c)


arr = sorted(map(int, input().split()))
max_sum = arr[3]
min_sum = arr[0]
c = max_sum - min_sum
a = arr[1] - c
b = arr[2] - c
print(' '.join(map(str, [a, b, c])))


lis = [int(x) for x in input().split()]
m = max(lis)
for i in lis:
	if m - i > 0:
		print(m - i, end=' ')


x = [int(x) for x in input().split()]
x.sort()
for n in range(3):
	x[n] = x[3] - x[n]
print(str(x[0]) + ' ' + str(x[1]) + ' ' + str(x[2]))


import sys
num_lst = list(map(int, sys.stdin.readline().split()))
max_elem = max(num_lst)
num_lst.pop(num_lst.index(max_elem))
string = ''
for element in num_lst:
	s = str(max_elem - element) + ' '
	string += s
string = string[:-1]
print(string)


(a, b, c, d) = map(int, input().split())
e = max(a, b, c, d)
if e == a:
	print(a - b, a - c, a - d)
elif e == b:
	print(b - a, b - c, b - d)
elif e == c:
	print(c - b, c - a, c - d)
elif e == d:
	print(d - b, d - c, d - a)


(x, y, z, w) = [int(x) for x in input().split()]
abc = (x + y + z + w) / 3
num = [x, y, z, w]
ans = []
for i in range(len(num)):
	if abc == num[i]:
		for j in range(len(num)):
			if j != i:
				ans.append(int(abc - num[j]))
		break
print(str(ans[0]) + ' ' + str(ans[1]) + ' ' + str(ans[2]))


inp = [0, 0, 0, 0]
inp = [int(x) for x in input().split()]
inp = sorted(inp, reverse=True)
c = inp[0] - inp[1]
b = inp[2] - c
a = inp[3] - c
print(a, b, c)


(a, b, c, d) = list(map(int, input().split()))
k = max(a, b, c, d)
if k - a != 0:
	print(k - a, end=' ')
if k - b != 0:
	print(k - b, end=' ')
if k - c != 0:
	print(k - c, end=' ')
if k - d != 0:
	print(k - d, end=' ')


a = input().split()
max = 0
for i in range(4):
	a[i] = int(a[i])
	if a[i] > max:
		max = a[i]
a.remove(max)
print(max - a[0], max - a[1], max - a[2])


lst = [int(x) for x in input().split()]
lst.sort()
num1 = lst[3] - lst[0]
num2 = lst[3] - lst[1]
num3 = lst[3] - lst[2]
print(f'{num1} {num2} {num3}')


(x1, x2, x3, x4) = map(int, input().split())
summ = sorted([x1, x2, x3, x4])
hi = summ[3]
del summ[3]
result = []
for i in summ:
	result.append(str(hi - i))
print(' '.join(result))


a = [int(x) for x in input().split()]
a.sort(key=int)
b = []
b.append(a[3] - a[0])
b.append(a[3] - a[1])
b.append(a[3] - a[2])
for i in range(2):
	print(b[i], end='')
	print(end=' ')
print(b[2])


L = [int(x) for x in input().split()]
S = sum(L) // 3
L.remove(S)
for i in L:
	print(S - i, end=' ')


li = [int(i) for i in input().split()]
li.sort()
x = li[0]
y = li[1]
z = li[2]
s = li[3]
c = s - x
a = y - c
b = z - c
print(a, b, c)


lis = [int(x) for x in input().split()]
ma = max(lis)
res = []
for i in lis:
	if i == ma:
		continue
	res.append(ma - i)
print(res[0], res[1], res[2])


i = [int(j) for j in input().split()]
m = max(i)
for j in i:
	if j != m:
		print(m - j, end=' ')


x = input()
L1 = x.split()

def replace_elements(a, b):
	return [b, a]

def sort1(L, i):
	if int(L[i]) > int(L[i + 1]):
		L[i:i + 2] = replace_elements(L[i], L[i + 1])[0:2]
		return sort1(L, 0)
	elif i == len(L) - 2:
		return L
	elif int(L[i]) <= int(L[i + 1]):
		i = i + 1
		return sort1(L, i)
L1 = sort1(L1, 0)
print(int(L1[3]) - int(L1[2]), int(L1[3]) - int(L1[1]), int(L1[3]) - int(L1[0]))


print(*(lambda x: list(map(lambda y: x[0] - y, x[1])))((lambda x: (max(x), x if x.remove(max(x)) else x))(list(map(int, input().split(' '))))))


(a, b, c, d) = map(int, input().strip().split())
li = [a, b, c, d]
x = int(max(li))
li.remove(x)
for n in li:
	print(x - n)


a = list(map(int, input().split()))
a.sort()
z = max(a)
print(z - a[0], z - a[1], z - a[2], end='')


from sys import stdin
_input = stdin.readline
(_max, _int) = (max, int)

def solution():
	arr = [_int(i) for i in _input().split()]
	r = _max(arr)
	for i in arr:
		if i != r:
			print(r - i, end=' ')
solution()


a = list(map(int, input().split()))
z = max(a)
a0 = z - a[0]
a1 = z - a[1]
a2 = z - a[2]
a3 = z - a[3]
if a0 == 0:
	print('{} {} {}'.format(a1, a2, a3))
elif a1 == 0:
	print('{} {} {}'.format(a0, a2, a3))
elif a2 == 0:
	print('{} {} {}'.format(a0, a1, a3))
elif a3 == 0:
	print('{} {} {}'.format(a1, a2, a0))


sum = [int(i) for i in input().split(' ')]
sum.sort(reverse=True)
print(sum[0] - sum[1], end=' ')
print(sum[0] - sum[2], end=' ')
print(sum[0] - sum[3])


a = [int(i) for i in input().split()]
b = ''
for i in a:
	if max(a) - i != 0:
		b += str(max(a) - i)
		b += ' '
print(b)


x = map(int, input().split())
y = sorted(x)
print(y[3] - y[0], y[3] - y[1], y[3] - y[2])


l1 = []
n = list(map(int, input().split()))
n.sort()
for i in range(len(n) - 1):
	l1.append(n[-1] - n[i])
print(*l1)


n = list(map(int, input().split()))
s = max(n)
n.remove(s)
a = s - n[2]
b = s - n[1]
c = s - n[0]
print(abs(a), abs(b), abs(c))


nums = list(map(int, input().split(' ')))
m = max(nums)
output = ''
for number in nums:
	if number - m != 0:
		output += f'{str(abs(number - m))} '
print(output[:-1])


(n, u, m, s) = sorted(map(int, input().split()))
print(s - m, s - u, s - n)


numbers = input('').split()
index = 0
for number in numbers:
	numbers[index] = int(number)
	index += 1
maxi = 0
for number in numbers:
	if number > maxi:
		maxi = number
if maxi == numbers[0] or maxi == numbers[1]:
	a = maxi - numbers[2]
	b = maxi - numbers[3]
	c = maxi - a - b
else:
	a = maxi - numbers[0]
	b = maxi - numbers[1]
	c = maxi - a - b
print(a, b, c)


A = list(map(int, input().split()))
A = sorted(A)
print(A[3] - A[2], A[3] - A[1], A[3] - A[0])


n = input()
n = n.split(' ')
n = [int(i) for i in n]
n = sorted(n)
x4 = max(n)
print(x4 - int(n[0]), end=' ')
print(x4 - int(n[1]), end=' ')
print(x4 - int(n[2]))


(a, b, c, d) = sorted(map(int, input().split()))
x1 = d - a
x2 = d - b
x3 = d - c
print(x1, x2, x3)


q = sorted(list(map(int, input().split())))
print(q[-1] - q[0], q[-1] - q[1], q[-1] - q[2])


lst = list(map(int, input().split()))
sum = max(lst)
lst.remove(sum)
a = sum - lst[0]
b = sum - lst[1]
c = sum - lst[2]
print(str(a) + ' ' + str(b) + ' ' + str(c))


import sys
from itertools import accumulate

def input():
	return sys.stdin.readline().strip()

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def list4d(a, b, c, d, e):
	return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]

def ceil(x, y=1):
	return int(-(-x // y))

def INT():
	return int(input())

def MAP():
	return map(int, input().split())

def LIST(N=None):
	return list(MAP()) if N is None else [INT() for i in range(N)]

def Yes():
	print('Yes')

def No():
	print('No')

def YES():
	print('YES')

def NO():
	print('NO')
INF = 10 ** 18
MOD = 10 ** 9 + 7
li = LIST()
sm = max(li)
ans = []
for a in li:
	if sm - a != 0:
		ans.append(sm - a)
print(*ans)


(x, y, z, a) = [int(i) for i in input().split()]
for i in (x, y, z, a):
	k = max(x, y, z, a) - i
	if k != 0:
		print(k, end=' ')


l = list(map(int, input().split()))
l = sorted(l)
a = l[0]
b = l[1]
c = l[2]
tot = l[3]
if a == b == c:
	a = b = c = tot - a
else:
	a = tot - a
	b = tot - b
	c = tot - c
print(a, b, c)


s = input()
n = [int(s) for s in s.split()]
mam = max(n)
j = n.index(mam)
n.pop(j)
print(mam - n[0], mam - n[1], mam - n[2])


a = list(map(int, input().rstrip().split()))
liste = []
x = max(a)
for i in a:
	if i == x:
		continue
	else:
		liste.append(x - i)
print(*liste)


x = list(map(int, input().split()))
x.sort()
for i in range(3):
	print(x[3] - x[i])


a = input().split()
for i in range(len(a)):
	a[i] = int(a[i])
s = max(a)
i = 0
n = []
while i < len(a):
	if a[i] < s:
		n.append(s - a[i])
	i += 1
print(n[0], n[1], n[2])


num = [int(i) for i in input().split()]
num.sort()
num1 = num[3] - num[2]
num2 = num[3] - num[1]
num3 = num[3] - num[0]
print(num1, num2, num3)


l = list(map(int, input().split()))
pos = 0
while 1:
	for i in l:
		if l[-1] - i > 0:
			pos += 1
	if pos != 3:
		rem = l[0]
		l = l[1:]
		l.append(rem)
		pos = 0
	else:
		break
print(l[-1] - l[0], l[-1] - l[1], l[-1] - l[2])


[ab, ac, bc, abc] = sorted(list(map(int, input().split())))
a = abc - bc
b = abc - ac
c = abc - ab
print(a, b, c)


def swap(a, b):
	temp = a
	a = b
	b = temp
	return (a, b)
(a, b, c, d) = input().split()
a = int(a)
b = int(b)
c = int(c)
d = int(d)
if d < a:
	(a, d) = (d, a)
if d < b:
	(b, d) = (d, b)
if d < c:
	(c, d) = (d, c)
x = d - a
y = d - b
z = d - c
print(x, y, z)


n = list(map(int, input().split()))
n = sorted(n)
print(n[3] - n[0], n[3] - n[1], n[3] - n[2])


data = input()
dims = data.split(' ')
for i in range(len(dims)):
	dims[i] = int(dims[i])
tripleSum = max(dims)
res = []
for i in range(len(dims)):
	if dims[i] != tripleSum:
		res.append(int(tripleSum) - int(dims[i]))
print(res[0], res[1], res[2])


nums = sorted(map(int, input().split()))
print(nums[3] - nums[0], nums[3] - nums[1], nums[3] - nums[2])


s = input().split(' ')
for i in range(len(s)):
	s[i] = int(s[i])
m = max(s)
for i in range(len(s)):
	if s[i] != m:
		print(m - s[i], end=' ')


import sys
inf = float('inf')
mod = 1000000007

def get_array():
	return list(map(int, sys.stdin.readline().split()))

def get_ints():
	return map(int, sys.stdin.readline().split())

def input():
	return sys.stdin.readline()

def int1():
	return int(input())
import string
import math
from itertools import combinations

def main():
	s = ''
	a = get_array()
	y = max(a)
	for i in a:
		if i != y:
			s = s + str(y - i) + ' '
	print(s)
main()


abcd = [int(i) for i in input().split()]
m = max(abcd)
abcd.remove(m)
for i in abcd:
	print(m - i, end=' ')


(a, b, c, d) = [int(a) for a in input().split()]
if max(a, b, c, d) == a:
	print(a - b, a - c, a - d)
elif max(a, b, c, d) == b:
	print(b - a, b - c, b - d)
elif max(a, b, c, d) == c:
	print(c - a, c - b, c - d)
else:
	print(d - a, d - b, d - c)


l = list(map(int, input().split()))
s_of_three = sum(l) // 3
l.remove(s_of_three)
a = -1 * (l[0] - l[1] - l[2]) // 2
b = -1 * (l[1] - l[0] - l[2]) // 2
c = -1 * (l[2] - l[1] - l[0]) // 2
print(a, b, c)


f = list(map(int, input().split()))
f.sort()
v = f[-1]
print(v - f[0], v - f[1], v - f[2])


def read_ints():
	return list(map(int, input().split()))
a = read_ints()
m = max(a)
ans = ''
for x in a:
	if x != m:
		ans += str(m - x) + ' '
print(ans)


x = sorted(list(map(int, input().split())))
total = x[-1]
a = total - x[0]
b = total - x[1]
c = total - x[2]
print(a, b, c)


A = list(map(int, input().split()))
a = max(A[0], A[1], A[2], A[3])
b = min(A[0], A[1], A[2], A[3])
c = int(a) - int(b)
d = 0
e = 0
if A[1] == a:
	d = a - A[0]
	c = a - A[2]
	e = a - A[3]
elif A[0] == a:
	d = a - A[1]
	c = a - A[2]
	e = a - A[3]
elif A[2] == a:
	d = a - A[0]
	c = a - A[1]
	e = a - A[3]
elif A[3] == a:
	d = a - A[0]
	c = a - A[2]
	e = a - A[1]
print(c, d, e)


(x1, x2, x3, x4) = map(int, input().split())
x5 = [x1, x2, x3, x4]
x6 = max(x5)
for i in x5:
	if i != x6:
		print(x6 - i, end=' ')


s = list(map(int, input().split()))
a = max(s)
b = a - s[0]
c = a - s[1]
d = a - s[2]
e = a - s[3]
f = []
if b != 0:
	f.append(b)
if c != 0:
	f.append(c)
if d != 0:
	f.append(d)
if e != 0:
	f.append(e)
print(*f)


def restoring_nums(arr):
	maxx = max(arr)
	discovered = 0
	out = ''
	for num in arr:
		if num != maxx:
			if ++discovered < 3:
				out += str(maxx - num) + ' '
			else:
				out += str(maxx - num)
	print(out)

def r_input():
	return [int(i) for i in input().split()]
restoring_nums(r_input())


l = input().split(' ')
p = []
for i in l:
	p.append(int(i))
p.sort()
for i in range(1, 4):
	print(p[3] - p[i - 1], end=' ')


def main():
	temp = input().split(' ')
	num = []
	for i in range(len(temp)):
		num.append(int(temp[i]))
	num = sorted(num)
	a = int(num[3]) - int(num[0])
	b = int(num[3]) - int(num[1])
	c = int(num[3]) - int(num[2])
	print(a, b, c)
main()


arr = list(map(int, input().split()))
arr.sort()
maxi = arr[-1]
ans = []
for i in range(3):
	ans.append(maxi - arr[i])
print(*ans)


(a, b, c, d) = input().split(' ')
a = int(a)
b = int(b)
c = int(c)
d = int(d)
if a >= b and a >= c and (a >= d):
	f = a - c
	m = a - d
	e = a - b
elif b >= a and b >= c and (b >= d):
	f = b - c
	m = b - d
	e = b - a
elif c >= b and c >= a and (c >= d):
	f = c - a
	m = c - d
	e = c - b
elif d >= a and d >= b and (d >= c):
	f = d - c
	m = d - a
	e = d - b
print(f, m, e)


lst = sorted(list(map(int, input().split())))
for i in range(3):
	print(lst[-1] - lst[i], end=' ')


val = input()
num = val.split()
num1 = []
for i in range(4):
	num1 += [int(num[i])]
num1 = sorted(num1)
for i in range(3):
	print(num1[3] - num1[i])


li = [int(x) for x in input().split()]
sum = max(li)
li.sort()
a = sum - li[0]
b = sum - li[1]
c = sum - li[2]
print(a, end=' ')
print(b, end=' ')
print(c, end=' ')


(x1, x2, x3, x4) = list(map(int, input().split()))
a = [x1, x2, x3, x4]
a = sorted(a)
b = []
for i in range(3):
	b.append(max(a) - a[i])
print(*b)


def getInts():
	return [int(s) for s in input().split()]

def getInt():
	return int(input())

def getStrs():
	return [s for s in input().split()]

def getStr():
	return input()

def listStr():
	return list(input())
import collections as c

def solve():
	A = getInts()
	A.sort()
	(A, B, C, D) = A
	print(D - A, D - B, D - C)
solve()


numbers = list(map(int, input().split()))
Sum = sum(numbers) // 3
numbers.remove(Sum)
a = Sum - numbers[0]
b = Sum - numbers[1]
c = Sum - numbers[2]
print(a, b, c)


l = list(map(int, input().split()))
eq4 = max(l)
l.remove(eq4)
for i in l:
	print(eq4 - i, end=' ')


import sys
all_inp = input()
list_inp = all_inp.split()
numbers = [int(x) for x in list_inp]
all_sum = sum(numbers)
actual_sum = all_sum / 3
sorted_list = sorted(numbers)
print(int(actual_sum - sorted_list[0]), int(actual_sum - sorted_list[1]), int(actual_sum - sorted_list[2]))


(x1, x2, x3, x4) = map(int, input().split())
m = max(x1, x2, x3, x4)
if m == x1:
	print(x1 - x2, x1 - x3, x1 - x4)
elif m == x2:
	print(x2 - x1, x2 - x3, x2 - x4)
elif m == x3:
	print(x3 - x1, x3 - x2, x3 - x4)
elif m == x4:
	print(x4 - x1, x4 - x2, x4 - x3)


(x1, x2, x3, x4) = sorted(map(int, input().split()))
print(x4 - x1, x4 - x2, x4 - x3)


(a, b, c, d) = sorted(map(int, input().split()))
x = d - a
y = d - b
z = d - c
print(x, y, z)


a = list(map(int, input().split()))
mx = max(a)
a.remove(mx)
for i in range(3):
	print(mx - a[i], sep=' ')


n = input().split()
x = int(n[0])
l = []
p = 0
for i in range(4):
	if int(n[i]) > x:
		x = int(n[i])
		p = i
abc = x
for i in range(4):
	if i != p:
		l.append(int(n[i]))
a = b = c = 0
c = l[0] + l[1] - abc
b = l[0] - c
a = l[1] - c
print(a, b, c)


nums = list(map(int, input().split()))
ABC = max(nums)
for (i, v) in enumerate(nums):
	if v == ABC:
		(nums[i], nums[-1]) = (nums[-1], nums[i])
		nums.pop()
		break
C = ABC - nums[0]
A = nums[1] - C
B = nums[2] - C
print(A, B, C)


ln = [int(i) for i in input().split(' ')]
n = max(ln)
m = ln.index(n)
ns = []
for i in range(0, len(ln)):
	if i == m:
		continue
	ns.append(n - ln[i])
print(' '.join([str(i) for i in ns]))


n = list(map(int, input().split()))
sorted_x = sorted(n)
for i in range(len(sorted_x)):
	a = sorted_x[3] - sorted_x[0]
	b = sorted_x[3] - sorted_x[2]
	c = sorted_x[3] - sorted_x[1]
print(a, b, c)


a = list(map(int, input().split()))
o = max(a)
out = ''
for i in a:
	if i != o:
		out += str(o - i) + ' '
print(out)


(fst, sec, thr, four) = map(int, input().split())
array = [fst, sec, thr, four]
array.sort()
a = max(fst, sec, thr, four) - min(fst, sec, thr, four)
print(a, end=' ')
for i in range(1, len(array) - 1):
	print(array[i] - a, end=' ')


p = input().rstrip().split(' ')
a = int(p[0])
b = int(p[1])
c = int(p[2])
d = int(p[3])
p.sort(key=int, reverse=True)
C = int(p[0]) - int(p[len(p) - 1])
B = int(p[1]) - C
A = int(p[0]) - (C + B)
print(A, B, C)


nums = list(map(int, input().split()))
nums.sort()
total = nums.pop()
fin = [total - i for i in nums]
print(' '.join(map(str, fin)))


a = list(map(int, input().split()))
max_ = max(a)
l = []
for i in a:
	if i != max_:
		l.append(max_ - i)
l.sort()
print(*l)


from math import *
from collections import deque
from copy import deepcopy
import sys

def inp():
	return sys.stdin.readline().rstrip('\r\n')

def multi():
	return map(int, input().split())

def lis():
	return list(map(int, inp().split()))

def out(var):
	sys.stdout.write(str(var))

def printlist(a):
	for p in range(0, len(a)):
		out(str(a[p]) + ' ')

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True
a = lis()
a.sort()
print(a[3] - a[0], a[3] - a[1], a[3] - a[2])


a = list(map(int, input().split()))
b = max(a)
a.remove(max(a))
for i in range(3):
	print(b - a[i], end=' ')


def main():
	eqs = list(map(int, input().split()))
	sumAll = max(eqs)
	eqs.remove(sumAll)
	aAndB = eqs[0]
	bAndC = eqs[1]
	aAndC = eqs[2]
	c = sumAll - aAndB
	a = sumAll - bAndC
	b = sumAll - aAndC
	print(a, b, c)
main()


import sys
sums = input().split(' ')
for i in range(len(sums)):
	sums[i] = int(sums[i])
sums.sort()
a = sums[3] - sums[2]
b = sums[0] - a
c = sums[1] - a
ans = str(a) + ' ' + str(b) + ' ' + str(c)
print(ans)
sys.exit()


import sys
x = list(map(int, input().split()))
a_b_c = max(x)
x.remove(a_b_c)
for i in x:
	print(a_b_c - i, end=' ')


(x1, x2, x3, x4) = map(int, input().split())
x = max(x1, x2, x3, x4)
xs = [x]
y = (x1, x2, x3, x4)
ys = list(y)
ys.remove(x)
a = x - ys[0]
b = x - ys[1]
c = x - ys[2]
print(a, b, c)


nums = list(map(int, input().split()))
nums.sort()
ans = map(str, [nums[3] - nums[0], nums[3] - nums[1], nums[3] - nums[2]])
print(' '.join(ans))


l = list(map(int, input().split(' ')))
l = sorted(l)
s = l[-1]
for i in l[:3]:
	print(abs(s - i), end=' ')


a = list(map(int, input().split()))
a.sort(reverse=True)
num1 = a[0] - a[1]
num2 = a[0] - a[2]
num3 = a[0] - a[3]
print(num1, num2, num3)


s = list(map(int, input().split()))
s = sorted(s)
al = s[-1]
s = s[:len(s) - 1]
for i in s:
	print(al - i, end=' ')


from sys import stdin

def main():
	(A, B, C, D) = map(int, stdin.readline().split())
	tmp = [A, B, C, D]
	tmp.sort()
	for i in range(len(tmp) - 1):
		print(tmp[-1] - tmp[i], end=' ')
main()


(n, m, k, s) = map(int, input().split())
re = max(n, m, k, s)
l = []
l.append(re - n)
l.append(re - m)
l.append(re - k)
l.append(re - s)
l.remove(0)
print(*l)


sums = sorted(list(map(int, input().split())))
print(sums[3] - sums[0], sums[3] - sums[1], sums[3] - sums[2], sep=' ')


(x1, x2, x3, x4) = list(map(int, input().split()))
if max(x1, x2, x3, x4) == x1:
	a = max(x1, x2, x3, x4) - x2
	b = max(x1, x2, x3, x4) - x3
	c = max(x1, x2, x3, x4) - x4
	print(a, ' ', b, ' ', c)
elif max(x1, x2, x3, x4) == x2:
	a = max(x1, x2, x3, x4) - x1
	b = max(x1, x2, x3, x4) - x3
	c = max(x1, x2, x3, x4) - x4
	print(a, ' ', b, ' ', c)
elif max(x1, x2, x3, x4) == x3:
	a = max(x1, x2, x3, x4) - x1
	b = max(x1, x2, x3, x4) - x2
	c = max(x1, x2, x3, x4) - x4
	print(a, ' ', b, ' ', c)
elif max(x1, x2, x3, x4) == x4:
	a = max(x1, x2, x3, x4) - x1
	b = max(x1, x2, x3, x4) - x3
	c = max(x1, x2, x3, x4) - x2
	print(a, ' ', b, ' ', c)


enter = input()
e = enter.split(' ')
x1 = int(e[0])
x2 = int(e[1])
x3 = int(e[2])
x4 = int(e[3])
a = 0
b = 0
c = 0
if x1 > x2 and x1 > x3 and (x1 > x4):
	a = x1 - x2
	b = x1 - x3
	c = x1 - x4
elif x2 > x1 and x2 > x3 and (x2 > x4):
	a = x2 - x1
	b = x2 - x3
	c = x2 - x4
elif x3 > x1 and x3 > x2 and (x3 > x4):
	a = x3 - x1
	b = x3 - x2
	c = x3 - x4
elif x4 > x1 and x4 > x2 and (x4 > x3):
	a = x4 - x1
	b = x4 - x2
	c = x4 - x3
print(a, b, c)


n = sorted(list(map(int, input().split())))
c = n[3] - n[0]
a = n[1] - c
b = n[2] - c
print(a, b, c)


l = list(map(int, input().split()))
l = sorted(l)
w = l[0]
x = l[1]
y = l[2]
z = l[3]
print(max(w, z) - min(w, z))
print(max(x, z) - min(x, z))
print(max(y, z) - min(y, z))


(a_b, a_c, b_c, a_b_c) = sorted(list(map(int, input().split())))
a = a_b_c - b_c
b = a_b - a
c = a_c - a
print('{} {} {}'.format(a, b, c))


X = sorted(list(map(int, input().split())))
print(*[X[-1] - X[i] for i in range(3)])


ip = list(map(int, input().split()))
ip.sort()
(p, q, r, s) = ip
(a, b, c) = (s - p, s - q, s - r)
print(a, b, c)


lst = list(map(int, input().split()))
m = max(lst)
ans = [m - x for x in lst if x != m]
print(ans[0], ans[1], ans[2])


nums = list(map(int, input().split()))
nums.sort()
print(nums[3] - nums[0], nums[3] - nums[1], nums[3] - nums[2])


res = [int(n) for n in input().split()]
s = sum(res) // 3
l = []
for i in range(0, len(res)):
	if res[i] != s:
		l.append(res[i])
print(s - l[0], s - l[1], s - l[2])


(n, m, k, b) = map(int, input().split())
lst = [n, m, k, b]
lst.sort()
q = lst[-1]
a = q - lst[0]
b = q - lst[1]
c = q - lst[2]
print(a, b, c)


nums = list(map(int, input().split()))
nums.sort()
m = nums[-1]
nums.pop(-1)
a = m - nums[0]
b = m - nums[1]
c = m - nums[2]
print(a, b, c)


x = input().split()
p = int(x[0])
q = int(x[1])
r = int(x[2])
t = int(x[3])
s = max(p, q, r, t)
l = []
l.append(s - p)
l.append(s - q)
l.append(s - r)
l.append(s - t)
l.remove(0)
print(*l)


(i1, i2, i3, i4) = [int(x) for x in input().split()]
a = [i1, i2, i3, i4]
m = max(a)
for i in a:
	if i < m:
		print(m - i, end=' ')


(a, b, c, d) = map(int, input().split())
lis = []
lis.append(a)
lis.append(b)
lis.append(c)
lis.append(d)
lis.sort()

def finder():
	vgl_1 = (lis[0] - lis[2]) * -1
	antw_2 = lis[1]
	antw_3 = antw_2 + vgl_1
	z = int(antw_3 / 2)
	y = lis[1] + -1 * z
	x = lis[2] + -1 * z
	print(str(x) + ' ' + str(y) + ' ' + str(z))
finder()


a = list(map(int, input().split()))
r = sum(a) // 3
for i in a:
	if r - i:
		print(r - i, end=' ')


a = input().split(' ')
m = 0
for i in range(4):
	a[i] = int(a[i])
a.sort()
for i in range(3):
	print(a[3] - a[i], end=' ')


l = [int(_) for _ in input().split()]
l.sort()
print(' '.join([str(l[-1] - i) for i in l[:-1]]))


n = list(map(int, input().split()))
m = max(n)
n.remove(m)
for each in n:
	print(m - each, end=' ')


lt = [int(i) for i in input().split()]
lt.sort()
print(lt[-1] - lt[0], lt[-1] - lt[1], lt[-1] - lt[2])


l = list(map(int, input().split()))
l.sort()
(x, y, z, p) = (l[0], l[1], l[2], l[3])
a = int((x - y + z) / 2)
b = int(x - a)
c = int(p - a - b)
print(a, b, c)


from sys import stdin, stdout
N = [int(x) for x in stdin.readline().rstrip().split()]
N.sort(reverse=False)
b = int((N[2] + N[0] - N[1]) / 2)
a = int(N[0] - b)
c = int(N[2] - b)
stdout.write(str(a) + ' ' + str(b) + ' ' + str(c))


(p, q, r, s) = sorted([int(i) for i in input().split()])
print(str(s - p), str(s - q), str(s - r))


allS = list(map(int, input().split()))
allS.sort()
for (num, k) in enumerate(allS):
	if num != 3:
		print(int(allS[3]) - int(k), end=' ')


ara = list(map(int, input().split()))
ara.sort()
m = abs(ara[3] - (ara[0] + ara[1]))
n = abs((ara[2] + ara[1] - ara[0]) / 2)
o = abs(ara[3] - (m + n))
print(int(m), int(n), int(o))


lst = list(map(int, input().split()))
v = 0
for i in lst:
	if i > v:
		v = i
lst.remove(v)
new_lst = []
for i in lst:
	x = v - i
	new_lst.append(x)
print(*new_lst)


nums = sorted(map(int, input().split()), reverse=True)
all_sum = nums[0]
solution = []
for i in range(1, len(nums)):
	solution.append(all_sum - nums[i])
for n in solution:
	print(n, end=' ')


x = list(map(int, input().split()))
m = max(x)
x.remove(m)
print(m - x[0], m - x[1], m - x[2])


(a, b, c, d) = input().split()
a = int(a)
b = int(b)
c = int(c)
d = int(d)
max = 0
if a > b and a > c and (a > d):
	bb = a - b
	cc = a - c
	dd = a - d
	print(bb, cc, dd)
elif b > a and b > c and (b > d):
	bb = b - a
	cc = b - c
	dd = b - d
	print(bb, cc, dd)
elif c > a and c > b and (c > d):
	bb = c - b
	cc = c - a
	dd = c - d
	print(bb, cc, dd)
else:
	bb = d - b
	cc = d - c
	dd = d - a
	print(bb, cc, dd)


(a, b, c, d) = [int(i) for i in input().split()]
x = max(a, b, c, d)
if x == a:
	p = x - b
	q = x - c
	r = x - d
if x == b:
	p = x - a
	q = x - c
	r = x - d
if x == c:
	p = x - a
	q = x - b
	r = x - d
if x == d:
	p = x - a
	q = x - b
	r = x - c
print(p, q, r)


x = input()
arr = []
for i in range(4):
	a = int(x.split(' ')[i])
	arr.append(a)
z = max(arr)
arr.remove(max(arr))
print(str(z - arr[0]) + ' ' + str(z - arr[1]) + ' ' + str(z - arr[2]))


(i1, i2, i3, i4) = map(int, input().split())
x = [i1, i2, i3, i4]
x.sort()
a = x[0] + x[1] - x[3]
b = -x[1] + x[3]
c = x[2] + x[1] - x[3]
print(int(a), int(b), int(c))


class CodeforcesTask1154ASolution:

	def __init__(self):
		self.result = ''
		self.s_s_s_ss = []

	def read_input(self):
		self.s_s_s_ss = [int(x) for x in input().split(' ')]

	def process_task(self):
		self.s_s_s_ss.sort()
		c = self.s_s_s_ss[3] - self.s_s_s_ss[0]
		b = self.s_s_s_ss[3] - self.s_s_s_ss[1]
		a = self.s_s_s_ss[3] - self.s_s_s_ss[2]
		self.result = '{0} {1} {2}'.format(a, b, c)

	def get_result(self):
		return self.result
Solution = CodeforcesTask1154ASolution()
Solution.read_input()
Solution.process_task()
print(Solution.get_result())


a = sorted(eval('[' + ','.join(input().split()) + ']'))
print(a[3] - a[0], end=' ')
print(a[3] - a[1], end=' ')
print(a[3] - a[2])


random = list(map(int, input().split()))
random.sort()
abc = random.pop(len(random) - 1)
ab = random[0]
ac = random[1]
bc = random[2]
b = abc - ac
a = abc - bc
c = abc - ab
print(a, b, c)


a = list(map(int, input().split()))
maxi = max(a)
for i in a:
	if i == maxi:
		continue
	else:
		print(maxi - i, end=' ')


def find_num():
	str = input()
	tokens = str.split(' ')
	nums = []
	nums.append(int(tokens[0]))
	nums.append(int(tokens[1]))
	nums.append(int(tokens[2]))
	nums.append(int(tokens[3]))
	all_sum = max(nums)
	for num in nums:
		diff = all_sum - num
		if diff != 0:
			print(diff)
find_num()


(a, b, c, ab) = map(int, input().split())
ll = [a, b, c, ab]
ll.sort()
for i in range(3):
	print(ll[-1] - ll[i], end=' ')


arr = list(map(int, input().split(' ')))
x = max(arr)
for i in arr:
	if i == x:
		continue
	else:
		print(x - i)


num = input().split()
maxi = 0
num_int = []
total = ''
for x in num:
	if int(x) >= maxi:
		maxi = int(x)
	num_int.append(int(x))
num_int.append(num_int.pop(num_int.index(maxi)))
for x in num_int:
	if x != maxi:
		total += str(maxi - x) + ' '
print(total)


(n1, n2, n3, n4) = sorted(map(int, input().split()))
print(n4 - n3, n4 - n2, n4 - n1)


(a, b, c, d) = map(int, input().split())
high = max(a, b, c, d)
numbers = [high - i for i in [a, b, c, d] if i != high]
print(*numbers)


line = [int(i) for i in input().split()]
curr_max = max(line)
line.remove(curr_max)
print(curr_max - line[0])
print(curr_max - line[1])
print(curr_max - line[2])


n = list(map(int, input().split()))
total = max(n)
j = n.index(total)
for i in range(len(n)):
	if j == i:
		continue
	else:
		print(total - n[i], end=' ')


s1 = input().split()
s = []
for i in range(4):
	k = int(s1[i])
	s.append(k)
s = sorted(s)
a = int(s[3]) - int(s[0])
b = int(s[3]) - int(s[1])
c = int(s[3]) - int(s[2])
print(a, b, c)


a = list(map(int, input().split()))
abc = max(a)
a.remove(abc)
x = abc - a[0]
print(x, a[1] - x, a[2] - x)


n = list(map(int, input().split()))
sum3 = n.pop(n.index(max(n)))
c = sum3 - n[0]
print(c, n[1] - c, n[2] - c)


numbers = map(int, input().split())
lst = list(numbers)
lst2 = []
for i in lst:
	lst2.append(i)
lst2.sort()
a = lst2[3] - lst2[0]
b = lst2[3] - lst2[1]
c = lst2[3] - lst2[2]
lst4 = []
lst4.insert(0, b)
lst4.insert(1, c)
lst4.insert(2, a)
print(lst4[0], lst4[1], lst4[2])


(x, z, y, g) = map(int, input().split())
u = max(x, z, y, g)
b = u - x
c = u - z
v = u - y
n = u - g
if b == 0:
	print(c, v, n)
elif c == 0:
	print(v, n, b)
elif v == 0:
	print(b, c, n)
elif n == 0:
	print(c, v, b)


(a, b, c, d) = map(int, input().split())
f = max(a, b, c, d)
l1 = [a, b, c, d]
l1.sort()
l1 = l1[:3]
for item in l1:
	print(f - item, end=' ')


l = list(map(int, input().split()))
d = sorted(l)
m = max(d)
a = m - d[0]
b = m - d[1]
c = m - d[2]
print(a, b, c)


n = [int(x) for x in input().split()]
b = max(n)
for i in n:
	if i != b:
		print(b - i, end=' ')


list0 = [int(x) for x in input().split(' ')]
list0 = sorted(list0, reverse=1)
print(list0[0] - list0[1], list0[0] - list0[2], list0[0] - list0[3], sep=' ')


l = list(map(int, input().split()))
l.sort(reverse=True)
m = []
i = 0
j = 1
while j < len(l):
	m.append(abs(l[i] - l[j]))
	j += 1
d = m.pop(0)
e = m.pop(1)
f = m.pop(0)
print(d, e, f)


import math
(a, b, c, d) = map(int, input().split())
x = max(a, b, c, d)
ans = []
ans.append(x - a)
ans.append(x - b)
ans.append(x - c)
ans.append(x - d)
ans.remove(0)
for i in ans:
	print(i, end=' ')


a = input().split()
b = int(a[0])
c = int(a[1])
d = int(a[2])
e = int(a[3])
large = max(b, c, d, e)
o = []
if large > b:
	o.append(large - b)
if large > c:
	o.append(large - c)
if large > d:
	o.append(large - d)
if large > e:
	o.append(large - e)
print(o[0], o[1], o[2])


z = str(input()).split()
arr = []
for i in range(len(z)):
	arr.append(int(z[i]))
arr.sort()
hasil = []
hasil.append(arr[3] - arr[0])
hasil.append(arr[3] - arr[1])
hasil.append(arr[3] - arr[2])
for i in range(len(hasil)):
	if i != len(hasil) - 1:
		print(hasil[i], end=' ')
	else:
		print(hasil[i])


a = list(map(int, input().split()))
m = max(a)
a.remove(m)
res = ''
for i in a:
	res += str(m - i) + ' '
print(res)


a = list(map(int, input().split()))
s = 0
for i in a:
	s = s + i
x = s // 3
l = []
for i in a:
	if i != x:
		l.append(x - i)
print(*l)


arr = [int(i) for i in input().split()]
mx = max(arr)
for i in arr:
	if i != mx:
		print(mx - i, end=' ')


a = [int(x) for x in input().split()]
m = max(a)
l = a.index(m)
for i in a:
	if i != m:
		print(m - i, end=' ')


temp = input()
arr = temp.split(' ')
for i in range(len(arr)):
	arr[i] = int(arr[i])
arr.sort(reverse=True)
print(arr[0] - arr[1], arr[0] - arr[2], arr[0] - arr[3])


ints = [int(x) for x in input().split(' ')]
abc = max(ints)
ints.remove(abc)
answer = [abc - x for x in ints]
for i in answer:
	print(i, end=' ')


li = list(map(int, input().split()))
li.remove(max(li))
print((li[0] + li[1] - li[2]) // 2, (li[0] + li[2] - li[1]) // 2, (li[1] + li[2] - li[0]) // 2)


(w, x, y, z) = input().split()
w = int(w)
x = int(x)
y = int(y)
z = int(z)
m = max(w, x, y, z)
a = m - w
b = m - x
c = m - y
d = m - z
if a == 0:
	print(b, c, d)
elif b == 0:
	print(c, d, a)
elif c == 0:
	print(d, a, b)
else:
	print(a, b, c)


(x1, x2, x3, x4) = map(int, input().split())
if x1 > x2 and x1 > x3 and (x1 > x4):
	print(x1 - x2, end=' ')
	print(x1 - x3, end=' ')
	print(x1 - x4, end=' ')
if x2 > x1 and x2 > x3 and (x2 > x4):
	print(x2 - x1, end=' ')
	print(x2 - x3, end=' ')
	print(x2 - x4, end=' ')
if x3 > x1 and x3 > x2 and (x3 > x4):
	print(x3 - x1, end=' ')
	print(x3 - x2, end=' ')
	print(x3 - x4, end=' ')
if x4 > x1 and x4 > x2 and (x4 > x3):
	print(x4 - x1, end=' ')
	print(x4 - x2, end=' ')
	print(x4 - x3, end=' ')


ar = list(map(int, input().split()))
d = max(ar)
w = []
ar.remove(d)
for i in ar:
	w.append(d - i)
print(*w)


numbers = [int(i) for i in input().split()]
sum_n = max(numbers)
others = [i for i in numbers if i != sum_n]
print(sum_n - others[0], sum_n - others[1], sum_n - others[2])


a = [int(i) for i in input().split()]
m = 0
for i in a:
	if i > m:
		m = i
for i in a:
	if i != m:
		print(m - i, end=' ')


l = list(map(int, input().split()))
s = sum(l)
s = int(s / 3)
l.remove(s)
print(' '.join([str(s - i) for i in l]))


lst = list(map(int, input().split()))
maxv = max(lst)
del_that = lst.index(maxv)
del lst[del_that]
new_lst = []
for i in lst:
	new_lst.append(abs(maxv - i))
for i in new_lst:
	print(i, end=' ')


List = [int(j) for j in input().split(' ')]
List.sort()
for i in range(len(List) - 2):
	print(List[len(List) - 1] - List[i], end=' ')
print(List[len(List) - 1] - List[len(List) - 2])


v = sorted([int(x) for x in input().split()])[::-1]
print(' '.join([str(v[0] - k) for k in v[1:]]))


x = [int(elem) for elem in input().split()]
max_x = max(x)
x.remove(max_x)
for i in range(len(x)):
	print(max_x - x[i], end=' ')


(x1, x2, x3, x4) = map(int, input().split())
abc = max(x1, x2, x3, x4)
if abc - x1 > 0:
	print(abc - x1)
if abc - x2 > 0:
	print(abc - x2)
if abc - x3 > 0:
	print(abc - x3)
if abc - x4 > 0:
	print(abc - x4)


v = input().split()
mx = 0
for x in v:
	if int(x) > mx:
		mx = int(x)
for x in v:
	if int(x) != mx:
		print(mx - int(x), end=' ')


ls = list(map(int, input().split()))
ls.sort()
abc = ls[-1]
ab = ls[0]
bc = ls[1]
ca = ls[2]
c = abc - ab
a = abc - bc
b = abc - ca
print(a, b, c)


import sys
sys.setrecursionlimit(10 ** 5 + 1)
inf = int(10 ** 20)
max_val = inf
min_val = -inf
RW = lambda : sys.stdin.readline().strip()
RI = lambda : int(RW())
RMI = lambda : [int(x) for x in sys.stdin.readline().strip().split()]
RWI = lambda : [x for x in sys.stdin.readline().strip().split()]
(w, x, y, abc) = sorted(RMI())
print(abc - w, abc - x, abc - y)


a = sorted(list(map(int, input().split())), reverse=True)
print(a[0] - a[1], a[0] - a[2], a[0] - a[3])


A = list(map(int, input().split()))
A.sort()
print(A[3] - A[0], A[3] - A[1], A[3] - A[2])


(x1, x2, x3, x4) = sorted(list(map(int, input().split())))
a = x4 - x2
b = x4 - x3
c = x4 - x1
print(f'{a} {b} {c}')


(x, y, z, w) = sorted(map(int, input().split()))
a = (-x + y + z) // 2
b = (x - y + z) // 2
c = (x + y - z) // 2
print(a, b, c)


n = map(int, input().split())
p = sorted(n)
a = 0
b = 0
c = 0
for i in p:
	a = p[3] - p[1]
	b = p[3] - p[2]
	c = p[3] - p[0]
print(a, b, c)


temp = list(map(int, input().split()))
temp.sort()
b = (temp[0] - temp[1] + temp[2]) / 2
a = temp[0] - b
c = temp[2] - b
print(int(a), end=' ')
print(int(b), end=' ')
print(int(c))


n = input().split()
m = []
r = []
for i in range(4):
	m.append(int(n[i]))
index = m.index(max(m))
for x in range(4):
	if m[index] - m[x] > 0:
		r.append(m[index] - m[x])
print(*r)


(x1, x2, x3, x4) = [int(i) for i in input().split()]
if x1 >= x2 and x1 >= x3 and (x1 >= x4):
	a = x1 - x2
	b = x1 - x3
	c = x1 - x4
elif x2 >= x3 and x2 >= x4 and (x2 >= x1):
	a = x2 - x1
	b = x2 - x3
	c = x2 - x4
elif x3 >= x1 and x3 >= x2 and (x3 >= x4):
	a = x3 - x1
	b = x3 - x2
	c = x3 - x4
else:
	a = x4 - x1
	b = x4 - x2
	c = x4 - x3
if 2 <= x1 <= 10 ** 9 and 2 <= x2 <= 10 ** 9 and (2 <= x3 <= 10 ** 9) and (2 <= x4 <= 10 ** 9):
	print(a, end=' ')
	print(b, end=' ')
	print(c, end=' ')


l = [int(i) for i in input().split()]
s = max(l)
l.remove(s)
a = s - l[0]
b = s - l[1]
c = s - l[2]
print(c, b, a)


from itertools import permutations
A = list(map(int, input().split()))
A.sort()
m = A[-1]
for x in A[:-1]:
	print(m - x, end=' ')
print()


x = input().split()
array = [0] * 4
for i in range(4):
	array[i] += int(x[i])
for i in range(4):
	for j in range(4):
		if array[i] >= array[j]:
			z = array[i]
			array[i] = array[j]
			array[j] = z
a = array[0] - array[3]
b = array[0] - array[2]
c = array[0] - (a + b)
print(a, b, c)


q = list(map(int, input().split()))
q.sort()
arr = [q[-1] - x for x in q]
arr = arr[:-1]
print(*arr)


l = [int(x) for x in input().split()]
l.sort()
a = l[0] + l[1] - l[3]
b = l[0] - a
c = l[1] - a
print(a, b, c)


a = list(map(int, input().split()))
sum = max(a)
for i in range(4):
	if a[i] != sum:
		print(sum - a[i], end=' ')


x = list(map(int, input().strip().split(' ')))
x.sort()
y = []
for i in range(len(x) - 2, -1, -1):
	y.append(x[len(x) - 1] - x[i])
if len(y) is 1:
	print(y[0])
elif len(y) is 0:
	print()
else:
	for i in range(len(y) - 1):
		print(y[i], end=' ')
	print(y[len(y) - 1])


x = list(map(int, input().split()))
y = max(x)
lsr = []
for i in x:
	lsr.append(y - i)
lsr.remove(0)
for j in lsr:
	print(j, end=' ')


(x1, x2, x3, x4) = list(map(int, input().split()))
lst = [x1, x2, x3, x4]
lst.sort()
c = lst[3] - lst[0]
b = lst[3] - lst[1]
a = lst[3] - lst[2]
print(a, b, c)


x = list(map(int, input().split()))
x.sort()
sum = x[3]
ans = []
for i in range(3):
	b = sum - x[i]
	ans.append(b)
print(*ans)


nums = list(map(int, input().split()))
abc = nums[0]
for num in nums:
	if num > abc:
		abc = num
nums.remove(abc)
ab = nums[0]
a_or_b = ab + nums[1] - abc
b_or_a = ab - a_or_b
if nums[1] - a_or_b == nums[2] - b_or_a:
	c = nums[1] - a_or_b
else:
	c = nums[1] - b_or_a
print('{} {} {}'.format(a_or_b, b_or_a, c))


(p, q, r, s) = input().split()
p = int(p)
q = int(q)
r = int(r)
s = int(s)
m = max(p, q, r, s)
if m == p:
	print(f'{p - q} {p - r} {p - s}')
elif m == q:
	print(f'{q - p} {q - r} {q - s}')
elif m == r:
	print(f'{r - q} {r - p} {r - s}')
else:
	print(f'{s - q} {s - r} {s - p}')


l = list(map(int, input().split()))
l.sort(reverse=True)
s = l[0]
for i in range(1, len(l)):
	print(s - l[i], end=' ')


(a, b, c, d) = sorted([int(t) for t in input().split()])
print(d - c, d - b, d - a)


arr = list(map(int, input().split()))
arr.sort()
print(arr[-1] - arr[0], arr[-1] - arr[1], arr[-1] - arr[2])


def main(argc, argv) -> {}:
	sync_with_stdio(false)
	cin.tie(0)
	cout.tie(0)
	A = vector << int >> 4
	A <<= cin
	summa = max(A)
	A.remove(summa)
	two_a = A[0] + A[1] - A[2]
	two_b = A[0] + A[2] - A[1]
	two_c = A[1] + A[2] - A[0]
	cout << two_a // 2 << ' ' << two_b // 2 << ' ' << two_c // 2 << endl
	{}
import base64
exec(base64.decodebytes('cHkyID0gcm91bmQoMC41KQoKaWYgcHkyOgogICAgZnJvbSBmdXR1cmVfYnVpbHRpbnMgaW1wb3J0IGFzY2lpLCBmaWx0ZXIsIGhleCwgbWFwLCBvY3QsIHppcAogICAgcmFuZ2UgPSB4cmFuZ2UKCmRlZiBzeW5jX3dpdGhfc3RkaW8oYik6CiAgICBpZiBiOiByZXR1cm4KICAgIGltcG9ydCBvcywgc3lzCiAgICBmcm9tIGlvIGltcG9ydCBCeXRlc0lPLCBJT0Jhc2UKICAgIAogICAgIyBGYXN0SU8gZm9yIFB5UHkyIGFuZCBQeVB5MyAod29ya3Mgd2l0aCBpbnRlcmFjdGl2ZSkgYnkgUGFqZW5lZ29kCiAgICBjbGFzcyBGYXN0SShvYmplY3QpOgogICAgICAgIGRlZiBfX2luaXRfXyhzZWxmLCBmZD0wLCBidWZmZXJzaXplPTIqKjE0KToKICAgICAgICAgICAgc2VsZi5zdHJlYW0gPSBzdHJlYW0gPSBCeXRlc0lPKCk7IHNlbGYuYnVmZW5kbCA9IDAKICAgICAgICAgICAgZGVmIHJlYWQyYnVmZmVyKCk6CiAgICAgICAgICAgICAgICBzID0gb3MucmVhZChmZCwgYnVmZmVyc2l6ZSArIG9zLmZzdGF0KGZkKS5zdF9zaXplKTsgcG9zID0gc3RyZWFtLnRlbGwoKQogICAgICAgICAgICAgICAgc3RyZWFtLnNlZWsoMCwyKTsgc3RyZWFtLndyaXRlKHMpOyBzdHJlYW0uc2Vlayhwb3MpOyByZXR1cm4gcwogICAgICAgICAgICBzZWxmLnJlYWQyYnVmZmVyID0gcmVhZDJidWZmZXIKICAgICAgICAjIFJlYWQgZW50aXJlIGlucHV0CiAgICAgICAgZGVmIHJlYWQoc2VsZik6CiAgICAgICAgICAgIHdoaWxlIHNlbGYucmVhZDJidWZmZXIoKTogcGFzcwogICAgICAgICAgICByZXR1cm4gc2VsZi5zdHJlYW0ucmVhZCgpIGlmIHNlbGYuc3RyZWFtLnRlbGwoKSBlbHNlIHNlbGYuc3RyZWFtLmdldHZhbHVlKCkKICAgICAgICBkZWYgcmVhZGxpbmUoc2VsZik6CiAgICAgICAgICAgIHdoaWxlIHNlbGYuYnVmZW5kbCA9PSAwOiBzID0gc2VsZi5yZWFkMmJ1ZmZlcigpOyBzZWxmLmJ1ZmVuZGwgKz0gcy5jb3VudChiIlxuIikgKyAobm90IHMpCiAgICAgICAgICAgIHNlbGYuYnVmZW5kbCAtPSAxOyByZXR1cm4gc2VsZi5zdHJlYW0ucmVhZGxpbmUoKQogICAgICAgIGRlZiBpbnB1dChzZWxmKTogcmV0dXJuIHNlbGYucmVhZGxpbmUoKS5yc3RyaXAoYidcclxuJykKICAgICAgICAKICAgICAgICAjIFJlYWQgYWxsIHJlbWFpbmluZyBpbnRlZ2VycywgdHlwZSBpcyBnaXZlbiBieSBvcHRpb25hbCBhcmd1bWVudAogICAgICAgIGRlZiByZWFkbnVtYmVycyhzZWxmLCB6ZXJvPTApOgogICAgICAgICAgICBjb252ID0gb3JkIGlmIHB5MiBlbHNlIGxhbWJkYSB4OngKICAgICAgICAgICAgQSA9IFtdOyBudW1iID0gemVybzsgc2lnbiA9IDE7IGMgPSBiIi0iWzBdCiAgICAgICAgICAgIGZvciBjIGluIHNlbGYucmVhZCgpOgogICAgICAgICAgICAgICAgaWYgYyA+PSBiIjAiWzBdOiBudW1iID0gMTAgKiBudW1iICsgY29udihjKSAtIDQ4CiAgICAgICAgICAgICAgICBlbGlmIGMgPT0gYiItIlswXTogc2lnbiA9IC0xCiAgICAgICAgICAgICAgICBlbGlmIGMgIT0gYiJcciJbMF06IEEuYXBwZW5kKHNpZ24qbnVtYik7IG51bWIgPSB6ZXJvOyBzaWduID0gMQogICAgICAgICAgICBpZiBjID49IGIiMCJbMF06IEEuYXBwZW5kKHNpZ24qbnVtYikKICAgICAgICAgICAgcmV0dXJuIEEKICAgIAogICAgY2xhc3MgRmFzdE8oSU9CYXNlKToKICAgICAgICBkZWYgX19pbml0X18oc2VsZiwgZmQ9MSk6CiAgICAgICAgICAgIHN0cmVhbSA9IEJ5dGVzSU8oKQogICAgICAgICAgICBzZWxmLmZsdXNoID0gbGFtYmRhOiBvcy53cml0ZSgxLCBzdHJlYW0uZ2V0dmFsdWUoKSkgYW5kIG5vdCBzdHJlYW0udHJ1bmNhdGUoMCkgYW5kIHN0cmVhbS5zZWVrKDApCiAgICAgICAgICAgIHNlbGYud3JpdGUgPSBzdHJlYW0ud3JpdGUgaWYgcHkyIGVsc2UgbGFtYmRhIHM6IHN0cmVhbS53cml0ZShzLmVuY29kZSgpKQogICAgCiAgICBzeXMuc3RkaW4sIHN5cy5zdGRvdXQgPSBGYXN0SSgpLCBGYXN0TygpCiAgICBnbG9iYWwgaW5wdXQKICAgIGlucHV0ID0gc3lzLnN0ZGluLmlucHV0CgoKaW1wb3J0IHN5cwoKY2xhc3Mgb3N0cmVhbToKICAgIGRlZiBfX2xzaGlmdF9fKHNlbGYsYSk6CiAgICAgICAgaWYgYSA9PSBlbmRsOgogICAgICAgICAgICBzeXMuc3Rkb3V0LndyaXRlKCJcbiIpCiAgICAgICAgICAgIHN5cy5zdGRvdXQuZmx1c2goKQogICAgICAgIGVsc2U6CiAgICAgICAgICAgIHN5cy5zdGRvdXQud3JpdGUoc3RyKGEpKQogICAgICAgIHJldHVybiBzZWxmCiAgICBkZWYgdGllKHNlbGYsIHZhbCk6cGFzcwpjb3V0ID0gb3N0cmVhbSgpCmVuZGwgPSBvYmplY3QoKQoKY2xhc3MgaXN0cmVhbToKICAgIHRpZWR0byA9IGNvdXQKICAgIGlucCA9IE5vbmUKICAgIGRlZiBfX3Jsc2hpZnRfXyhhLGIpOgogICAgICAgIGlmIGEudGllZHRvID09IGNvdXQ6CiAgICAgICAgICAgIHN5cy5zdGRvdXQuZmx1c2goKQogICAgICAgIGlmIHR5cGUoYik9PXR1cGxlIG9yIHR5cGUoYik9PWxpc3Q6CiAgICAgICAgICAgIHJldHVybiB0eXBlKGIpKHR5cGUoYykoYS5nZXQoKSkgZm9yIGMgaW4gYikKICAgICAgICByZXR1cm4gdHlwZShiKShhLmdldCgpKQogICAgZGVmIHRpZShzZWxmLCB2YWwpOgogICAgICAgIHNlbGYudGllZHRvID0gdmFsCiAgICBkZWYgZ2V0KGEpOgogICAgICAgIHdoaWxlIG5vdCBhLmlucDoKICAgICAgICAgICAgYS5pbnAgPSBzeXMuc3RkaW4ucmVhZGxpbmUoKS5zcGxpdCgpWzo6LTFdCiAgICAgICAgcmV0dXJuIGEuaW5wLnBvcCgpCmNpbiA9IGlzdHJlYW0oKQoKY2xhc3MgVmVjdG9yOgogICAgZGVmIF9fbHNoaWZ0X18oc2VsZiwgb3RoZXIpOgogICAgICAgIHNlbGYudHlwZSA9IG90aGVyCiAgICAgICAgcmV0dXJuIHNlbGYKICAgIGRlZiBfX3JzaGlmdF9fKHNlbGYsIG90aGVyKToKICAgICAgICBpZiB0eXBlKG90aGVyKSA9PSB0dXBsZToKICAgICAgICAgICAgcmV0dXJuIFtzZWxmLnR5cGUob3RoZXJbMV0pXSpvdGhlclswXQogICAgICAgIGVsc2U6CiAgICAgICAgICAgIHJldHVybiBbc2VsZi50eXBlKCldKm90aGVyCnZlY3RvciA9IFZlY3RvcigpCg=='.encode()))
true = True
false = False
main(len(sys.argv), sys.argv)


x = list(map(int, input().split()))
s = max(x)
x.remove(s)
(q, w, e) = x
a = q + w - s
b = q + e - s
c = w + e - s
print(a, b, c)


results = list(map(int, input().split()))
abc = max(results)
results.remove(abc)
for r in results:
	print(abc - r, end=' ')


arr = [int(i) for i in input().split()]
arr.sort()
print(arr[-1] - arr[0], arr[-1] - arr[1], arr[-1] - arr[2])


import sys
counter = 0
for lin in sys.stdin:
	line = lin.rstrip()
	if counter == 0:
		nums = [int(l) for l in line.split()]
		break
ans = []
m = max(nums)
max_done = False
for i in nums:
	if not max_done and m - i == 0:
		max_done = True
	else:
		ans.append(m - i)
print(' '.join([str(h) for h in ans]))


n = [int(i) for i in input().split()]
n = sorted(n)
x1 = max(n) - n[2]
x2 = max(n) - n[1]
x3 = max(n) - n[0]
print(x1, x2, x3)


lista = input()
m = lista.split(' ')
for i in range(len(m)):
	m[i] = int(m[i])
n = sorted(m)
a = n[3] - n[2]
c = n[1] - a
b = n[0] - a
print(a, b, c)


s = [int(x) for x in input().split()]
s.sort()
a = c = b = 0
while a + b + c != s[3]:
	c = (s[2] + s[1] - s[0]) // 2
	a = s[1] - c
	b = s[2] - c
print(a, b, c)


A = list(map(int, input().split()))
A.sort()
a = A[0] + A[1] - A[3]
print(a, A[0] - a, A[1] - a)


lista = input().split()
max = 0
for i in range(len(lista)):
	if int(lista[i]) > max:
		max = int(lista[i])
for j in range(len(lista)):
	if int(lista[j]) < max:
		atual = max - int(lista[j])
		print('%d ' % atual, end='')
print()


sums = list(map(int, input().split()))
sums.sort()
num1 = sums[-1] - sums[-2]
num2 = sums[0] - num1
num3 = sums[-1] - num1 - num2
print(num1, num2, num3)


a = list(map(int, input().split()))
b = a.sort()
(print(a[3] - a[0], end=' '), print(a[3] - a[1], end=' '), print(a[3] - a[2], end=' '))


x = list(map(int, input().split()))
s = max(x)
x.remove(s)
for i in x:
	print(str(s - i))


stdin = input()
res = []
max_num = None
nums = []
for i in stdin.split(' '):
	num = int(i)
	if max_num is None:
		max_num = num
	if num > max_num:
		max_num = num
	nums.append(num)
for i in nums:
	r = max_num - i
	if r:
		res.append(str(r))
print(' '.join(res))


n = input().split()
length = len(n)
for x in range(0, length):
	n[x] = int(n[x])
n.sort()
num = [0, 0, 0]
maximum = int(max(n))
for i in range(length - 1):
	num[i] = maximum - int(n[i])
k = ''
for i in range(3):
	k = k + str(num[i]) + ' '
print(k)


x = [int(y) for y in input().split(' ')]
x.sort()
print(x[-1] - x[0], x[-1] - x[1], x[-1] - x[2])


def main():
	nums = [int(i) for i in input().split()]
	nums.sort()
	sumof3 = nums.pop()
	c = sumof3 - nums[-1]
	ab = nums.pop()
	a = nums.pop() - c
	b = nums.pop() - c
	print(a, b, c)
main()


def solve(n):
	s = n[-1]
	ans = []
	for i in range(len(n) - 1):
		ans.append(s - n[i])
	ans = [str(i) for i in ans]
	return ' '.join(ans)
n = sorted([int(i) for i in input().split()])
print(solve(n))


l = sorted(list(map(int, input().split())))
print(l[-1] - l[2], l[-1] - l[1], l[-1] - l[0])


import sys
(a, b, c, d) = map(int, input().split())
plus = max(a, b, c, d)
arr = [plus - a, plus - b, plus - c, plus - d]
arr.remove(0)
print(arr[0], arr[1], arr[2])


l = list(map(int, input().split()))
s = max(l)
l.remove(s)
l.sort()
t = l[0] - l[1]
a = t + l[2]
a = a // 2
b = l[0] - a
c = s - b - a
print(a, b, c, sep=' ', end='')


(a, b, c, d) = list(map(int, input().split()))
mx = max(a, b, c, d)
a = mx - a
b = mx - b
c = mx - c
d = mx - d
if a:
	print(a, end=' ')
if b:
	print(b, end=' ')
if c:
	print(c, end=' ')
if d:
	print(d)


import sys
from collections import Counter
sys.setrecursionlimit(10 ** 7)
mo = 10 ** 9 + 7
n = 10 ** 5
x = []
for i in input().split():
	x.append(int(i))
x.sort()
m = x[3]
a = []
for i in range(3):
	a.append(m - x[i])
print(*a)


number = list(map(int, input().strip().split(' ')))
number.sort()
for i in range(0, 3):
	(print(number[3] - number[i], end=' '),)
print()


(a, b, c, d) = [int(x) for x in input().split()]
print(' '.join([str(max(a, b, c, d) - i) for i in [a, b, c, d] if max(a, b, c, d) - i > 0]))


t = sorted(list(map(int, input().split())))
print(t[-1] - t[0], t[-1] - t[1], t[-1] - t[2])


a = list(map(int, input().split()))
x = max(a)
a.remove(x)
for i in a:
	print(x - i)


l = list(map(int, input().split()))
l1 = sorted(l, reverse=True)
for i in range(1, len(l)):
	print(abs(l1[0] - l1[i]), end=' ')


nums = list(map(int, input().split()))
soma = nums.pop(nums.index(max(nums)))
print(soma - nums[0], soma - nums[1], soma - nums[2])


import sys
input = sys.stdin.readline

def main():
	(x, y, z, t) = map(int, input().split())
	(x, y, z, t) = sorted([x, y, z, t])
	print(t - x, t - y, t - z)
main()


n = input()
l = n.split(' ')
for i in range(len(l)):
	l[i] = int(l[i])
	i = +1
m = max(l)
for i in l:
	if m - i != 0:
		print(m - i)


L = list(map(int, input().split()))
L.sort()
print(L[3] - L[2], L[3] - L[1], L[3] - L[0])


a = []
k = 0
a = list(map(int, input().split()))
k = max(a)
for i in a:
	if i != k:
		print(k - i, end=' ')


l = list(map(int, input().split(' ')))
x = max(l)
l.remove(x)
for i in range(len(l)):
	print(x - l[i], end=' ')


getInput = input()
inputList = getInput.split()
secondList = [int(item) for item in inputList]
total = max(secondList)
lastList = [total - item for item in secondList if total - item != 0]
lastList.reverse()
(a, b, c) = lastList
print(a, b, c)


inputs = list(map(int, input().split()))
iputs = inputs.sort()
print(inputs[3] - inputs[0], inputs[3] - inputs[1], inputs[3] - inputs[2])


chisla = list(map(int, input().split()))
maxx = 0
i = 0
minn = chisla[i]
z = 0
for i in range(len(chisla)):
	if maxx < chisla[i]:
		maxx = chisla[i]
	if minn > chisla[i]:
		minn = chisla[i]
for i in range(len(chisla)):
	if minn != chisla[i] and maxx != chisla[i]:
		z = chisla[i]
		break
if z == 0:
	z = minn
c = maxx - minn
b = z - c
a = maxx - c - b
print(a, b, c)


k = list(map(int, input().strip().split()[:4]))
m = max(k)
k.remove(m)
print(m - k[0], m - k[1], m - k[2])


str = input().split(' ')
a1 = int(str[0])
a2 = int(str[1])
a3 = int(str[2])
a4 = int(str[3])
t = a1 + a2 + a3 + a4
p = t / 3
if a1 != p:
	print(int(p - a1))
if a2 != p:
	print(int(p - a2))
if a3 != p:
	print(int(p - a3))
if a4 != p:
	print(int(p - a4))


a = input()
a = a.split(' ')
lst = []
for i in a:
	if i:
		lst.append(int(i))
lst = sorted(lst)
abc = lst[3]
ab = lst[0]
ac = lst[1]
bc = lst[2]
a = abc - bc
b = abc - ac
c = abc - ab
print(a, b, c)


l = list(map(int, input().split()))
abc = max(l)
l.remove(max(l))
ab = l[0]
ac = l[1]
bc = l[2]
print(str(ab + ac - abc) + ' ' + str(bc + ab - abc) + ' ' + str(ac + bc - abc))


list1 = []
list1 = list(map(int, input().split()))
val = list1[0]
for x in range(4):
	if list1[x] > val:
		val = list1[x]
for x in range(4):
	if val - list1[x] != 0:
		print(val - list1[x], end=' ')


l = list(map(int, input().split()))
m = max(l)
res = []
for i in l:
	if i != m:
		res.append(m - i)
print(' '.join(map(str, res)))


li = [int(i) for i in input().split()]
z = sum(li) // 3
li.remove(z)
for i in li:
	print(abs(z - i), end=' ')


(x1, x2, x3, x4) = map(int, input().split())
three_sum = (x1 + x2 + x3 + x4) // 3
if three_sum == x1:
	print(three_sum - x2, three_sum - x3, three_sum - x4)
elif three_sum == x2:
	print(three_sum - x1, three_sum - x3, three_sum - x4)
elif three_sum == x3:
	print(three_sum - x1, three_sum - x2, three_sum - x4)
elif three_sum == x4:
	print(three_sum - x1, three_sum - x2, three_sum - x3)


nums = [int(x) for x in input().split()]
nums.sort()
abc = max(nums)
(ab, bc, ac) = nums[:3]
a = abc - bc
b = abc - ac
c = abc - ab
print(a, b, c)


ll = lambda : list(map(int, input().split()))
l = ll()
abc = max(l)
res = []
for i in l:
	if i is abc:
		continue
	else:
		res.append(abc - i)
print(*res)


output = ''
eq_list = input().split()
for num in range(len(eq_list)):
	eq_list[num] = int(eq_list[num])
eq_list.sort()
sum_nums = eq_list.pop(-1)
for each_sum in eq_list:
	a = int(sum_nums) - int(each_sum)
	output += str(a) + ' '
print(output.strip())


(l, m, n, o) = map(int, input().split())
lis = [l, m, n, o]
lis = sorted(lis)
a = lis[3] - lis[0]
b = lis[3] - lis[1]
c = lis[3] - lis[2]
print(a, b, c)


x = input().split()
for i in range(len(x)):
	x[i] = int(x[i])
x.sort()
a = x[-1] - x[-2]
b = x[-1] - x[1]
c = x[-1] - (a + b)
print(a, b, c)


from sys import stdin
(a, b, c, d) = map(int, stdin.readline().strip().split())
s = [a, b, c, d]
s.sort()
mx = s[-1]
for i in range(3):
	print(mx - s[i], end=' ')


X = list(map(int, input().split()))
X.sort()
print(str(X[-1] - X[0]) + ' ' + str(X[-1] - X[1]) + ' ' + str(X[-1] - X[2]))


list1 = list(map(int, input().strip().split(' ')))
list1 = sorted(list1)
print('{} {} {}'.format(list1[3] - list1[0], list1[3] - list1[1], list1[3] - list1[2]))


inp = sorted(list(map(int, input().strip().split())))
(x1, x2, x3, x4) = (inp[0], inp[1], inp[2], inp[3])
print(x4 - x1, x4 - x2, x4 - x3)


n = [int(x) for x in input().split()]
n.sort()
abc = n[3]
a = abc - n[0]
b = abc - n[1]
c = abc - n[2]
print(a, b, c)


l = list(map(int, input().split()))
ans = []
v = max(l)
for i in range(0, 4):
	if l[i] != v:
		ans.append(v - l[i])
for i in range(0, 3):
	print(ans[i], end=' ')


l = list(map(int, input().split()))
s = (l[0] + l[1] + l[2] + l[3]) // 3
l.remove(max(l))
a = (l[0] + l[1] - l[2]) // 2
b = l[0] - a
c = l[1] - a
print(a, end=' ')
print(b, end=' ')
print(c, end=' ')


t = [int(x) for x in input().split()]
x = max(t)
for i in t:
	if x - i > 0:
		print(x - i, end=' ')


a = [int(i) for i in input().split()]
max = -1
for j in range(1, len(a)):
	key = a[j]
	i = j - 1
	while i >= 0 and a[i] < key:
		a[i + 1] = a[i]
		i = i - 1
	a[i + 1] = key
ans1 = a[0] - a[1]
ans2 = a[0] - a[2]
ans3 = a[0] - a[3]
print(ans1, ans2, ans3)


def restore(x):
	x.sort()
	print(x[3] - x[2], x[3] - x[1], x[3] - x[0])
x = [int(i) for i in input().split()]
restore(x)


nums = list(map(int, input().split()))
maxNum = max(nums)
nums.remove(maxNum)
ans = []
for num in nums:
	ans.append(maxNum - num)
print(' '.join(map(str, ans)))


list1 = list(map(int, input().split()))
y = max(list1)
list2 = []
for i in list1:
	list2.append(y - i)
list2.sort()
print(*list2[1:])


a = [int(i) for i in input().split()]
a.sort()
for i in range(3):
	print(a[3] - a[i])


import sys
a = list(map(int, input().split()))
a.sort()
(x, y, z, w) = a
print((x + z - y) // 2, (x + y - z) // 2, (y + z - x) // 2)


num = input().split()
new_num = []
for i in num:
	new_num = new_num + [int(i)]
a_b_c = max(new_num)
new_num.remove(a_b_c)
x1 = a_b_c - new_num[0]
x2 = a_b_c - new_num[1]
x3 = a_b_c - new_num[2]
print(x1, x2, x3)


ls = list(map(int, input().split()))
ls.sort()
print(int(ls[3]) - int(ls[0]))
print(int(ls[3]) - int(ls[1]))
print(int(ls[3]) - int(ls[2]))


a = sorted(list(map(int, input().split())))
print(*[a[3] - a[i] for i in range(3)])


s = list(map(int, input().split()))
m = max(s)
for i in range(4):
	if s[i] != m:
		print(m - s[i], end=' ')


i = 0
nums = input()
arr = nums.split()
while i < 4:
	arr[i] = int(arr[i])
	i += 1
arr.sort(reverse=True)
a = arr[0] - arr[1]
b = arr[0] - arr[2]
c = arr[0] - arr[3]
print(a, b, c)


a = list(map(int, input().split()))
a.remove(sum(a) // 3)
x1 = a[0]
x2 = a[1]
x3 = a[2]
print((x1 + x2 - x3) // 2, (x2 + x3 - x1) // 2, (x3 + x1 - x2) // 2)


import sys
data = [int(x) for x in sys.stdin.readlines()[0].split()]
total = max(data)
data.remove(total)
a = total - data[0]
b = total - data[1]
c = total - data[2]
sys.stdout.write('{} {} {}'.format(a, b, c))


(a, b, c, e) = input().split()
q = [int(a), int(b), int(c), int(e)]
q.sort()
s = int(q[3]) - int(q[2])
d = int(q[3]) - int(q[1])
f = int(q[3]) - int(q[0])
print(s, d, f)


l = [int(l) for l in input().split()]
l.sort()
for i in range(3):
	print(l[3] - l[i], end=' ')


n = input().split()
lst = list()
for i in n:
	lst.append(int(i))
num = ''
m = max(lst)
idx = lst.index(m)
for i in range(len(n)):
	if i != idx:
		num = num + ' ' + str(m - lst[i])
print(num[1:])


l = list(map(int, input().split()))
m = max(l)
i = l.index(m)
l1 = []
for x in range(4):
	if x == i:
		continue
	l1.append(m - l[x])
print(*l1)


(s, o, n, l) = list(map(int, input().split()))
i = []
i.append(s)
i.append(o)
i.append(n)
i.append(l)
i.sort()
print(i[3] - i[2], i[3] - i[1], i[3] - i[0])


l = list(map(int, input().split()))
l.sort()
a = l[0]
b = l[1]
c = l[2]
s = l[3]
a1 = abs(s - c)
b1 = abs(s - b)
c1 = abs(s - a)
print(str(a1) + ' ' + str(b1) + ' ' + str(c1))


def main(lst):
	ans = []
	maxx = max(lst)
	val = None
	for i in lst:
		if i != maxx:
			ans.append(maxx - i)
		else:
			val = i
	for i in range(3 - len(ans)):
		ans.append(maxx - lst[val])
	return ans
lst = [int(x) for x in input().split()]
[print(x, end=' ') for x in main(lst)]


t = 1
arr = [0] * 4
arr = list(map(int, input().split()))
arr.sort()
a = arr[3] - arr[0]
b = arr[3] - arr[1]
c = arr[3] - arr[2]
print(a, b, c)


(x1, x2, x3, x4) = map(int, input().split())
x = [x1, x2, x3, x4]
X = max(x1, x2, x3, x4)
ans = []
stop = 0
for i in range(4):
	if x[i] != X and stop == 0:
		ans.append(X - x[i])
for elem in ans[:-1]:
	print(elem, end=' ')
print(ans[-1])


from bisect import bisect_right as br
from bisect import bisect_left as bl
from collections import *
from itertools import *
import functools
import sys
import math
import random
import re
MAX = sys.maxsize
MAXN = 10 ** 5 + 10
MOD = 10 ** 9 + 9

def isprime(n):
	n = abs(int(n))
	if n < 2:
		return False
	if n == 2:
		return True
	if not n & 1:
		return False
	for x in range(3, int(n ** 0.5) + 1, 2):
		if n % x == 0:
			return False
	return True

def mhd(a, b, x, y):
	return abs(a - x) + abs(b - y)

def numIN(x=' '):
	return map(int, sys.stdin.readline().strip().split(x))

def charIN(x=' '):
	return sys.stdin.readline().strip().split(x)

def dis(x, y):
	a = y[0] - x[0]
	b = x[1] - y[1]
	return (a * a + b * b) ** 0.5

def lgcd(a):
	g = a[0]
	for i in range(1, len(a)):
		g = math.gcd(g, a[i])
	return g

def ms(a):
	msf = -MAX
	meh = 0
	for i in range(len(a)):
		meh += a[i]
		if msf < meh:
			msf = meh
		if meh < 0:
			meh = 0
	return msf

def res(ans, t):
	print('Case #{}: {}'.format(t, ans))
l = list(numIN())
l.sort()
if l[0] == l[-1]:
	x = l[0] // 3
	print(x, x, x)
else:
	print(l[-1] - l[-2], l[-1] - l[-3], l[-1] - l[0])


a = input().split()
b = []
c = []
res = ''
for i in range(len(a)):
	b.append(int(a[i]))
for j in range(len(b)):
	c.append(max(b) - b[j])
c.remove(0)
for i in c:
	res = res + ' ' + str(i)
print(res[1:])


(a, b, c, d) = input().split()
arr = [int(a), int(b), int(c), int(d)]
arr.sort()
print(arr[3] - arr[2], arr[3] - arr[1], arr[3] - arr[0])


num = list(map(lambda x: int(x), input().split()))
num.sort()
m = num[-1]
for n in num[:-1]:
	print(str(m - n) + ' ', end='')


l = list(map(int, input().split()))
ma = 0
for i in range(4):
	if l[i] > ma:
		ma = l[i]
for i in range(4):
	if ma - l[i] > 0:
		print(ma - l[i])


st = input()
li = list(st.split(' '))
li = list(map(int, li))
myMax = max(li)
for i in li:
	if myMax - int(i) != 0:
		print(myMax - int(i), end=' ')


list1 = list(map(int, input().split(' ')))
list1.sort()
list1.reverse()
a = list1[0] - list1[1]
b = list1[0] - list1[2]
c = list1[0] - list1[3]
print(str(a) + ' ' + str(b) + ' ' + str(c))


r = [0] * 4
(r[0], r[1], r[2], r[3]) = input().split()
for i in range(4):
	r[i] = int(r[i])
for i in range(4):
	if r[i] != max(r):
		print(max(r) - r[i], end=' ')


(a, b, c, d) = input().split()
a = int(a)
b = int(b)
c = int(c)
d = int(d)
e = a + b + c + d
e = e // 3
if e - d > 0:
	print(e - d)
if e - c > 0:
	print(e - c)
if e - b > 0:
	print(e - b)
if e - a > 0:
	print(e - a)


x = input().split()
x = list(map(int, x))
x.sort()
a = x[3] - x[0]
b = x[3] - x[1]
c = x[3] - x[2]
print(str(a) + ' ' + str(b) + ' ' + str(c))


s = input()
s = s.split(' ')
s = list(map(int, s))
s.sort(reverse=True)
(su, a_b, b_c, a_c) = (s[0], s[1], s[2], s[3])
a = su - b_c
b = su - a_c
c = su - a - b
print(a, b, c)


w = [int(i) for i in input().split()]
w.sort()
last = len(w) - 1
c = w[last] - w[0]
a = w[last - 1] - c
b = w[0] - a
print(f'{a} {b} {c}')


(x1, x2, x3, x4) = map(int, input().split())
x = (x1 + x2 + x3 + x4) // 3
a = x - x2
b = x - x3
c = x - x1
d = x - x4
if a != 0:
	print(a)
if b != 0:
	print(b)
if c != 0:
	print(c)
if d != 0:
	print(d)


h = list(map(int, input().split()))
h = sorted(h)
suma = h[-1]
s1 = suma - h[0]
s2 = suma - h[1]
s3 = suma - h[2]
print(s1, s2, s3)


args = input().split(' ')
for i in range(0, len(args)):
	args[i] = int(args[i])
abc = max(args)
args.pop(args.index(abc))
a = abc - args[0]
b = abc - args[1]
c = abc - args[2]
print(str(a) + ' ' + str(b) + ' ' + str(c))


arr = list(map(int, input().split()))
arr.sort(reverse=True)
ans = []
for i in range(1, 4):
	ans.append(arr[0] - arr[i])
print(*ans)


arr = list(map(int, input().strip().split()))
array = sorted(arr, reverse=True)
a = array[0]
b = array[1]
c = array[2]
d = array[3]
val1 = a - b
val2 = a - c
val3 = a - d
print(str(val1) + ' ' + str(val2) + ' ' + str(val3))


(x, y, z, u) = [int(i) for i in input().split()]
d = max(x, y, z, u)
if d - x != 0:
	print(d - x, end=' ')
if d - y != 0:
	print(d - y, end=' ')
if d - z != 0:
	print(d - z, end=' ')
if d - u != 0:
	print(d - u, end=' ')


list_of_vals = input().split()
list_of_vals[0] = int(list_of_vals[0])
list_of_vals[1] = int(list_of_vals[1])
list_of_vals[2] = int(list_of_vals[2])
list_of_vals[3] = int(list_of_vals[3])
sorted_list = sorted(list_of_vals)
x1 = int(sorted_list[0])
x2 = int(sorted_list[1])
x3 = int(sorted_list[2])
x4 = int(sorted_list[3])
for i in range(6):
	a = x1 + x2 - x4
	b = x1 + x3 - x4
	c = x2 + x3 - x4
print(a, b, c)


x = [int(y) for y in input().split()]
k = max(x)
lst = []
for j in x:
	if j != k:
		lst.append(k - j)
print(*lst, sep=' ')


s = input().split()
s = [int(x) for x in s]
s.sort()
maxNumber = s[len(s) - 1]
c = maxNumber - s[0]
b = maxNumber - s[1]
a = maxNumber - s[2]
print(a, b, c)


import sys, math, queue
sys.setrecursionlimit(1000000)
MOD = 10 ** 9 + 7
x = list(map(int, input().split()))
x.sort()
(a, b, c, d) = x
print(d - a, d - b, d - c)


ns = input().split()
for i in range(len(ns)):
	ns[i] = int(ns[i])
uc = max(ns)
del ns[ns.index(uc)]
print(f'{uc - ns[0]} {uc - ns[2]} {uc - ns[1]}')


inputs = [int(i) for i in input().split(' ')]
inputs = sorted(inputs)
aplusbplusc = inputs[-1]
aplusb = inputs[0]
bplusc = inputs[1]
aplusc = inputs[2]
print(aplusbplusc - bplusc, aplusbplusc - aplusc, aplusbplusc - aplusb)


x = input().split()
for i in range(len(x)):
	x[i] = int(x[i])
x.sort()
print(x[3] - x[0], x[3] - x[1], x[3] - x[2])


numbers = [int(i) for i in input().split(' ')]
abc = max(numbers)
numbers.remove(abc)
a = abc - numbers[0]
del numbers[0]
b = abc - numbers[0]
del numbers[0]
c = abc - numbers[0]
del numbers[0]
print(a, b, c)


(w, x, y, z) = map(int, input().split())
l = [w, x, y, z]
m = max(l)
l.remove(m)
res = [m - el for el in l]
print(*res)


def solve():
	m = [int(s) for s in input().split()]
	mm = max(m)
	for i in range(len(m)):
		if m[i] == mm:
			pass
		else:
			print(mm - m[i])
solve()


from math import *

def main():
	x = sorted(list(map(int, input().split())))
	a = x[-1] - x[0]
	b = x[-1] - x[1]
	c = x[-1] - x[2]
	print(a, b, c)
main()


(q, w, e, r) = map(int, input().split())
s = max(q, w, e, r)
print(*[s - x for x in [q, w, e, r] if x != s])


a = list(map(int, input().split()))
x = max(a)
a.remove(max(a))
y = x - max(a)
print(x - max(a), end=' ')
y = min(a) - y
print(y, end=' ')
a.remove(min(a))
print(max(a) - y)


ar = list(map(int, input().split()))
ar.sort()
print(ar[3] - ar[0], ar[3] - ar[1], ar[3] - ar[2])


values = map(int, input().split())
sort_values = sorted(values)
a: int = sort_values[-1] - sort_values[0]
b: int = sort_values[-1] - sort_values[1]
c: int = sort_values[-1] - sort_values[2]
print(a, b, c)


a = [int(j) for j in input().split(' ')]
list1 = []
num = []
for i in a:
	list1.append(i)
max = max(list1)
list1.remove(max)
for i in list1:
	new = max - i
	num.append(new)
for i in num:
	print(i, end=' ')


l = [int(x) for x in input().split()]
m = max(l)
l.remove(m)
for i in range(len(l)):
	print(m - l[i], end=' ')


l = list(map(int, input().split()))
k = max(l)
for i in l:
	if i != k:
		print(k - i, end=' ')


import itertools
import math
import sys
import heapq
from collections import Counter
from collections import deque
from fractions import gcd
from functools import reduce
sys.setrecursionlimit(4100000)
INF = 1 << 60
MOD = 10 ** 9 + 7
x = sorted(map(int, input().split()))
print(x[3] - x[0], x[3] - x[1], x[3] - x[2])


nums = [int(s) for s in input().split()]
nums.sort()
print(nums[3] - nums[2], nums[3] - nums[1], nums[3] - nums[0])


(x1, x2, x3, x4) = map(int, input().split())
abc = max(x1, x2, x3, x4)
x = [x1, x2, x3, x4]
x.pop(x.index(max(x1, x2, x3, x4)))
print(abc - x[0])
print(abc - x[1])
print(abc - x[2])


A = list(map(int, input().split()))
A.sort()
abc = A[-1]
print(' '.join([str(abc - x) for x in A[:-1]]))


def arr_inp():
	return [int(x) for x in input().split()]
a = arr_inp()
a.sort()
for i in a[:3]:
	print(a[3] - i, end=' ')


(a, b, c, d) = map(int, input().split())
myList = [a, b, c, d]
myList.sort()
a = myList[0]
b = myList[1]
c = myList[2]
d = myList[3]
print(d - a, d - b, d - c)


a = [int(s) for s in input().split()]
max_num = a[0]
ind = 0
for i in range(len(a)):
	if a[i] > max_num:
		max_num = a[i]
		ind = i
del a[ind]
print(max_num - a[0], max_num - a[1], max_num - a[2])


def solve(a, b, c, d):
	allValue = [a, b, c, d]
	totalSum = max(allValue)
	solution = []
	for i in allValue:
		if totalSum - i == 0:
			continue
		else:
			solution.append(totalSum - i)
	return solution
(a, b, c, d) = [int(s) for s in input().split()]
s = solve(a, b, c, d)
for i in s:
	print(i)


x = sorted([int(x) for x in input().split()])
suma = x[-1]
print('%d %d %d' % (suma - x[0], suma - x[1], suma - x[2]))


from sys import stdin, stdout
L = [x1, x2, x3, x4] = [int(x) for x in stdin.readline().split()]
L.sort()
stdout.write(str(L[-1] - L[0]) + ' ' + str(L[-1] - L[1]) + ' ' + str(L[-1] - L[2]) + '\n')


x = list(map(int, input().strip().split()))[:4]
x = sorted(x)
a = x[3] - x[2]
b = x[3] - x[1]
c = x[3] - x[0]
print(a, b, c)


x = list(map(int, input().split()))
maxi = x[0]
for i in range(0, len(x)):
	if x[i] > maxi:
		maxi = x[i]
k = maxi
x.remove(k)
for j in range(0, len(x)):
	print(k - x[j], end=' ')


def solution():
	beta_list = [int(item) for item in input().split()]
	(a_b, b_c, c_a, a_b_c) = sorted(beta_list)
	a = a_b_c - b_c
	b = a_b - a
	c = c_a - a
	print(a, b, c)
solution()


def main():
	(a, b, c, d) = sorted(map(int, input().split()))
	print(d - a, d - b, d - c)
	return 0
main()


import math as math
(x1, x2, x3, x4) = input().split()
x1 = int(x1)
x2 = int(x2)
x3 = int(x3)
x4 = int(x4)
table = [4]
table = [x1, x2, x3, x4]
table.sort()
guess1 = math.fabs(table[3] - table[0])
guess2 = math.fabs(table[3] - table[1])
guess3 = math.fabs(table[3] - table[2])
print(int(guess1), int(guess2), int(guess3))


k = input()
k = k.split()
for i in range(4):
	k[i] = int(k[i])
k.sort()
a = k[3] - k[2]
b = k[1] - a
c = k[2] - b
print(a, b, c)


(x, y, z, d) = sorted(list(map(int, input().split())))
a = (x + y - z) // 2
b = x - a
c = d - (a + b)
print(abs(a), abs(b), abs(c))


values = list(map(int, input().split(' ')))
sorted_val = sorted(values, reverse=True)
b = (sorted_val[1] + sorted_val[2] - sorted_val[3]) / 2
a = sorted_val[1] - b
c = sorted_val[2] - b
print(int(a), int(b), int(c))


a = []
a = list(map(int, input().split()))
m = max(a)
for i in a:
	if m - i > 0:
		print(m - i)


(ab, ac, bc, abc) = map(int, input().split())
maxx = (ab + ac + bc + abc) // 3
if maxx - ab != 0:
	print(maxx - ab, end=' ')
if maxx - ac != 0:
	print(maxx - ac, end=' ')
if maxx - bc != 0:
	print(maxx - bc, end=' ')
if maxx - abc != 0:
	print(maxx - abc, end=' ')


arr = sorted(list(map(int, input().split())))
x = arr[3] - arr[2]
y = arr[3] - arr[1]
z = arr[3] - arr[0]
print(x, y, z)


class Main:
	sums = []
	x = input().split(' ')
	for i in x:
		sums.append(int(i))
	triple = max(sums)
	sums.remove(triple)
	print(triple - sums[0], triple - sums[1], triple - sums[2])
Main()


nums = sorted(list(map(int, input().split())))[:-1]
res = []
res.append(str((nums[0] - nums[1] + nums[2]) // 2))
res.append(str((nums[0] + nums[1] - nums[2]) // 2))
res.append(str((-nums[0] + nums[1] + nums[2]) // 2))
print(' '.join(res))


lst = list(map(int, input().split()))
lst.sort()
for i in lst[:3]:
	print(lst[3] - i, end=' ')


(x1, x2, x3, x4) = map(int, input().split())
z = max(x1, x2, x3, x4)
c = z - x1
b = z - x2
a = z - x3
d = z - x4
l = []
if a > 0:
	l.append(a)
if b > 0:
	l.append(b)
if c > 0:
	l.append(c)
if d > 0:
	l.append(d)
for i in l:
	print(i, end=' ')


a = list(map(int, input().split()))
l1 = sorted(a)
print(l1[3] - l1[0], l1[3] - l1[1], l1[3] - l1[2])


data = input().split()
data_int = []
for i in data:
	data_int.append(int(i))
data_int.sort()
x1 = data_int[3] - data_int[2]
x2 = data_int[3] - data_int[1]
x3 = data_int[3] - data_int[0]
print(str(x1) + ' ' + str(x2) + ' ' + str(x3))


X = [int(x) for x in input().split()]
X.sort()
print(X[-1] - X[-2], X[-1] - X[-3], X[-1] - X[-4])


l = [int(i) for i in input().split()]
k = max(l)
l.remove(k)
for i in range(len(l)):
	print(k - l[i], end=' ')


numbers = input().split()
abc = []
for i in range(len(numbers)):
	numbers[i] = int(numbers[i])
maior = numbers[0]
for i in range(len(numbers)):
	if maior < numbers[i]:
		maior = numbers[i]
for i in range(len(numbers)):
	if numbers[i] != maior:
		abc.append(numbers[i])
abc[0] = maior - abc[0]
abc[1] = abc[1] - abc[0]
abc[2] = abc[2] - abc[0]
for i in abc:
	print(i, end=' ')


four_numbers = list(map(int, input().split()))
four_numbers.sort()
print(four_numbers[0] + four_numbers[1] - four_numbers[3], four_numbers[0] + four_numbers[2] - four_numbers[3], four_numbers[1] + four_numbers[2] - four_numbers[3])


def main():
	l = [int(x) for x in input().split()]
	l.sort()
	for i in range(0, len(l) - 1):
		print(abs(l[i] - l[3]), end=' ')
main()


l = list(map(int, input().split()))
if l[0] == l[1] == l[2]:
	print(l[3] - l[1], l[3] - l[1], l[3] - l[1])
else:
	a = max(l)
	l.remove(a)
	print(a - l[0], a - l[1], a - l[2])


(s, t, u, v) = map(int, input().split())
d = []
a = 0
b = 0
c = 0
x = []
d.append(s)
d.append(t)
d.append(u)
d.append(v)
x = sorted(d)
for i in range(4):
	a = x[3] - x[2]
	b = x[3] - x[1]
	c = x[3] - x[0]
print(a, b, c)


l = list(map(int, input().split()))
m = max(l)
for x in l:
	if x != m:
		print(m - x, end=' ')
print()


nums = sorted([int(x) for x in input().split(' ')])
totalSum = nums[-1]
for num in nums[:-1]:
	print(totalSum - num, end=' ')
print()


s = list(map(int, input().split()))
m = max(s)
for item in s:
	if item != m:
		print(m - item, end=' ')


a = [int(x) for x in input().split()]
a.sort(reverse=True)
print(a[0] - a[1], a[0] - a[2], a[0] - a[3])


l = []
(a, b, c, d) = input().split()
a = int(a)
b = int(b)
c = int(c)
d = int(d)
l.append(a)
l.append(b)
l.append(c)
l.append(d)
z = max(l)
l.remove(z)
for i in l:
	print(z - i, end=' ')


a1 = [int(x) for x in input().split(' ')]
d = max(a1)
a1.remove(d)
a1.sort()
c = d - a1[0]
b = a1[1] - c
a = a1[2] - c
print(a, end=' ')
print(b, end=' ')
print(c)


(a, b, c, m) = sorted(map(int, input().split()))
print(m - a, m - b, m - c)


import sys
from sys import stdin, stdout
import bisect
from bisect import bisect_left as bl
from bisect import bisect_right as br
import itertools
import collections
import math
import heapq

def modinv(n, p):
	return pow(n, p - 2, p)

def cin():
	return map(int, sin().split())

def ain():
	return list(map(int, sin().split()))

def sin():
	return input()

def inin():
	return int(input())

def Divisors(n):
	l = []
	for i in range(1, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n // i == i:
				l.append(i)
			else:
				l.append(i)
				l.append(n // i)
	return l

def most_frequent(list):
	return max(set(list), key=list.count)

def GCD(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def ncr(n, r, p):
	t = fact[n] * (ifact[r] * ifact[n - r] % p) % p
	return t

def Convert(string):
	li = list(string.split(''))
	return li

def SieveOfEratosthenes(n):
	global prime
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	f = []
	for p in range(2, n):
		if prime[p]:
			f.append(p)
	return f
prime = []
q = []

def dfs(n, d, v, c):
	global q
	v[n] = 1
	x = d[n]
	q.append(n)
	j = c
	for i in x:
		if i not in v:
			f = dfs(i, d, v, c + 1)
			j = max(j, f)
	return j

def main():
	a = ain()
	k = max(a)
	a.remove(k)
	for _ in range(len(a)):
		temp = k - a[_]
		print(temp, end=' ')
py2 = round(0.5)
if py2:
	from future_builtins import ascii, filter, hex, map, oct, zip
	range = xrange
import os, sys
from io import IOBase, BytesIO
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.getvalue())
			(self.truncate(0), self.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		if py2:
			self.write = self.buffer.write
			self.read = self.buffer.read
			self.readline = self.buffer.readline
		else:
			self.write = lambda s: self.buffer.write(s.encode('ascii'))
			self.read = lambda : self.buffer.read().decode('ascii')
			self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


def max(a, b, c, d):
	if a > b and a > d and (a > c):
		return (b, c, d, a)
	elif b > d and b > c:
		return (a, c, d, b)
	elif c > d:
		return (a, b, d, c)
	else:
		return (a, b, c, d)
(a, b, c, d) = map(int, input().split())
(a, b, c, d) = max(a, b, c, d)
print(d - a, d - b, d - c)


import math
import cmath
from decimal import *
from fractions import *
l = list(map(int, input().split()))
for x in l:
	if max(l) - x != 0:
		print(max(l) - x, end=' ')


(s1, s2, s3, s4) = sorted(list(map(int, input().split())))
a = s4 - s3
b = s4 - s2
c = s4 - s1
print(a, b, c)


n = list(map(int, input().split()))
maxi = max(n)
m = []
for i in n:
	if i != maxi:
		tmp = maxi - i
		m.append(tmp)
for i in m:
	print(i, end=' ')


from sys import stdin
l = sorted(list(map(int, stdin.readline().split())))
a = (l[2] + l[1] - l[0]) // 2
b = l[2] - a
c = l[0] - b
print(a, b, c)


import sys
x = list(map(int, sys.stdin.readline().strip().split()))
s = max(x)
ans = ''
for i in x:
	if i != s:
		ans = ans + str(s - i) + ' '
print(ans.strip())


arr = list(map(int, input().rstrip().split()))
arr.sort(reverse=True)
d = arr[0]
a = d - arr[1]
b = d - arr[2]
c = d - arr[3]
print(b)
print(a)
print(c)


lis = list(map(int, input().split()))
lis.sort()
ans = []
a = lis[-1] - lis[-2]
ans.append(a)
lis.pop(-1)
lis.pop(-1)
for i in lis:
	ans.append(i - a)
ans = list(map(str, ans))
ans = ' '.join(ans)
print(ans)


x = list(map(int, input().split()))
maxx = max(x)
s = sum(x)
for i in range(4):
	if x[i] != maxx:
		ans = s - 2 * maxx - x[i]
		print(ans, end=' ')


arr = [int(x) for x in input().split(' ')]
maxSum = max(arr)
nums = []
for i in arr:
	if maxSum - i != 0:
		nums.append(maxSum - i)
print(*nums, sep=' ')


a = list(map(int, input().strip().split(' ')))
b = max(a)
a.remove(b)
for i in a:
	print(b - i, end=' ')


N = input()
number = [int(x) for x in N.split()]
number.sort()
a = 0
b = 0
c = 0
a = number[3] - number[0]
b = number[3] - number[1]
c = number[3] - number[2]
print(str(a) + ' ' + str(b) + ' ' + str(c))


input_string = input()
userList = input_string.split()
results = list(map(int, userList))
results.sort()
a = results[3] - results[0]
b = results[2] - a
c = results[1] - a
print(str(a) + ' ' + str(b) + ' ' + str(c))


numbers = map(int, input().split(' '))
(a, b, c, d) = sorted(numbers)
print(f'{d - a} {d - b} {d - c}')


x = [int(x) for x in input().split()]
s = ''
for i in range(4):
	if x[i] == max(x):
		continue
	else:
		s = s + str(max(x) - x[i]) + ' '
print(s)


array = [int(number) for number in input().split()]
whole = max(array)
for number in array:
	if number != whole:
		print(whole - number, end=' ')


a = list(map(int, input().split()))
a.sort()
b = []
b.append(a[3] - a[0])
b.append(a[3] - a[1])
b.append(a[3] - a[2])
b.sort()
print('{} {} {}'.format(b[0], b[1], b[2]))


q = arr = list(map(int, input().rstrip().split()))
q.sort(reverse=True)
a = q[0]
b = q[1]
c = q[2]
d = q[3]
r1 = a - d
r2 = b - r1
r3 = c - r1
print(r1, r2, r3)


Xs = list(map(int, input().split()))
Sum = max(Xs)
Xs.remove(Sum)
print(Sum - Xs[0], Sum - Xs[1], Sum - Xs[2])


num = [int(i) for i in input().split()]
sum = num[0] + num[1] + num[2] + num[3]
ThreeSum = sum // 3
num.remove(ThreeSum)
a = ThreeSum - num[2]
b = num[1] - a
c = num[0] - a
s = str(a) + ' ' + str(b) + ' ' + str(c)
print(s)


nums = list(map(int, input().split()))
nums.sort()
result = []
for num in reversed(nums[:-1]):
	result.append(str(nums[-1] - num))
print(' '.join(result))


(a, b, c, d) = [int(x) for x in input().split()]
import math
maxi = max(a, b, c, d)
if maxi == a:
	print(maxi - b, maxi - c, maxi - d)
elif maxi == b:
	print(maxi - a, maxi - c, maxi - d)
elif maxi == c:
	print(maxi - a, maxi - b, maxi - d)
else:
	print(maxi - a, maxi - b, maxi - c)


numbers = [int(i) for i in input().split()]
numbers.sort()
a = numbers[-1] - numbers[0]
b = numbers[-1] - numbers[1]
c = numbers[-1] - numbers[2]
print(b, c, a)


xs = [int(x) for x in input().split()]
a_b_c = max(xs)
print(*[a_b_c - x for x in xs if x != a_b_c])


(x1, x2, x3, x4) = map(int, input().split())
s1 = max(x1, x2, x3, x4)
for i in [x1, x2, x3, x4]:
	if i != s1:
		print(s1 - i, end=' ')


drt = list(map(int, input().split()))
d = max(drt)
drt.sort()
drt.remove(drt[-1])
p = []
for i in drt:
	p.append(str(d - i))
print(' '.join(p))


import sys
line1 = list(map(int, sys.stdin.readline().split()))

def restore(lst):
	lst = sorted(lst)
	(x, y, z, w) = (lst[0], lst[1], lst[2], lst[3])
	a = w - z
	b = w - y
	c = w - x
	print(str(a) + ' ' + str(b) + ' ' + str(c))
restore(line1)


n = [int(x) for x in input().split()]
n.sort(reverse=False)

def restorNum(N):
	x = 0
	y = int(N[0])
	a = int((x + y) / 2)
	for z in range(int(N[0] / 2) + 1):
		b = N[0] - a
		c = N[1] - a
		if b + c == N[2] and a + b + c == N[3]:
			return (a, b, c)
		if a + b + c < N[3]:
			t = n[3] - (a + b + c)
			a = a - t
		if a + b + c > N[3]:
			t = a + b + c - n[3]
			a = a + t
	return (a, b, c)
(a, b, c) = restorNum(n)
print(a, b, c)


from sys import exit as sys_return
number = sorted(list(map(int, input().split())))
really_first = number[3] - number[1]
really_second = number[3] - number[2]
really_third = number[3] - number[0]
print(really_first, really_second, really_third)


l = [int(x) for x in input().split()]
l.sort()
o = [0] * 4
o[3] = l[3]
o[2] = o[3] - l[2]
o[1] = o[3] - l[1]
o[0] = o[3] - l[0]
print(o[0], o[1], o[2])


ip = lambda : map(int, input().split())
l = list(ip())
l.sort()
(s, a, b, c) = l[::-1]
print(s - a, b - (s - a), c - (s - a))


def solution(nums):
	largest = 0
	for num in nums:
		if num > largest:
			largest = num
	result = ''
	for num in nums:
		if largest != num:
			result += str(largest - num) + ' '
	print(result)
solution([int(x) for x in input().split()])


l = list(map(int, input().split()))
m = l[0]
j = 0
for i in range(4):
	if l[i] > m:
		m = l[i]
		j = i
del l[j]
for i in range(3):
	print(m - l[i], end=' ')


inp = [int(x) for x in input().split()]
inp.sort()
(ab, ac, bc, abc) = inp
a = int(abc) - int(bc)
b = int(abc) - int(ac)
c = int(abc) - int(ab)
print(a, b, c)


a = sorted(list(map(int, input().split())))
print((a[0] + a[1] - a[2]) // 2, (a[2] + a[1] - a[0]) // 2, (a[0] + a[2] - a[1]) // 2)


a = list(map(int, input().split(' ')))
a.sort()
c = a[3] - a[0]
if a[1] != a[0]:
	b = a[1] - c
else:
	b = a[2] - c
a1 = a[0] - b
print(a1, b, c)


q = map(int, input().split()[:4])
q = list(q)
q = sorted(q)
a = q[3] - q[1]
a1 = q[3] - q[2]
a2 = q[3] - q[0]
print(a, a1, a2)


x = list(map(int, input().split()))
q = max(x)
s = 0
for i in range(0, 4):
	if x[i] != q:
		print(q - x[i], end=' ')


(a, b, c, s) = map(int, input().split())
sum1 = [a, b, c, s]
sum1.sort()
a = sum1[0] + sum1[1] - sum1[3]
b = sum1[1] + sum1[2] - sum1[3]
c = sum1[0] + sum1[2] - sum1[3]
print(a, b, c)


(a, b, c, d) = map(int, input().split())
x = max(a, b, c, d)
n1 = x - a
n2 = x - b
n3 = x - c
n4 = x - d
numbers = [n1, n2, n3, n4]
numbers.remove(0)
for i in numbers:
	print(i, end=' ')


def fun(array):
	abc = max(array)
	array.remove(abc)
	ab = array[0]
	bc = array[1]
	ac = array[2]
	c = abc - ab
	b = bc - c
	a = ac - c
	print(a, b, c)
array = list(map(int, input().split()))
fun(array)


nums = [int(i) for i in input().split()]
nums = sorted(nums)
result = [str(nums[3] - nums[i]) for i in range(3)]
print(' '.join(result))


arreglo = sorted(list(map(int, input().split())))
c = arreglo[3] - arreglo[0]
b = (arreglo[0] + arreglo[1] - arreglo[2]) / 2
a = arreglo[0] + arreglo[1] - 2 * b - c
print('{} {} {}'.format(int(a), int(b), c))


first_line = input()
first_line = first_line.split()
first_line = map(int, first_line)
first_line = sorted(first_line)
result = [int(max(first_line)) - int(first_line[x]) for x in range(len(first_line) - 1)]
print(str(result[0]) + ' ' + str(result[1]) + ' ' + str(result[2]))


(x1, x2, x3, x4) = map(int, input().split())
maxi = max(x1, x2, x3, x4)
u = maxi - x1
v = maxi - x2
w = maxi - x3
b = maxi - x4
if u != 0:
	print(u)
if v != 0:
	print(v)
if w != 0:
	print(w)
if b != 0:
	print(b)


arr = list(map(int, input().split()))
max_idx = 0
for i in range(len(arr)):
	if arr[max_idx] < arr[i]:
		max_idx = i
answer = []
for i in range(len(arr)):
	if i == max_idx:
		continue
	answer.append(arr[max_idx] - arr[i])
print(*answer)


a = [int(i) for i in input().split()]
x4 = max(a)
a.pop(a.index(x4))
print(x4 - a[2], x4 - a[1], x4 - a[0])


a = [int(i) for i in input().split()]
a.sort()
a1 = a[3] - a[0]
a2 = a[3] - a[1]
a3 = a[3] - a[2]
print(a3, a2, a1)


(n1, n2, n3, n4) = input().split(' ')
n1 = int(n1)
n2 = int(n2)
n3 = int(n3)
n4 = int(n4)
SortNum = (n1, n2, n3, n4)
numbers = sorted(SortNum)
print(numbers[3] - numbers[0], end=' ')
print(numbers[3] - numbers[1], end=' ')
print(numbers[3] - numbers[2], end=' ')


a = list(map(int, input().split()))
import math
a.sort()
print(a[3] - a[2], a[3] - a[1], a[3] - a[0])


nums = str(input())
nums = nums.split(' ')
for n in range(len(nums)):
	nums[n] = int(nums[n])
maxi = max(nums)
nums.remove(maxi)
b = []
for n in range(len(nums)):
	b.append(maxi - nums[n])
for n in range(len(nums)):
	b[n] = str(b[n])
print(' '.join(b))


l = list(map(int, input().split()))
l = sorted(l)
a = l[-1] - l[-2]
b = l[1] - a
c = l[2] - b
print(a, b, c)


inp = list(map(int, input().split()))
a = 0
num = 0
i = 0
for i in range(4):
	if a < inp[i]:
		a = inp[i]
		num = i
for j in range(4):
	if num == j:
		pass
	else:
		print(inp[num] - inp[j], end=' ')


list1 = list(map(int, input().split()))
x4 = max(list1)
list1.remove(x4)
a = x4 - list1[2]
b = x4 - list1[1]
c = x4 - list1[0]
print(a, b, c)


__author__ = '#miner'
a = list(map(int, input().split()))
a.sort()
for i in range(len(a) - 1):
	print(max(a) - a[i])


def input_nums():
	num_list = []
	num_list = [int(x) for x in input().split()]
	if len(num_list) != 4:
		input_nums()
	for i in num_list:
		if i < 2:
			input_nums()
	return num_list

def solve(num_list):
	num_list.sort(reverse=True)
	c = num_list[0] - num_list[1]
	b = num_list[2] - c
	a = num_list[3] - c
	print(a, b, c)
num_list = input_nums()
solve(num_list)


data = input()
ar = data.split()
ar = list(map(int, ar))
ar = sorted(ar)
a = 0
b = 0
c = 0
a = ar[3] - ar[0]
b = ar[3] - ar[2]
c = ar[3] - ar[1]
print(str(a) + ' ' + str(b) + ' ' + str(c))


k = list(map(int, input().split()))
k.sort()
print(k[3] - k[2], k[3] - k[1], k[3] - k[0])


def func(params):
	summation = max(params)
	params.remove(summation)
	print(summation - params[0], summation - params[1], summation - params[2])
params = list(map(int, input().split()))
func(params)


t = [int(f) for f in input().split()]
t.sort()
print(t[3] - t[2], t[3] - t[1], t[3] - t[0])


import sys
from itertools import islice
fin = sys.stdin
fout = sys.stdout
lines = (line.strip() for line in fin)
numbers = [int(num) for num in next(lines).split()]
num_sum = max(numbers)
numbers.remove(num_sum)
a = num_sum - numbers[0]
b = numbers[1] - a
c = numbers[2] - a
print(a, b, c, file=fout)


(x, y, z, k) = map(int, input().split())
num = sorted([x, y, z, k])
print(num[-1] - num[0], num[-1] - num[1], num[-1] - num[2])


nums = list(map(int, input().split()))
maxx = max(nums)
nums.remove(maxx)
(a, b, c) = nums
print(maxx - a, maxx - b, maxx - c)


def restoring(x):
	m = max(x)
	x.remove(m)
	output = [m - i for i in x]
	a = output[0]
	b = output[1]
	c = output[2]
	if a + b in x and a + c in x and (b + c in x) and (a + b + c in [x, m]):
		return str(a) + ' ' + str(b) + ' ' + str(c)
	else:
		return 'Algorithm fails.'
x = [int(x) for x in input().split()]
print(restoring(x))


x = sorted((int(i) for i in input('').split(' ')))
ab = x[0]
ba = x[1]
cb = x[2]
abc = x[3]
print(' '.join((str(abc - i) for i in [ab, ba, cb])))


(a, b, c, d) = [int(i) for i in input().split()]
if a == max(a, b, c, d):
	(a, d) = (d, a)
elif b == max(a, b, c, d):
	(b, d) = (d, b)
elif c == max(a, b, c, d):
	(c, d) = (d, c)
list1 = [a, b, c]
for x in range(3):
	print(d - list1[x], end=' ')


def number(values):
	values.sort(reverse=True)
	a = values[0] - values[1]
	b = values[0] - values[2]
	c = values[0] - values[3]
	return [a, b, c]
values = list(map(int, input().split()))
print(*number(values))


import cmath
tot = 0
l = []
l = input().split()
l = list(map(int, l))
l.sort()
tot = l.pop()
ab = l[0]
bc = l[1]
ca = l[2]
a = tot - ab
b = tot - bc
c = tot - ca
print(a, end=' ')
print(b, end=' ')
print(c)


(x1, x2, x3, x4) = sorted(map(int, input().split()))
b = (x1 - x2 + x3) // 2
a = x1 - b
c = x4 - b - a
print(a, b, c)


import sys

def main():
	x_lst = list(map(int, sys.stdin.readline().split()))
	x_lst.sort()
	abc = x_lst[-1]
	results = []
	for x in x_lst[:3]:
		results.append(abc - x)
	print(' '.join((str(x) for x in results)))
main()


a = [int(i) for i in input().split(' ')]
m = 0
for i in range(0, len(a)):
	if a[i] > m:
		m = a[i]
b = []
for i in range(0, len(a)):
	t = m - a[i]
	if t != 0:
		b.append(t)
for i in range(0, len(b)):
	print(b[i], end=' ')


a = input()
s = a.split()
d = []
f = ''
for i in s:
	d.append(int(i))
d.sort()
m = d[len(d) - 1]
for i in range(len(d) - 1):
	f += str(d[len(d) - 1] - d[i]) + ' '
print(f[:-1])


def nos(ar):
	ar.sort()
	a = (ar[1] - ar[2] + ar[0]) // 2
	b = ar[0] - a
	c = ar[1] - a
	if a + b + c == ar[3]:
		print(a, b, c)
ar = list(map(int, input().split()))
res = nos(ar)


a = input().split()
i = 0
while i < 4:
	a[i] = int(a[i])
	i = i + 1
c = max(a)
for j in a:
	if j != c:
		print(c - j, end=' ')
	else:
		continue


a = sorted(list(map(int, input().split())), reverse=True)
b = a[0] - a[1]
c = a[0] - a[2]
d = a[0] - a[3]
print(str(b) + ' ' + str(c) + ' ' + str(d))


import sys

class Main:

	def __init__(self):
		self.buff = None
		self.index = 0

	def next(self):
		if self.buff is None or self.index == len(self.buff):
			self.buff = sys.stdin.readline().split()
			self.index = 0
		val = self.buff[self.index]
		self.index += 1
		return val

	def next_int(self):
		return int(self.next())

	def solve(self):
		x = sorted([self.next_int() for _ in range(0, 4)])
		print(x[-1] - x[0], x[-1] - x[1], x[-1] - x[2])
Main().solve()


arr = input()
l = list(map(int, arr.split(' ')))
l.sort()
for i in range(0, 3):
	l[i] = l[3] - l[i]
print(l[0], l[1], l[2])


s = input().split()
a = [int(num) for num in s]
m = max(a)
s = ''
for x in a:
	if x != m:
		s += str(m - x)
		s += ' '
print(s)


(a, b, c, d) = map(int, input().split())
r = max(a, b, c, d)
if r == a:
	print(r - b, end=' ')
	print(r - c, end=' ')
	print(r - d, end=' ')
elif r == b:
	print(r - a, end=' ')
	print(r - c, end=' ')
	print(r - d, end=' ')
elif r == c:
	print(r - a, end=' ')
	print(r - b, end=' ')
	print(r - d, end=' ')
else:
	print(r - a, end=' ')
	print(r - b, end=' ')
	print(r - c, end=' ')


A = sorted([int(a) for a in input().split()])
m = A[-1]
print(m - A[2], m - A[1], m - A[0])


a = list(map(int, input().split()))
k = max(a)
j = a.index(k)
for i in range(len(a)):
	if i != j:
		print(k - a[i], end=' ')


def main():
	arr = [int(i) for i in input().split()]
	arr.sort()
	l = arr[len(arr) - 1]
	s = ''
	for i in range(len(arr) - 1):
		new = l - arr[i]
		s = s + str(new) + ' '
	print(s)
main()


list1 = list(map(int, input().split()))
list1.sort()
max1 = list1[-1]
del list1[-1]
l = []
for i in list1:
	l.append(max1 - i)
print(*l)


a = sorted(list(map(int, input().split())))
print(a[-1] - a[-2], a[-1] - a[-3], a[-1] - a[-4])


a = sorted(map(int, input().split()))
print(a[3] - a[2], a[3] - a[1], a[3] - a[0])


lst = list(map(int, input().split()))
l = sorted(lst)
total = l[3]
x = l[3] - l[0]
y = l[3] - l[1]
z = l[3] - l[2]
print(x, y, z, sep=' ')


l = list(map(int, input().split()))
s = max(l)
for i in range(4):
	if s - l[i] != 0:
		print(s - l[i], end=' ')


x = sorted(map(int, input().split()))
print(str(x[3] - x[0]) + ' ' + str(x[3] - x[1]) + ' ' + str(x[3] - x[2]))


l = list(map(int, input().split()))
s = max(l)
l.remove(s)
b = []
for i in l:
	b.append(s - i)
print(' '.join([str(e) for e in b]))


(a, b, c, d) = [int(x) for x in input().split()]
l = [a, b, c, d]
l.sort()
w = l[3]
l.pop()
print(f'{w - l[0]} {w - l[1]} {w - l[2]}')


a = list(map(int, input().split()))
a.sort()
e = []
for i in a[:3]:
	e.append(a[-1] - i)
print(*e)


(x1, x2, x3, x4) = map(int, input().split())
b = []
b.append(x1)
b.append(x2)
b.append(x3)
b.append(x4)
b.sort(reverse=True)
temp = b[0]
for i in range(1, 4):
	res = temp - b[i]
	print(res, end=' ')


inl = input().split()
mt = list((int(i) for i in inl))
mt.sort()
a1 = mt[3] - mt[0]
a2 = mt[1] - a1
a3 = mt[2] - a1
print(str(a1) + ' ' + str(a2) + ' ' + str(a3))


inp = input().split(' ')
inp = [int(i) for i in inp]
inp.sort()
for i in range(3):
	inp[i] = inp[-1] - inp[i]
print(inp[0], inp[1], inp[2])


x = [int(s) for s in input().split()]
x.sort(reverse=True)
print(*[x[0] - x[i] for i in range(1, 4)])


(a, b, c, d) = list(map(int, input().split()))
new = []
for i in range(1):
	new.append(a)
	new.append(b)
	new.append(c)
	new.append(d)
new.sort()
arr = []
for j in range(len(new) - 1):
	arr.append(new[-1] - new[j])
print(' '.join((str(i) for i in arr)))


def main(arr):
	arr.sort()
	a = arr[3] - arr[0]
	b = arr[3] - arr[1]
	c = arr[3] - arr[2]
	print(a, b, c)
import sys
arr = list(map(int, input().split()))
sys.exit(main(arr))


m = list(map(int, input().split()))
m.sort()
print(m[3] - m[2], m[3] - m[1], m[3] - m[0])


def bublesort(a):
	n = len(a)
	fl1 = False
	while not fl1:
		fl1 = True
		for i in range(n - 1):
			if a[i] > a[i + 1]:
				(a[i], a[i + 1]) = (a[i + 1], a[i])
				fl1 = False
a = list(map(int, input().split()))
bublesort(a)
w = a[3]
x = a[0]
y = a[1]
z = a[2]
print(w - x, w - y, w - z)


x = [int(x) for x in input().split()]
abc = max(x)
x.remove(abc)
bc = x[0] - x[1]
b2 = bc + x[2]
b = b2 // 2
a = x[0] - b
c = x[1] - a
print(a, b, c)


array = list(map(int, input().split()))
x4 = max(array)
ans = []
for i in array:
	ans.append(x4 - i)
ans.remove(0)
output = ' '.join((str(j) for j in ans))
print(output)


a = sorted([int(i) for i in input().split()])
print(a[-1] - a[0], a[-1] - a[1], a[-1] - a[2])


(a, b, c, d) = [int(i) for i in input().split()]
if a >= b and a >= c and (a >= d):
	print(abs(a - b), abs(a - c), abs(a - d))
elif b >= a and b >= c and (b >= d):
	print(abs(b - a), abs(b - c), abs(b - d))
if c >= b and c >= a and (c >= d):
	print(abs(c - b), abs(c - a), abs(c - d))
elif d >= b and d >= c and (d >= a):
	print(abs(d - b), abs(d - c), abs(d - a))
elif a == b and b == c and (c == a):
	print(abs(d - b), abs(d - c), abs(d - a))


l = list(map(int, input().split()))
l.sort()
p = l[3] - l[0]
q = l[3] - l[2]
r = l[3] - l[1]
print(p, q, r)


A = list(map(int, input().split()))
m = max(A)
ans = []
for a in A:
	if a < m:
		ans.append(m - a)
print(*sorted(ans))


l = list(map(int, input().strip().split()))
l.sort()
m = max(l)
print(m - l[2], end=' ')
print(m - l[1], end=' ')
print(m - l[0], end=' ')


n = input()
n = n.split(' ')
n = list(map(int, n))
n.sort(reverse=True)
minimo = n[0] - n[1]
mid = n[3] - minimo
maximo = n[1] - mid
print(mid, maximo, minimo)


lis = list(map(int, input().split()))
ans = []
x = max(lis)
for i in lis:
	if i != x:
		ans.append(x - i)
print(' '.join(list(map(str, ans))))


A = list(map(int, input().split()))
A.sort()
x = A[-1]
print(x - A[0], x - A[1], x - A[2])


n = input().split()
maximum = 0
for i in n:
	if maximum < int(i):
		maximum = int(i)
answer = ''
for i in n:
	if int(i) != maximum:
		answer += str(maximum - int(i)) + ' '
print(answer)


numbers = sorted(list(map(int, input().split())))
print(numbers[3] - numbers[0], numbers[3] - numbers[1], numbers[3] - numbers[2])


a = [int(_) for _ in input().split()]
a.sort()
print(a[-1] - a[0], a[-1] - a[1], a[-1] - a[2])


a = [int(x) for x in input().split()]
a.sort()
x = a[-1]
print(x - a[0], x - a[1], x - a[2])


vet = list(map(int, input().split()))
maior = max(vet)
vet.remove(maior)
(x, y, z) = (vet[0], vet[1], vet[2])
b = (x - y + z) // 2
c = z - b
a = x - b
print(a, b, c)


l = list(map(int, input().split()))
m = max(l)
for i in range(len(l)):
	if l[i] != m:
		print(m - l[i], end=' ')


sums = [int(x) for x in input().split()]
sums.sort()
a = sums[0] + sums[1] - sums[3]
b = sums[1] + sums[2] - sums[3]
c = sums[0] + sums[2] - sums[3]
print(' '.join([str(a), str(b), str(c)]))


ints = list(map(int, input().split(' ')))
ints.sort()
a = ints[-1] - ints[0]
b = ints[-1] - ints[1]
c = ints[-1] - ints[2]
print(f'{a} {b} {c}')


from sys import stdin

def readLine():
	return stdin.readline().strip()

def readInt():
	return int(readLine())

def readInts():
	return list(map(int, readLine().split()))

def main():
	(w, x, y, z) = sorted(readInts())
	print(z - y, z - x, z - w)
main()


l = list(input().split(' '))
li = []
a = []
for i in l:
	li.append(int(i))
m = max(li)
for i in range(len(l)):
	if m == li[i]:
		ind = i
		break
for i in range(len(l)):
	if ind != i:
		a.append(li[ind] - li[i])
for i in a:
	print(i, end=' ')


import sys
sys_input = sys.stdin.readline

def si():
	return sys_input().rstrip()

def ii():
	return int(si())

def sti():
	return si().split()

def iti():
	return map(int, sti())

def sli():
	return list(si())

def ili():
	return list(iti())

def main():
	X.sort()
	a = X[-1] - X[0]
	b = X[-1] - X[1]
	c = X[-1] - X[2]
	print(a, b, c)
	return
X = ili()
main()


numbers = [int(c) for c in input().split()]
maior = 0
for i in range(len(numbers)):
	n = numbers[i]
	if n > numbers[maior]:
		maior = i
maior = numbers.pop(maior)
for (i, n) in enumerate(numbers):
	if i == 2:
		print(maior - n)
	else:
		print(maior - n, end=' ')


xes = list(map(int, input().split()))
xes.sort()
maximum = xes[-1]
xes = xes[:-1]
for i in range(3):
	a = xes[0] + xes[1] - maximum
	b = xes[1] + xes[2] - maximum
	c = xes[2] + xes[0] - maximum
	if a > 0 and b > 0 and (c > 0):
		print(a, b, c)
		exit()
	xes = xes[1:] + [xes[0]]


import sys
input = sys.stdin.readline

def main():
	lst = list(map(int, input().split()))
	lst.sort()
	print(lst[-1] - lst[0], lst[-1] - lst[1], lst[-1] - lst[2])
main()


l = list(map(int, input().strip().split()))
x = (l[0] + l[1] + l[2] + l[3]) // 3
for i in range(4):
	if x == l[i]:
		l.remove(l[i])
		break
print(f'{x - l[2]} {x - l[1]} {x - l[0]}')


def main():
	a = list(map(int, input().split()))
	a.sort()
	x = a[-1] - a[0]
	y = a[-2] - x
	if x + y + a[1] - y == a[-1]:
		z = a[1] - y
	else:
		z = a[0] - y
	print(x, y, z)
	return
main()


lst = input().split()
lst = [int(i) for i in lst]
lst = sorted(lst)
print(lst[-1] - lst[0], lst[-1] - lst[1], lst[-1] - lst[2])


from sys import stdin, stdout
inp = [int(x) for x in stdin.readline().split()]
s = max(inp)
inp.remove(s)
for i in range(len(inp)):
	stdout.write(str(s - inp[i]) + ' ')
stdout.write('\n')


A = list(map(int, input().split()))
A.sort()
Max = A[3]
out = []
for val in A[:3]:
	out.append(str(Max - val))
out = reversed(out)
print(' '.join(out))


(a1, b1, c1, d1) = map(int, input().split())
if a1 > b1 and a1 > c1 and (a1 > d1):
	print(a1 - b1, end=' ')
	print(a1 - c1, end=' ')
	print(a1 - d1, end=' ')
elif b1 > a1 and b1 > c1 and (b1 > d1):
	print(b1 - a1, end=' ')
	print(b1 - c1, end=' ')
	print(b1 - d1, end=' ')
elif c1 > a1 and c1 > b1 and (c1 > d1):
	print(c1 - b1, end=' ')
	print(c1 - a1, end=' ')
	print(c1 - d1, end=' ')
else:
	print(d1 - b1, end=' ')
	print(d1 - c1, end=' ')
	print(d1 - a1, end=' ')


arr = list(map(int, input().split()))
temp = sorted(arr)
ans = []
for i in range(0, len(temp) - 1):
	ans.append(temp[-1] - temp[i])
for i in ans:
	print(i, end=' ')


a = list(map(int, input().split()))
a.sort()
x = a[len(a) - 1]
x1 = x - a[0]
x2 = x - a[1]
x3 = x - a[2]
print(x1, x2, x3)


line = input().split(' ')
ints = [int(i) for i in line]
mx = max(ints)
been = False
for i in ints:
	if been or mx != i:
		print(mx - i)
	else:
		been = True


a = list(map(int, input().split()))
a.sort()
res = []
for i in range(3):
	res.append(a[-1] - a[i])
res = list(map(str, res))
print(' '.join(res))


(g, h, x, y) = sorted(map(int, input().split()))
print(int((g + (h - x)) / 2), int(g - (g + (h - x)) / 2), int((x + (h - g)) / 2))


arr = sorted(list(map(int, input().split())))
c = arr[3] - arr[0]
b = arr[3] - arr[1]
a = arr[3] - arr[2]
print(a, b, c, sep=' ')


l = list(map(int, input().split()))
a = min(l)
l.remove(a)
b = min(l)
l.remove(b)
c = min(l)
m = max(l)
z = int((c - a + b) / 2)
x = c - z
y = a - x
print(x, y, z)


l = list(input().split())
a = []
for i in range(4):
	a.append(int(l[i]))
summation = max(a)
a.remove(summation)
print(summation - a[0], end=' ')
print(summation - a[1], end=' ')
print(summation - a[2])


(a, b, c, summa) = map(int, input().split())
while True:
	if summa > a and summa > b and (summa > c):
		a = summa - a
		b = summa - b
		c = summa - c
		break
	elif b > summa:
		z = summa
		summa = b
		b = z
	elif a > summa:
		z = summa
		summa = a
		a = z
	elif c > summa:
		z = summa
		summa = c
		c = z
print(str(a) + ' ' + str(b) + ' ' + str(c))


x = list(map(int, input().split()))
x.sort()
(x1, x2, x3, x4) = x
print(x4 - x3, x4 - x2, x4 - x1)


s = input().strip().split()
for i in range(len(s)):
	s[i] = int(s[i])
s.sort()
print(s[3] - s[0], s[3] - s[1], s[3] - s[2])


lis = list(map(int, input().split()))
lis.sort()
print(lis[3] - lis[2], end=' ')
print(lis[3] - lis[1], end=' ')
print(lis[3] - lis[0])


l = [int(x) for x in input().split()]
m = max(l)
l.remove(m)
a = m - l[0]
b = m - l[1]
c = m - l[2]
print(a, b, c)


s = list(map(int, input().split()))
s.sort()
a = str(s[-1] - s[0])
b = str(s[-1] - s[1])
c = str(s[-1] - s[2])
print(a + ' ' + b + ' ' + c)


from typing import Callable, List, TypeVar, cast
_F = TypeVar('_F', bound=Callable[[], None])

def repeater(func: _F) -> _F:

	def wrapper():
		for _ in range(int(input())):
			func()
	return cast(_F, wrapper)

def main() -> None:
	sum_2_list: List[int]
	sum_3: int
	(*sum_2_list, sum_3) = sorted(map(int, input().split()))
	print(*(sum_3 - value for value in sum_2_list))
main()


(x1, x2, x3, x4) = map(int, input().split())
s = max(x1, x2, x3, x4)
if s == x1:
	print(s - x2, s - x3, s - x4)
elif s == x2:
	print(s - x1, s - x3, s - x4)
elif s == x3:
	print(s - x1, s - x2, s - x4)
else:
	print(s - x1, s - x2, s - x3)


def solve():
	numbers = [int(x) for x in input().split()]
	numbers.sort(reverse=True)
	print(numbers[0] - numbers[1], numbers[0] - numbers[2], numbers[0] - numbers[3])
solve()


numbers = [int(i) for i in input().split()]
numbers = sorted(numbers)
total = numbers[3]
del numbers[3]
print((numbers[0] + numbers[2] - numbers[1]) // 2, end=' ')
print(numbers[0] - (numbers[0] + numbers[2] - numbers[1]) // 2, end=' ')
print(numbers[2] - (numbers[0] + numbers[2] - numbers[1]) // 2)


x = list(map(int, input().split()))
maxi = max(x)
mini = min(x)
a = maxi - mini
x.remove(maxi)
b = max(x) - a
c = mini - b
print(a, b, c)


ls = sorted(list(map(int, input().split())))
print(ls[3] - ls[2], ls[0] - (ls[3] - ls[2]), ls[1] - (ls[3] - ls[2]))


(x1, x2, x3, x4) = map(int, input().split())
a = [x1, x2, x3, x4]
a.sort(reverse=True)
print(a[0] - a[1], a[0] - a[2], a[0] - a[3])


x = input()
x = x.split(' ')
for i in range(len(x)):
	x[i] = int(x[i])
abc = max(x)
for i in range(len(x)):
	if abc - x[i] != 0:
		print(abc - x[i])


a = [int(i) for i in input().split()]
e = max(a)
a.pop(a.index(e))
print(e - a[0], e - a[1], e - a[2], sep=' ')


x = list(map(int, input().split()))
x.sort()
(x1, x2, x3, x4) = (x[0], x[1], x[2], x[3])
print(x4 - x1, x4 - x2, x4 - x3)


inp = list(map(int, input().split()))
inp.sort(reverse=True)
s = inp.pop(0)
print(s - inp[0], s - inp[1], s - inp[2])


lst = list(map(int, input().split()))
for s in range(len(lst)):
	if lst[s] != max(lst):
		print(max(lst) - lst[s], end=' ')
else:
	print()


nums = []
a = input().split()
for i in range(4):
	nums.append(int(a[i]))
nums.sort()
x = nums[3] - nums[2]
y = nums[3] - nums[1]
z = nums[3] - nums[0]
print(x, y, z)


l = list(map(int, input().split()))
m = max(l)
l.remove(m)
c = m - max(l)
l.remove(max(l))
b = max(l) - c
a = m - b - c
print(a, b, c)


def main():
	x = list(map(int, input().split()))
	x.sort()
	c = x[-1] - x[0]
	b = x[2] - c
	a = x[1] - c
	print(a, b, c)
main()


n = input()
n1 = n.split()
l = int(n1[0])
m = int(n1[1])
r = int(n1[2])
t = int(n1[3])
if l > m and l > r and (l > t):
	fst = l - m
	snd = l - r
	thd = l - t
	print(fst, snd, thd)
elif m > l and m > r and (m > t):
	fst = m - l
	snd = m - r
	thd = m - t
	print(fst, snd, thd)
elif r > l and r > m and (r > t):
	fst = r - l
	snd = r - m
	thd = r - t
	print(fst, snd, thd)
elif t > l and t > m and (t > r):
	fst = t - l
	snd = t - m
	thd = t - r
	print(fst, snd, thd)


(a, b, c, d) = map(int, input(' ').split(' '))
s = 0
s = max(a, max(b, max(c, d)))
m = s - a
n = s - b
p = s - c
q = s - d
if m == 0:
	print('%s %s %s' % (n, p, q))
elif n == 0:
	print('%s %s %s' % (m, p, q))
elif p == 0:
	print('%s %s %s' % (m, n, q))
else:
	print('%s %s %s' % (m, n, p))


w = input()
l = w.split()
p = int(l[0])
q = int(l[1])
r = int(l[2])
s = int(l[3])
if s - p < 0:
	(s, p) = (p, s)
if s - q < 0:
	(s, q) = (q, s)
if s - r < 0:
	(s, r) = (r, s)
a = s - r
b = s - q
c = s - p
print(a, ' ', b, ' ', c)


data = [int(i) for i in input().split(' ')]
maximum = data[0]
maximum_index = 0
for i in range(4):
	if data[i] > maximum:
		maximum = data[i]
		maximum_index = i
del data[maximum_index]
a_b_c = maximum
a_b = data[0]
a_c = data[1]
b_c = data[2]
first_number = a_b + a_c - a_b_c
second_number = a_c + b_c - a_b_c
third_number = a_b_c - first_number - second_number
print(first_number, second_number, third_number)


a = list(map(int, input().split(' ')))
maximum = max(a)
a.remove(maximum)
maximum1 = max(a)
a.remove(maximum1)
maximum2 = max(a)
c = maximum - maximum1
v = maximum - maximum2
b = maximum - (v + c)
print(v, b, c)


n = list(map(int, input().split()))
n = sorted(n)
sum = max(n)
a = sum - n[2]
b = n[0] - a
c = n[1] - a
print(a, b, c)


(n1, n2, n3, n4) = input().split()
(n1, n2, n3, n4) = (int(n1), int(n2), int(n3), int(n4))
max1 = max(n1, n2, n3, n4)
if max1 == n1:
	print(max1 - n2, max1 - n3, max1 - n4)
elif max1 == n2:
	print(max1 - n1, max1 - n3, max1 - n4)
elif max1 == n3:
	print(max1 - n1, max1 - n2, max1 - n4)
else:
	print(max1 - n1, max1 - n2, max1 - n3)


(a, b, c, d) = list(map(int, input().split()))
x = [a, b, c, d]
x = sorted(x)
p1 = max(x) - x[0]
p2 = max(x) - x[1]
p3 = max(x) - x[2]
print(p1, p2, p3)


L = list(map(int, input().split()))
L.sort(reverse=True)
a = L[0] - L[1]
b = L[0] - L[2]
if b - a == L[3]:
	print(a, b, L[0] - a - b)
else:
	b = L[0] - L[3]
	print(a, b, L[0] - a - b)


line = input().split(' ')
li = []
m = 0
for x in line:
	x = int(x)
	if x > m:
		m = x
for x in line:
	x = int(x)
	if x != m:
		li.append(x)
print('%d %d %d' % (m - li[0], m - li[1], m - li[2]))


items = [int(x) for x in input().split()]
thesum = max(items)
for num in items:
	if num != thesum:
		print(thesum - num, end=' ')


(a, b, c, d) = [int(x) for x in input().split()]
list1 = []
list1.append(a)
list1.append(b)
list1.append(c)
list1.append(d)
z = max(list1)
for i in range(0, 4):
	if list1[i] != z:
		print(z - list1[i], end=' ')


(s1, s2, s3, s4) = map(int, input().strip().split())
l = []
l.append(s1)
l.append(s2)
l.append(s3)
l.append(s4)
l.sort()
a = l[3] - l[0]
b = l[3] - l[1]
c = l[3] - l[2]
print(a, b, c)


(x1, x2, x3, x4) = map(int, input().split())
c = max(x1, x2, x3, x4)
i = []
q = c - x1
w = c - x2
e = c - x3
r = c - x4
if q != 0:
	i.append(q)
if w != 0:
	i.append(w)
if e != 0:
	i.append(e)
if r != 0:
	i.append(r)
for a in i:
	print(a, end=' ')


l = list(map(int, input().split()))
x = max(l)
l.sort()
l1 = []
for i in l:
	l1.append(x - i)
l1.remove(min(l1))
for i in l1:
	print(i, end=' ')


(x1, x2, x3, x4) = map(int, input().split())
sum = []
sum.append(x1)
sum.append(x2)
sum.append(x3)
sum.append(x4)
sum.sort()
a = sum[3] - sum[0]
b = sum[3] - sum[1]
c = sum[3] - sum[2]
print(f'{a} {b} {c}')


(x1, x2, x3, x4) = map(int, input().split())
mx = max(x1, x2, x3, x4)
for i in (x1, x2, x3, x4):
	if mx - i != 0:
		print(mx - i, end=' ')


mat = list(map(int, input().split()))
mat = sorted(mat)
c = mat[-1] - mat[0]
print(mat[1] - c, mat[2] - c, c)


(p, q, r, s) = map(int, input().split())
l = [p, q, r, s]
l.sort()
a = l[3] - l[0]
b = l[3] - l[1]
c = l[3] - l[2]
print(a, end=' ')
print(b, end=' ')
print(c, end=' ')


a = list(map(int, input().split()))
k = 0
for i in range(4):
	if a[i] > k:
		k = a[i]
for i in range(4):
	if k > a[i]:
		print(k - a[i], end=' ')


numbers = input().split()
for i in range(4):
	numbers[i] = int(numbers[i])
numbers.sort()
for i in range(3):
	print(f'{numbers[3] - numbers[i]}', end=' ')


numbers = list(map(int, input().split()))
s = sum(numbers) // 3
numbers.remove(s)
print(s - numbers[0], s - numbers[1], s - numbers[2])


(a, b, c, d) = map(int, input().split())
x = []
x.append(a)
x.append(b)
x.append(c)
x.append(d)
p = max(x)
x.remove(p)
d = p - x[0]
e = p - x[1]
f = p - x[2]
print(d, e, f)


s = input().split()
for i in range(0, len(s)):
	s[i] = int(s[i])
sums = max(s)
x = s.index(sums)
s = s[0:x] + s[x + 1:len(s)]
for t in range(0, len(s)):
	print(sums - s[t], end=' ')


(a, b, c, d) = map(int, input().split())
if a == (b + c + d) // 2:
	num1 = b + c - a
	num2 = c + d - a
	num3 = a - (num1 + num2)
elif b == (a + c + d) // 2:
	num1 = a + c - b
	num2 = c + d - b
	num3 = b - (num1 + num2)
elif c == (a + b + d) // 2:
	num1 = a + b - c
	num2 = b + d - c
	num3 = c - (num1 + num2)
else:
	num1 = a + b - d
	num2 = c + b - d
	num3 = d - (num1 + num2)
print(num1, num2, num3)


(p, q, r, s) = map(int, input().split())
m = max(p, q, r, s)
a = 0
b = 0
c = 0
if m == p:
	a = p - q - r
	b = p - q - s
	c = p - r - s
elif m == q:
	a = q - p - r
	b = q - p - s
	c = q - r - s
elif m == s:
	a = s - q - r
	b = s - q - p
	c = s - r - p
elif m == r:
	a = r - q - s
	b = r - q - p
	c = r - p - s
print(-a, '', -b, '', -c)


x = input().split()
max = 0
for i in range(4):
	x[i] = int(x[i])
	if x[i] > max:
		max = x[i]
for i in range(4):
	if x[i] < max:
		print(max - x[i])


from itertools import permutations
(x1, x2, x3, x4) = map(int, input().strip().split())
for (x1, x2, x3, x4) in permutations([x1, x2, x3, x4]):
	a = x4 - x3
	b = x4 - x2
	c = x4 - x1
	if a > 0 and b > 0 and (c > 0):
		print(a, b, c)
		exit(0)


ar = [int(val) for val in input().split()]
t = max(ar)
for x in ar:
	if t - x > 0:
		print(t - x, end=' ')


(x, y, z, t) = sorted(map(int, input().split(' ')))
print(t - z, t - y, t - x)


nums = input()
a1 = nums.split()
lis1 = list()
for i in range(0, len(a1)):
	lis1.append(int(a1[i]))
lis1.sort()
s1 = lis1[0]
s2 = lis1[1]
s3 = lis1[2]
s4 = lis1[3]
a = s4 - s3
b = s4 - s2
c = s4 - s1
print(a, b, c)


a = [int(elem) for elem in input().split()]
a.sort()
print(a[3] - a[0], a[3] - a[1], a[3] - a[2])


sumsList = [int(x) for x in input().split()]
sumsList.sort(reverse=True)
for x in sumsList:
	print(sumsList[0] - x, end=' ') if x != sumsList[0] else 0


def solve(ar):
	total = max(ar)
	nums = list()
	for i in range(0, 4):
		if ar[i] != total:
			nums.append(total - ar[i])
	return ' '.join((str(elem) for elem in nums))
a = list(map(int, input().split()))
print(solve(a))


a = [int(i) for i in input().split()]
ma = max(a)
for i in a:
	if i != ma:
		print(ma - i)


s = input().split()
x1 = int(s[0])
x2 = int(s[1])
x3 = int(s[2])
x4 = int(s[3])
s3 = max(x1, x2, x3, x4)
res = []
if s3 - x1 != 0:
	res.append(s3 - x1)
if s3 - x2 != 0:
	res.append(s3 - x2)
if s3 - x3 != 0:
	res.append(s3 - x3)
if s3 - x4 != 0:
	res.append(s3 - x4)
print(*res)


list = input().split()
list = [int(x) for x in list]
list.sort()
abc = list.pop()
ab = list.pop()
ac = list.pop()
bc = list.pop()
c = abc - ab
a = abc - bc
b = abc - ac
print(c, a, b)


(x1, x2, x3, x4) = map(int, input().split())
x5 = max(x1, x2, x3, x4)
if x5 - x1 == 0:
	print(x5 - x2, x5 - x3, x5 - x4)
elif x5 - x2 == 0:
	print(x5 - x1, x5 - x3, x5 - x4)
elif x5 - x3 == 0:
	print(x5 - x1, x5 - x2, x5 - x4)
elif x5 - x4 == 0:
	print(x5 - x1, x5 - x3, x5 - x2)


x = input().split(' ')
nums = []
ans = []
for num in x:
	nums.append(int(num))
nums.sort()
ans.append(nums[3] - nums[0])
ans.append(nums[2] - ans[0])
ans.append(nums[1] - ans[0])
print(f'{ans[0]} {ans[1]} {ans[2]}')


f = lambda : list(map(int, input().split()))
(q, w, e, r) = f()
z = [q, w, e, r]
d = max(z)
z.remove(d)
s = z[0]
a = z[1]
c = z[2]
print(d - s, d - c, d - a)


(x, y, z, d) = tuple(map(int, input().split()))
(x1, y1, z1, d1) = (x, y, z, d)
if 2 * (d - x) == z - x + y:
	pass
else:
	swap = x1
	x1 = d1
	d1 = swap
	if 2 * (d1 - x1) == z1 - x1 + y1:
		(x, y, z, d) = (x1, y1, z1, d1)
		pass
	else:
		(x1, y1, z1, d1) = (x, y, z, d)
		swap = y
		y = d
		d = swap
		if 2 * (d1 - x1) == z1 - x1 + y1:
			(x, y, z, d) = (x1, y1, z1, d1)
			pass
		else:
			(x1, y1, z1, d1) = (x, y, z, d)
			swap = z
			z = d
			d = swap
			if 2 * (d1 - x1) == z1 - x1 + y1:
				(x, y, z, d) = (x1, y1, z1, d1)
				pass
c = (z - x + y) // 2
b = y - c
a = x - b
print(a, b, c)


l = [int(x) for x in input().split()]
lSort = sorted(l)
print(f'{lSort[3] - lSort[2]} {lSort[3] - lSort[1]} {lSort[3] - lSort[0]}')


val = [int(x) for x in input().split()]
val.sort(reverse=True)
tot = val[0]
print(tot - val[1], tot - val[2], tot - val[3])


from sys import stdin

def get_user_input():
	return list(map(int, stdin.readline().rstrip().split()))
input_list = sorted(get_user_input())
(x, y, z, t) = (input_list[0], input_list[1], input_list[2], input_list[3])
a = -1 * (t - x - y)
b = x - a
c = y - a
print(str(a) + ' ' + str(b) + ' ' + str(c))


k = sorted(list(map(int, input().split())))
for i in range(0, 3):
	print(k[3] - k[i], end=' ')


numbers = sorted([int(i) for i in input().split(' ')])
biggestNumber = numbers[-1]
print(f'{biggestNumber - numbers[0]} {biggestNumber - numbers[1]} {biggestNumber - numbers[2]}')


r = sorted(list(map(int, input().strip().split())))
print(r[3] - r[0], r[3] - r[1], r[3] - r[2])


x = list(map(int, input().split()))
x.pop(x.index(sum(x) // 3))
print((x[0] + x[1] - x[2]) // 2, (x[2] + x[1] - x[0]) // 2, (x[0] + x[2] - x[1]) // 2)


arr = input().split()
res = []
arr = list(map(int, arr))
w = max(arr)
arr.remove(max(arr))
for x in arr:
	res.append(w - x)
print(*res)


(a, b, c, d) = map(int, input().split())
lst = [a, b, c, d]
lst.sort()
for value in lst:
	if value != lst[3]:
		print(lst[3] - value)


lst = sorted(list(map(int, input().split())))
print('{0} {1} {2}'.format(lst[3] - lst[0], lst[3] - lst[1], lst[3] - lst[2]))


(x, r, o, t) = sorted(map(int, input().split()))
print(t - o, t - r, t - x)


arr = list(map(int, input().split()))
lar = max(arr)
arr.remove(lar)
print(str(lar - arr[0]) + ' ' + str(lar - arr[1]) + ' ' + str(lar - arr[2]))


def main():
	nums = [int(num) for num in input().split()]
	total_sum = max(nums)
	nums.remove(total_sum)
	ans = [str(total_sum - num) for num in nums]
	print(' '.join(ans))
main()


a = input().split()
max = 0
list = []
for i in a:
	i = int(i)
	if max < i:
		max = i
		list.append(i)
	else:
		list.append(i)
for i in list:
	x = max - i
	if x != 0:
		print(x, end=' ')


list1 = input().split(' ')
list2 = [int(i) for i in list1]
a = max(list2)
list2.remove(a)
b = list2[0]
c = list2[1]
d = list2[2]
print(a - b, a - c, a - d)


import sys
import math
import bisect
from sys import stdin, stdout
from math import gcd, floor, sqrt, log
from collections import defaultdict as dd
from bisect import bisect_left as bl, bisect_right as br
sys.setrecursionlimit(100000000)
ii = lambda : int(input())
si = lambda : input()
jn = lambda x, l: x.join(map(str, l))
sl = lambda : list(map(str, input().strip()))
mi = lambda : map(int, input().split())
mif = lambda : map(float, input().split())
lii = lambda : list(map(int, input().split()))
ceil = lambda x: int(x) if x == int(x) else int(x) + 1
ceildiv = lambda x, d: x // d if x % d == 0 else x // d + 1
flush = lambda : stdout.flush()
stdstr = lambda : stdin.readline()
stdint = lambda : int(stdin.readline())
stdpr = lambda x: stdout.write(str(x))
mod = 1000000007
arr = lii()
arr.sort(reverse=True)
x = (arr[1] + arr[2] - arr[3]) // 2
if arr[1] > x:
	y = arr[1] - x
elif arr[2] > x:
	y = arr[2] - x
elif arr[3] > x:
	y = arr[3] - x
z = arr[0] - (x + y)
print(x, y, z)


x_list = list(map(int, input().strip().split()))
x_list.sort()
x_1 = x_list[0]
x_2 = x_list[1]
x_3 = x_list[2]
x_4 = x_list[3]
print(x_4 - x_1, x_4 - x_2, x_4 - x_3)


lam = list(map(int, input().split()))
lam.sort(reverse=True)
kam = lam[0] - lam[1]
jam = lam[0] - lam[2]
ham = lam[0] - lam[3]
print(jam, ham, kam)


l = list(map(int, input().split()))
n = max(l)
for i in range(0, 4):
	if l[i] == n:
		continue
	else:
		print(n - l[i], end=' ')


r = input().split()
sum = 0
for i in range(4):
	if int(r[i]) > sum:
		sum = int(r[i])
for i in range(4):
	if int(r[i]) != sum:
		print(str(sum - int(r[i])), end=' ')


inputs = input()
(ab, ac, bc, abc) = inputs.split()
ab = int(ab)
ac = int(ac)
bc = int(bc)
abc = int(abc)
if ab > abc:
	(ab, abc) = (abc, ab)
if bc > abc:
	(bc, abc) = (abc, bc)
if ac > abc:
	(ac, abc) = (abc, ac)
print(int(abc) - int(bc), int(abc) - int(ac), int(abc) - int(ab))


from __future__ import division, print_function
from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase
from itertools import *
import bisect
from heapq import *
from math import *
from copy import *
from collections import deque
from collections import Counter as counter
from itertools import combinations as comb
from itertools import permutations as permutate
from bisect import bisect_left as bl
from bisect import bisect_right as br
from bisect import bisect
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
from types import GeneratorType

def iterative(f, stack=[]):

	def wrapped_func(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		to = f(*args, **kwargs)
		while True:
			if type(to) is GeneratorType:
				stack.append(to)
				to = next(to)
				continue
			stack.pop()
			if not stack:
				break
			to = stack[-1].send(to)
		return to
	return wrapped_func
mod = 1000000007

def inp():
	return sys.stdin.readline().rstrip('\r\n')

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

def sep():
	return map(int, inp().split())

def strsep():
	return map(str, inp().split())

def zerolist(n):
	return [0] * n

def nextline():
	out('\n')

def testcase(t):
	for p in range(t):
		solve()

def printlist(a):
	for p in range(0, len(a)):
		out(str(a[p]) + ' ')

def lcm(a, b):
	return a * b // gcd(a, b)

def power(a, b):
	ans = 1
	while b > 0:
		if b % 2 == 1:
			ans *= a
		a *= a
		b //= 2
	return ans

def ncr(n, r):
	return factorial(n) // (factorial(r) * factorial(max(n - r, 1)))

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def solve():
	x = sorted(lis())
	a = x[0]
	b = x[1]
	c = x[2]
	d = x[3]
	print(d - c, d - b, d - a)
testcase(1)


n = 4
arr = input().split()
for i in range(n):
	arr[i] = int(arr[i])
arr.sort()
print(str(arr[3] - arr[0]) + ' ' + str(arr[3] - arr[1]) + ' ' + str(arr[3] - arr[2]))


nums_list = list(map(int, input().split(' ')))
max_numb1 = max(nums_list)
nums_list.remove(max_numb1)
c = max_numb1 - nums_list.pop()
max_numb2 = max(nums_list)
nums_list.remove(max_numb2)
b = max_numb2 - c
a = max_numb1 - c - b
print(f'{a} {b} {c}', end='')


import sys
import math
import re
import io

def main():
	my_list = sorted(map(int, input().split()))
	a = my_list[3] - my_list[2]
	b = my_list[3] - my_list[1]
	c = my_list[3] - my_list[0]
	print(str(a) + ' ' + str(b) + ' ' + str(c))
main()


def find_num():
	numeros = []
	(a_1, a_2, a_3, a_4) = input().split()
	numeros.append(int(a_1))
	numeros.append(int(a_2))
	numeros.append(int(a_3))
	numeros.append(int(a_4))
	numeros.sort()
	a = numeros[3] - numeros[0]
	b = numeros[3] - numeros[2]
	c = numeros[3] - numeros[1]
	print(str(a) + ' ' + str(b) + ' ' + str(c))
find_num()


(a, b, c, d) = map(int, input().split())
max_val = max(a, b, c, d)
if a - max_val == 0:
	print(max_val - b, max_val - c, max_val - d)
elif b - max_val == 0:
	print(max_val - a, max_val - c, max_val - d)
elif c - max_val == 0:
	print(max_val - a, max_val - b, max_val - d)
else:
	print(max_val - a, max_val - c, max_val - b)


(a, b, c, d) = sorted(list(map(int, input().rstrip().split())), reverse=True)
print(a - b, a - c, a - d)


ls = list((int(x) for x in input().split()))
a = [0, 0, 0]
ls.sort()
a[0] = ls[3] - ls[0]
a[1] = ls[3] - ls[1]
a[2] = ls[3] - ls[2]
print(str(a[0]) + ' ' + str(a[1]) + ' ' + str(a[2]))


x = list(map(int, input().split()))
ans = ''
x.sort()
for i in range(3):
	ans += str(x[3] - x[i]) + ' '
print(ans.strip())


from sys import stdin, stdout
for _ in range(1):
	(a, b, c, sm) = sorted(map(int, stdin.readline().split()))
	print(sm - a, sm - b, sm - c)


arr = list(map(int, input().split()))
maxi = max(arr)
arr.remove(maxi)
a = maxi - arr[0]
arr.remove(arr[0])
b = arr[0] - a
arr.remove(arr[0])
c = maxi - (a + b)
print(str(a) + ' ' + str(b) + ' ' + str(c))


a = list(map(int, input().strip().split()))
b = max(a)
c = []
for i in range(len(a)):
	if a[i] != b:
		c.append(b - a[i])
print(*c)


s = input().split()
t = [int(i) for i in s]
d = max(t)
t.remove(d)
print(d - t[0], d - t[1], d - t[2])


IN = input
rint = lambda : int(IN())
rmint = lambda : map(int, IN().split())
rlist = lambda : list(rmint())
(a, b, c, d) = rmint()
if a < b:
	(a, b) = (b, a)
if a < c:
	(a, c) = (c, a)
if a < d:
	(a, d) = (d, a)
print('%d %d %d' % (a - b, a - c, a - d))


def restoring(j, k, l, m):
	lista = [j, k, l, m]
	xum = max(lista)
	lista.remove(xum)
	c = xum - lista[0]
	b = xum - lista[1]
	a = xum - lista[2]
	return (a, b, c)
(j, k, l, m) = map(int, input().split())
p = restoring(j, k, l, m)
for c in p:
	print(c, end=' ')


q = list(map(int, input().split()))
q.sort()
x = q[-1]
print(x - q[0], end=' ')
print(x - q[1], end=' ')
print(x - q[2])


(a, b, c, d) = map(int, input().split())
x = 1
if x < a:
	x = a
if x < b:
	x = b
if x < c:
	x = c
if x < d:
	x = d
if x - a > 0:
	print(x - a)
if x - b > 0:
	print(x - b)
if x - c > 0:
	print(x - c)
if x - d > 0:
	print(x - d)


def findNum(arr):
	s = max(arr)
	abc = s
	arr.remove(s)
	ab = arr[0]
	bc = arr[1]
	ca = arr[2]
	c = abc - ab
	b = abc - ca
	a = abc - bc
	print(a, b, c, sep=' ')
arr = list(map(int, input().split()))
findNum(arr)


a = list(map(int, input().split()))
a.sort()
d = max(a)
for i in range(len(a) - 1):
	print(d - a[i], end=' ')


list1 = list(map(int, input().split()))
sum = 0
n = 0
m = 0
for i in range(0, len(list1)):
	sum = sum + list1[i]
m = sum // 3
for i in range(0, len(list1)):
	n = m - list1[i]
	if n > 0:
		print(n, end=' ')


arr = list(map(int, input().split()))
arr.sort()
u = arr[3]
x = arr[0]
y = arr[1]
z = arr[2]
a = u - x
b = y - a
c = z - a
print(int(a), int(b), int(c))


a = list(map(int, input().split()))
x = max(a)
for b in a:
	if x - b != 0:
		print(x - b, end=' ')


l = list(map(int, input().split()))
l.sort()
a = int(l[3]) - int(l[2])
b = int(l[3]) - int(l[1])
e = a + b
c = int(l[3]) - e
print(a, b, c)


listans = [int(j) for j in input().split()]
a = max(listans)
listans.remove(a)
answers = []
for i in range(len(listans)):
	answers.append(a - listans[i])
print(*answers)


sum_list = list(map(lambda a: int(a), input().split(' ')))
max_element = max(sum_list)
sum_list.remove(max_element)
numbers = []
for element in sum_list:
	numbers.append(str(max_element - element) + ' ')
print(''.join(numbers))


a = input().split()
sumOfNumbers = int(a[0])
index = 0
for i in range(1, 4):
	if int(a[i]) > sumOfNumbers:
		sumOfNumbers = int(a[i])
		index = i
del a[index]
print(sumOfNumbers - int(a[0]), sumOfNumbers - int(a[1]), sumOfNumbers - int(a[2]))


arr = list(map(int, input().split()))
t = max(arr)
inp = [i for i in arr if i != t]
print(int((inp[0] - inp[1] + inp[2]) / 2), int((inp[1] - inp[2] + inp[0]) / 2), t - (int((inp[0] - inp[1] + inp[2]) / 2) + int((inp[1] - inp[2] + inp[0]) / 2)))


nums = list(map(int, input().split()))
maximum = max(nums)
del nums[nums.index(max(nums))]
test = nums[:]
a = maximum - min(nums)
del nums[nums.index(min(nums))]
b = maximum - min(nums)
del nums[nums.index(min(nums))]
c = maximum - min(nums)
del nums[nums.index(min(nums))]
print(a, b, c)


def restore_numbers(nums):
	nums = sorted(nums)
	print('{} {} {}'.format(nums[-1] - nums[0], nums[-1] - nums[1], nums[-1] - nums[2]))
nums = list(map(int, input().split()))
restore_numbers(nums)


L = list(map(int, input().split()))
S = max(L)
print(*[S - x for x in L if x != S], sep=' ')


h = list(map(int, input().strip().split()))
h.sort()
a = h[3] - h[0]
b = h[3] - h[1]
c = h[3] - h[2]
print(a, b, c)


import re, math, decimal, bisect

def read():
	return input().strip()

def iread():
	return int(input().strip())

def viread():
	return [int(_) for _ in input().strip().split()]
(a, b, c, d) = sorted(viread())
print(f'{d - a} {d - b} {d - c}')


w = list(map(int, input().split()))
l = 0
for i in range(4):
	if w[i] > l:
		l = w[i]
		j = i
for i in range(4):
	if i != j:
		a = l - w[i]
		print(int(a), end=' ')


li = [int(n) for n in input().split()]
temp = max(li)
li.remove(temp)
for j in li:
	print(temp - j)


(x1, x2, x3, x4) = map(int, input().split())
x = max(x1, x2, x3, x4)
if x == x1:
	y = [x2, x3, x4]
if x == x2:
	y = [x1, x3, x4]
if x == x3:
	y = [x1, x2, x4]
if x == x4:
	y = [x1, x2, x3]
a = x - y[0]
b = x - y[1]
c = x - y[2]
print(a, b, c)


def map_to_list(list_, fun):
	for i in range(len(list_)):
		list_[i] = fun(list_[i])

def spaced_string_to_list(count, str_):
	arr = []
	char_index = 0
	word = ''
	for arr_index in range(count):
		while not (char_index >= len(str_) or str_[char_index] == ' '):
			word += str_[char_index]
			char_index += 1
		arr.append(word)
		word = ''
		char_index += 1
	return arr

def spaced_numbers_str_to_list(amount, str_numbers):
	numbers_list = spaced_string_to_list(amount, str_numbers)
	map_to_list(numbers_list, int)
	return numbers_list

def polikarp_zagadal(arr):
	max = arr[0]
	i_found = 0
	for i in range(1, 4):
		if arr[i] > max:
			max = arr[i]
			i_found = i
	result = []
	for i in range(4):
		if i != i_found:
			result.append(max - arr[i])
	return result
arr = polikarp_zagadal(spaced_numbers_str_to_list(4, input()))
print(arr[0], arr[1], arr[2])


n = list(map(int, input().split()))
for i in range(len(n)):
	if n[i] == (sum(n) - n[i]) / 2:
		del n[i]
		break
(x, y, z) = (n[0], n[1], n[2])
a = (x + y - z) // 2
b = (x + z - y) // 2
c = (y + z - x) // 2
print(a, b, c)


(q, w, e, r) = map(int, input().split())
sum = q + w + e + r
sum = sum // 3
if sum == q:
	print(sum - w, sum - e, sum - r)
if sum == w:
	print(sum - q, sum - e, sum - r)
if sum == e:
	print(sum - w, sum - q, sum - r)
if sum == r:
	print(sum - w, sum - e, sum - q)


(n, m, q, p) = sorted(map(int, input().split()))
print(p - q, p - m, p - n)


num_list = list(map(int, input().split()))
num_list = sorted(num_list)
ans_list = [0] * 3
for i in range(3):
	ans_list[i] = num_list[-1] - num_list[i]
print(' '.join(list(map(str, ans_list))))


b = input().split()
b = list(map(int, b))
m = max(b)
b.remove(m)
for i in b:
	print(m - i)


a = [int(x) for x in input().split()]
m = max(a)
a.remove(m)
b = list(map(lambda x: m - x, a))
print(b[0], b[1], b[2])


from sys import stdin
l = list(map(int, stdin.readline().split()))
l.sort()
print(str(l[3] - l[0]) + ' ' + str(l[3] - l[1]) + ' ' + str(l[3] - l[2]))


X = list(map(int, input().split()))
X.sort()
print(X[3] - X[0], X[3] - X[1], X[3] - X[2])


x = input().split()
for i in range(len(x)):
	x[i] = int(x[i])
index = 0
max = 0
for i in range(len(x)):
	if max < x[i]:
		max = x[i]
		index = i
if index == 0:
	a = max - x[1]
	i2 = 1
else:
	a = max - x[0]
	i2 = 0
l = [a]
for i in range(len(x)):
	if i != index and i != i2:
		l.append(max - x[i])
print(l[0], l[1], l[2])


x = [i for i in map(int, input().split())]
q = sorted(x)
a = q[0]
b = q[1]
c = q[2]
d = q[3]
s = []
s.append(d - a)
s.append(d - b)
s.append(d - c)
print(*s, sep=' ')


a = [int(i) for i in input().split(' ')]
x1 = a[0]
x2 = a[1]
x3 = a[2]
x4 = a[3]
s = ''
k = max(max(x1, x2), max(x3, x4))
if k - x1 != 0:
	s = s + str(k - x1) + ' '
if k - x2 != 0:
	s = s + str(k - x2) + ' '
if k - x3 != 0:
	s = s + str(k - x3) + ' '
if k - x4 != 0:
	s = s + str(k - x4) + ' '
print(s)


sums = sorted((int(x) for x in input().split()))
a = sums[0] + sums[1] - sums[3]
b = sums[0] - a
c = sums[1] - a
print(a, b, c)


ar = [int(i) for i in input().strip().split()]
ar.sort()
b = []
b.append(ar[3] - ar[0])
b.append(ar[3] - ar[1])
b.append(ar[3] - ar[2])
b.sort()
print(*b)


s = input().split(' ')
a = [0] * 4
for i in range(4):
	a[i] = int(s[i])
mx = max(a[0], a[1], a[2], a[3])
ans = ''
for i in range(4):
	a[i] = mx - a[i]
	if a[i] != 0:
		ans += str(a[i])
		ans += ' '
print(ans)


l = list(map(int, input().split()))
m = l
m1 = max(l)
m.remove(m1)
a = 0
b = 0
c = 0
if m[0] == m[1] and m[1] == m[2]:
	a = m1 // 3
	b = m1 // 3
	c = m1 // 3
else:
	a = m1 - m[0]
	b = abs(m[1] - a)
	c = abs(m[2] - a)
print(a, b, c)


ls = list(map(int, input().split()))
mx = max(ls)
ls.remove(mx)
a = b = c = 0
for i in range(len(ls)):
	c = mx - ls[i]
	flag = 1
	for j in range(len(ls)):
		if flag == 0:
			break
		if j != i:
			a = ls[j] - c
			if a > 0:
				for k in range(len(ls)):
					if k != j and k != i:
						b = ls[k] - c
						if b > 0:
							flag = 0
							break
print(a, b, c)


l = list(map(int, input().split()))
b = max(l)
n = []
for i in range(len(l)):
	if l[i] < b:
		n.append(b - l[i])
print(' '.join(map(str, n)))


(x1, x2, x3, x4) = input().split()
x1 = int(x1)
x2 = int(x2)
x3 = int(x3)
x4 = int(x4)
list = [x1, x2, x3, x4]
largest = max(list)
if largest == x1:
	print(x1 - x2, x1 - x4, x1 - x3)
if largest == x2:
	print(x2 - x1, x2 - x3, x2 - x4)
if largest == x3:
	print(x3 - x2, x3 - x1, x3 - x4)
if largest == x4:
	print(x4 - x1, x4 - x2, x4 - x3)


A = [int(x) for x in input().split()]
s = max(A)
A.remove(s)
print(' '.join(map(str, [s - x for x in A])))


l = list(map(int, input().split()))
r = max(l)
s = []
for i in range(len(l)):
	m = r - l[i]
	if m != 0:
		s.append(m)
print(*s)


list = [int(x) for x in input().split() if x.isdigit()]
a_b_c = max(list)
list.remove(a_b_c)
letters = []
for y in range(len(list)):
	letters.append(a_b_c - list[y])
for letter in letters:
	print(letter, end=' ')


nums = [int(i) for i in str.split(input(), ' ')]
nums.sort()
b = (nums[0] - nums[1] + nums[2]) // 2
a = nums[0] - b
c = nums[1] - a
print(a, b, c)


l = sorted(map(int, input().split()))
print(l[len(l) - 1] - l[0], l[len(l) - 1] - l[1], l[len(l) - 1] - l[2])


from sys import stdin
a = stdin.readline().split()
A = int(a[0])
B = int(a[1])
C = int(a[2])
D = int(a[3])
E = max(A, B, C, D)
if E == A:
	print(E - B, E - C, E - D)
if E == B:
	print(E - A, E - C, E - D)
if E == C:
	print(E - A, E - B, E - D)
if E == D:
	print(E - A, E - B, E - C)


a = list(map(int, input().split()))
a.sort()
for i in a[:-1]:
	print(a[-1] - i, end=' ')


(ab, ac, bc, abc) = input().split()
(ab, ac, bc, abc) = (int(ab), int(ac), int(bc), int(abc))
numArr = [ab, ac, bc, abc]
abc = max(*numArr)
numArr.remove(abc)
(ab, ac, bc) = (numArr[0], numArr[1], numArr[2])
a = abc - bc
b = abc - ac
c = abc - ab
print(a, b, c)


lst = [int(x) for x in str(input()).split(' ')]
abc = max(lst)
lst.remove(abc)
a = abc - max(lst)
lst.remove(max(lst))
b = abc - max(lst)
c = abc - a - b
print(a, b, c)


arr = list(map(int, input().split()))
arr.sort()
(x, y, z, w) = arr
print(abs(w - x), abs(w - y), abs(w - z))


a = list(map(int, input().split()))
top = a.pop(a.index(max(a)))
print(top - a[0], top - a[1], top - a[2])


inputs = input().split(' ')
for i in range(len(inputs)):
	inputs[i] = int(inputs[i])
max = 0
index = 0
for i in range(4):
	if inputs[i] > max:
		max = inputs[i]
		index = i
for i in range(4):
	if i != index:
		print(max - inputs[i])


inp = input()
lst = list()
for i in inp.split(' '):
	lst.append(int(i))
lst.sort(reverse=True)
sum = lst[0]
a = lst[0] - lst[1]
b = lst[0] - lst[2]
c = lst[0] - lst[3]
print(a, b, c)


arr = sorted([int(x) for x in input().split()])
c = arr[3] - arr[0]
print(arr[1] - c, arr[2] - c, c)


(w, x, y, z) = map(int, input().split())
a = []
a.append(w)
a.append(x)
a.append(y)
a.append(z)
a.sort()
print(a[3] - a[0], a[3] - a[1], a[3] - a[2])


abc = []
nums = [int(x) for x in input().split()]
nums.sort()
for i in range(len(nums) - 1):
	abc.append(nums[3] - nums[i])
print(*abc, sep=' ')


def restore_numbers(arr):
	largest = 0
	sum1 = 0
	sum2 = 0
	sum3 = 0
	for i in arr:
		if i > largest:
			if sum1 == 0:
				sum1 = largest
			elif sum2 == 0:
				sum2 = largest
			else:
				sum3 = largest
			largest = i
		elif sum1 == 0:
			sum1 = i
		elif sum2 == 0:
			sum2 = i
		else:
			sum3 = i
	output_string = ''
	output_string += str(largest - sum1) + ' '
	output_string += str(largest - sum2) + ' '
	output_string += str(largest - sum3) + ' '
	return output_string
arr = [int(x) for x in input().split(' ')]
response = restore_numbers(arr)
print(response)


(a, b, c, d) = map(int, input().strip().split())
x = [a, b, c, d]
x.sort()
print(x[-1] - x[0], x[-1] - x[1], x[-1] - x[2])


def main():
	x = list(map(int, input().split()))
	max1 = max(x)
	ans = []
	for i in x:
		if max1 != i:
			ans.append(max1 - i)
	print(*ans, sep=' ')
main()


(sum, ab, bc, ac) = sorted(map(int, input().split()), reverse=True)
c = sum - ab
b = ac - c
a = bc - c
print('{a} {b} {c}'.format(a=a, b=b, c=c))


(x1, x2, x3, x4) = input().split()
x1 = int(x1)
x2 = int(x2)
x3 = int(x3)
x4 = int(x4)
x = [x1, x2, x3, x4]
h = max(x)
r = []
for i in range(0, 4):
	a = h - x[i]
	if a != 0:
		r.insert(i, a)
m = r[0]
n = r[1]
o = r[2]
print(m, n, o, sep=' ')


def get_numbers(arr):
	arr.sort()
	return (arr[3] - arr[2], arr[3] - arr[1], arr[3] - arr[0])
(n1, n2, n3, n4) = tuple(map(int, input().split()))
print(*get_numbers([n1, n2, n3, n4]))


(a, b, c, d) = map(int, input().split())
if a != max(a, b, c, d):
	if b != max(a, b, c, d):
		x = max(c, d)
		print(a + b - x, x - a, x - b)
	else:
		print(a + c - b, b - c, b - a)
else:
	print(b + c - a, a - b, a - c)


from sys import stdin

def ria(sep=''):
	if sep == '':
		return list(map(int, input().split()))
	else:
		return list(map(int, input().split(sep)))

def rsa(sep=''):
	if sep == '':
		return input().split()
	else:
		return input().split(sep)

def ri():
	return int(input())

def rd():
	return float(input())

def rs():
	return input()
A = ria()
A.sort()
print('{0} {1} {2}'.format(A[3] - A[0], A[3] - A[1], A[3] - A[2]))


numbers = [int(number) for number in input().split()]
numbers.sort()
if numbers[0] == numbers[1] == numbers[2]:
	print(numbers[3] // 3, numbers[3] // 3, numbers[3] // 3)
	quit()
three = numbers[3] - numbers[0]
two = numbers[1] - three
one = numbers[3] - two - three
new = [one, two, three]
new.sort()
print(*new)


(v1, v2, v3, t) = sorted(map(int, input().split()))
print(t - v3, t - v2, t - v1)


a = [int(s) for s in input().split()]
ma = a.pop(a.index(max(a)))
print(ma - a[0], ma - a[1], ma - a[2])


imp = [int(i) for i in input().split()]
a = max(imp)
imp.remove(a)
for i in imp:
	print(a - i, end=' ')


import sys

def get_array():
	return list(map(int, sys.stdin.readline().split()))
num = get_array()
num.sort()
print(num[3] - num[0], num[3] - num[1], num[3] - num[2])


from itertools import permutations as p
Q = list(map(int, input().split()))
add_ = max(Q)
del Q[Q.index(add_)]
a_ = 0
b_ = 0
c_ = 0
for k in p(Q):
	a = add_ - k[1]
	b = k[0] - a
	c = k[1] - b
	if a + b + c == add_:
		a_ = a
		b_ = b
		c_ = c
print(str(a_) + ' ' + str(b_) + ' ' + str(c_))


(p, q, r, s) = sorted(map(int, input().split()))
a = s - p
b = s - q
c = s - r
print(a, b, c)


line = [int(x) for x in input().split()]
line.sort()
a = line[3] - line[0]
b = line[3] - line[1]
c = line[3] - line[2]
print(str(a) + ' ' + str(b) + ' ' + str(c))


mas = [int(a) for a in input().split()]
max = -1
for i in range(4):
	if mas[i] > max:
		max = mas[i]
p = mas.index(max)
mas.pop(p)
mas.insert(0, max)
i = 3
while i != 0:
	print(mas[0] - mas[i], end=' ')
	i -= 1


e = input().split()
(s1, s2, s3, s4) = (int(e[0]), int(e[1]), int(e[2]), int(e[3]))
s = (s1 + s2 + s3 + s4) // 3
a = s - s1
b = s - s2
c = s - s3
d = s - s4
if a == 0:
	print(b, c, d)
elif b == 0:
	print(a, c, d)
elif c == 0:
	print(a, b, d)
else:
	print(a, b, c)


l = list(map(int, input().split()))
p = max(l)
l.remove(p)
d = []
s = max(l)
b = p - s
l.remove(s)
l1 = max(l)
a = p - l1
d.append(a)
d.append(b)
l.remove(l1)
l2 = max(l)
c = p - l2
d.append(c)
result = ''
for i in range(len(d)):
	result = result + str(d[i]) + ' '
print(result)


(num1, num2, num3, num4) = map(int, input().split())
if num1 * 2 == num2 + num3 + num4:
	print(num1 - num2, end=' ')
	print(num1 - num3, end=' ')
	print(num1 - num4, end=' ')
elif num2 * 2 == num1 + num3 + num4:
	print(num2 - num1, end=' ')
	print(num2 - num3, end=' ')
	print(num2 - num4, end=' ')
elif num3 * 2 == num1 + num2 + num4:
	print(num3 - num1, end=' ')
	print(num3 - num2, end=' ')
	print(num3 - num4, end=' ')
elif num4 * 2 == num1 + num2 + num3:
	print(num4 - num1, end=' ')
	print(num4 - num2, end=' ')
	print(num4 - num3, end=' ')


li = list(map(int, input().split()))
li = sorted(li)
print(li[3] - li[0], li[3] - li[1], li[3] - li[2])


import sys
input_s = lambda : sys.stdin.readline().rstrip()
input_int_one = lambda : int(sys.stdin.readline())
input_int_split = lambda : list(map(int, sys.stdin.readline().split()))
input_s_split = lambda : sys.stdin.readline().rstrip().split()
li = sorted(input_int_split())
a_b_c = li[-1]
b = li[0] - li[1] + li[2]
a = li[1] - li[2] + li[0]
c = li[1] - li[0] + li[2]
c //= 2
a //= 2
b //= 2
print(a, b, c)


isVerbose = True

def verbosity(msg):
	if isVerbose:
		print(msg)
inp = list(map(int, input().split()))
inp.sort()
for i in range(3):
	inp[i] = max(inp) - inp[i]
print(*inp[:-1])


arr = [int(i) for i in input().split(' ')]
arr.sort()
for i in range(3):
	print(arr[3] - arr[i], end=' ')


xs = sorted(list(map(int, input().split())))
print(f'{xs[-1] - xs[0]} {xs[-1] - xs[1]} {xs[-1] - xs[2]}')


iv = sorted([int(x) for x in input().split()])
print(*[iv[3] - iv[i] for i in range(3)])


def main():
	A = [int(i) for i in input().split()]
	ma = max(A)
	B = [ma - a for a in A]
	B.sort()
	for b in B[1:]:
		print(b, end=' ')
	print()
main()


def func():
	l = list(map(int, input().strip().split()))
	l.sort()
	a = l[0]
	b = l[1]
	c = l[2]
	d = l[3]
	print(d - a, end=' ')
	print(d - b, end=' ')
	print(d - c, end=' ')
func()


d = sorted([int(i) for i in input().split()], reverse=True)
g = d[0]
for i in range(1, len(d)):
	t = g - d[i]
	print(t, end=' ')


import sys
import copy
sys.setrecursionlimit(1000000)
x = map(int, input().split())
x = sorted(x)
ans = []
for i in range(3):
	ans.append(x[3] - x[i])
print(*ans)


li = list(map(int, input().split()))
maxi = max(li)
abc = []
for i in range(len(li)):
	if maxi != li[i]:
		a = maxi - li[i]
		abc.append(a)
print(abc[0], abc[1], abc[2])


s = input().split()
a = int(s[0])
b = int(s[1])
c = int(s[2])
d = int(s[3])
M = max(a, b, c, d)
g1 = 0
g2 = 0
g3 = 0
g4 = 0
if M != a:
	g1 = M - a
if M != b:
	g2 = M - b
if M != c:
	g3 = M - c
if M != d:
	g4 = M - d
if g1 != 0:
	print(g1, end=' ')
if g2 != 0:
	print(g2, end=' ')
if g3 != 0:
	print(g3, end=' ')
if g4 != 0:
	print(g4, end=' ')


a = list(map(int, input().split()))
m = max(a)
k = a.index(m)
a.pop(k)
print(m - a[0], m - a[1], m - a[2])


n = [int(x) for x in input().split()]
n.sort()
D = []
a = n[-1] - n[0]
D.append(a)
b = n[-1] - n[1]
D.append(b)
c = n[-1] - n[2]
D.append(c)
print(' '.join([str(i) for i in D]))


(x1, x2, x3, x4) = input().split()
tab = [int(x1), int(x2), int(x3), int(x4)]
tab.sort()
taby = []
taby.append(str(tab[-1] - tab[0]))
taby.append(str(tab[-1] - tab[1]))
taby.append(str(tab[-1] - tab[2]))
taby.insert(1, ' ')
taby.insert(3, ' ')
print(''.join(taby))


(a, b, c, d) = map(int, input().split())
li = [a, b, c, d]
x = max(li)
li.remove(x)
for i in range(3):
	li[i] = x - li[i]
	print(li[i], end=' ')


(x, y, z, w) = map(int, input().split())
y = [x, y, z, w]
y = sorted(y)
a = y[3] - y[0]
b = y[3] - y[1]
c = y[3] - y[2]
print(a, b, c)


L = list(map(int, input().split()))
m = max(L)
L.remove(m)
print(' '.join(map(str, [m - x for x in L])))


numbers = input().split()
mapping = map(int, numbers)
numbers = list(mapping)
summation = max(numbers)
numbers.remove(summation)
for i in numbers:
	print(summation - i, end=' ')


numb_list = [int(x) for x in input().split()]
numb_list.remove(max(numb_list))
x1 = numb_list.pop(0)
x2 = numb_list.pop(0)
x3 = numb_list.pop(0)
c = (x1 - x2 - x3) / -2
b = (-x1 + x2 - x3) / -2
a = (-x1 - x2 + x3) / -2
print(int(a), int(b), int(c))


from itertools import permutations
a = list(map(int, input().split()))

def solve(inp):
	for arr in permutations(inp):
		if arr[0] == 2 * arr[3] - arr[1] - arr[2]:
			return [arr[3] - arr[2], arr[3] - arr[1], arr[1] + arr[2] - arr[3]]
print(' '.join(map(str, solve(a))))


nums = sorted([int(i) for i in input().split()])
p = nums[0] - nums[1]
b = (p + nums[2]) // 2
a = nums[0] - b
c = nums[1] - a
print(a, b, c)


l = list(map(int, input().split()))
s = sum(l) // 3
l.remove(s)
r = [s - l[0], s - l[1], s - l[2]]
print(*r)


n = input().split()
for i in range(len(n)):
	n[i] = int(n[i])
n.sort()
a = int((n[0] - n[1] + n[2]) / 2)
b = int((n[1] - n[0] + n[2]) / 2)
c = n[3] - a - b
print(a, b, c)


(x, y, z, w) = list(map(int, input().split()))
mx = max(x, y, z, w)
if mx == x:
	print(mx - y, mx - z, mx - w)
if mx == y:
	print(mx - x, mx - z, mx - w)
if mx == z:
	print(mx - x, mx - y, mx - w)
if mx == w:
	print(mx - x, mx - y, mx - z)


(num1, num2, num3, num4) = sorted(list(map(int, input().split())))
c = num4 - num1
b = num2 - c
a = num1 - b
print(a, b, c)


list1 = list(map(int, input().split()))
maxi = max(list1)
list1.remove(maxi)
list1 = list(map(lambda x: maxi - x, list1))
print(*list1)


l = list(map(int, input().split()))
m_ind = l.index(max(l))
for _ in range(len(l)):
	if _ != m_ind:
		print(f'{l[m_ind] - l[_]} ', end='')
print()


l = list(map(int, input().split()))
s = sorted(l)
a = str(s[-1] - s[0])
b = str(s[-1] - s[1])
c = str(s[-1] - s[2])
print(a + ' ' + b + ' ' + c)


(x, y, z, t) = map(int, input().split())
L = [x, y, z, t]
somme = max(x, y, z, t)
i = L.index(somme)
L.pop(i)
a = somme - L[0]
b = somme - L[1]
c = somme - L[2]
print(a, b, c)


def main():
	nums = list(map(int, input().split()))
	max_num = max(nums)
	nums.remove(max_num)
	print(' '.join([str(max_num - n) for n in nums]))
main()


import math

def main():
	n = list(map(int, input().split()))
	for i in range(len(n) - 1):
		if n[i] > n[i + 1]:
			(n[i], n[i + 1]) = (n[i + 1], n[i])
	a = n[0] + n[1] - n[3]
	b = n[0] + n[2] - n[3]
	c = n[1] + n[2] - n[3]
	print(f'{a} {b} {c}')
main()


import math
import bisect
import itertools
import sys
I = lambda : sys.stdin.readline()
mod = 10 ** 9 + 7

def modu(a, m):
	if a % m:
		return a % m
	return m

def mindiff(a):
	b = a[:]
	b.sort()
	m = 10000000000
	for i in range(len(b) - 1):
		if b[i + 1] - b[i] < m:
			m = b[i + 1] - b[i]
	return m

def lcm(a, b):
	return a * b // math.gcd(a, b)

def merge(a, b):
	i = 0
	j = 0
	c = 0
	ans = []
	while i < len(a) and j < len(b):
		if a[i] < b[j]:
			ans.append(a[i])
			i += 1
		else:
			ans.append(b[j])
			c += len(a) - i
			j += 1
	ans += a[i:]
	ans += b[j:]
	return (ans, c)

def mergesort(a):
	if len(a) == 1:
		return (a, 0)
	mid = len(a) // 2
	(left, left_inversion) = mergesort(a[:mid])
	(right, right_inversion) = mergesort(a[mid:])
	(m, c) = merge(left, right)
	c += left_inversion + right_inversion
	return (m, c)

def is_prime(num):
	if num == 1:
		return False
	if num == 2:
		return True
	if num == 3:
		return True
	if num % 2 == 0:
		return False
	if num % 3 == 0:
		return False
	t = 5
	a = 2
	while t <= int(math.sqrt(num)):
		if num % t == 0:
			return False
		t += a
		a = 6 - a
	return True

def ceil(a, b):
	if a % b == 0:
		return a // b
	else:
		return a // b + 1

def ncr1(n, r):
	s = 1
	for i in range(min(n - r, r)):
		s *= n - i
		s %= mod
		s *= pow(i + 1, mod - 2, mod)
		s %= mod
	return s
a = list(map(int, input().split()))
a.sort()
print(a[-1] - a[0], a[-1] - a[1], a[-1] - a[2])


list1 = [int(i) for i in input().split(' ')]
sum = max(list1)
list1.remove(sum)
print(sum - list1[0], sum - list1[1], sum - list1[2])


arr = sorted(list(map(int, input().split())))
print(arr[-1] - arr[0], arr[-1] - arr[1], arr[-1] - arr[2])


lst = [int(i) for i in input().split()]
m = 0
tmp = 0
for i in range(4):
	if lst[i] > m:
		m = lst[i]
		tmp = i
for i in range(4):
	if i != tmp:
		print(m - lst[i])


import math
e = list(map(int, input().split()))
e.sort()
(a, b, c, d) = (e[0], e[1], e[2], e[3])
print(a + b - d, a + c - d, b + c - d)


l = list(map(int, input().split()))[:4]
m = max(l)
l.remove(m)
lf = []
for i in l:
	i = m - i
	lf.append(i)
print(*lf, sep=' ')


(a, b, c, d) = map(int, input().split())
r = sorted([a, b, c, d])
print(r[-1] - r[0], r[-1] - r[1], r[-1] - r[2])


(a, b, c, d) = map(int, input().split(' '))
ll = [a, b, c, d]
maxx = max(ll)
ll.remove(maxx)
for i in ll:
	print(maxx - i, end=' ')


import bisect
import decimal
from decimal import Decimal
import os
from collections import Counter
import bisect
from collections import defaultdict
import math
import random
import heapq
from math import sqrt
import sys
from functools import reduce, cmp_to_key
from collections import deque
import threading
from itertools import combinations
from io import BytesIO, IOBase
from itertools import accumulate
mod = 10 ** 9 + 7
decimal.getcontext().prec = 46

def primeFactors(n):
	prime = set()
	while n % 2 == 0:
		prime.add(2)
		n = n // 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			prime.add(i)
			n = n // i
	if n > 2:
		prime.add(n)
	return list(prime)

def getFactors(n):
	factors = []
	i = 1
	while i <= math.sqrt(n):
		if n % i == 0:
			if n // i == i:
				factors.append(i)
			else:
				factors.append(i)
				factors.append(n // i)
		i = i + 1
	return factors

def modefiedSieve():
	mx = 10 ** 7 + 1
	sieve = [-1] * mx
	for i in range(2, mx):
		if sieve[i] == -1:
			sieve[i] = i
			for j in range(i * i, mx, i):
				if sieve[j] == -1:
					sieve[j] = i
	return sieve

def SieveOfEratosthenes(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	num = []
	for p in range(2, n + 1):
		if prime[p]:
			num.append(p)
	return num

def lcm(a, b):
	return a * b // math.gcd(a, b)

def sort_dict(key_value):
	return sorted(key_value.items(), key=lambda kv: (kv[1], kv[0]), reverse=True)

def list_input():
	return list(map(int, input().split()))

def num_input():
	return map(int, input().split())

def string_list():
	return list(input())

def decimalToBinary(n):
	return bin(n).replace('0b', '')

def binaryToDecimal(n):
	return int(n, 2)

def DFS(n, s, adj):
	visited = [False for i in range(n + 1)]
	stack = []
	stack.append(s)
	while len(stack):
		s = stack[-1]
		stack.pop()
		if not visited[s]:
			visited[s] = True
		for node in adj[s]:
			if not visited[node]:
				stack.append(node)

def maxSubArraySum(a, size):
	max_so_far = -sys.maxsize - 1
	max_ending_here = 0
	start = 0
	end = 0
	s = 0
	for i in range(0, size):
		max_ending_here += a[i]
		if max_so_far < max_ending_here:
			max_so_far = max_ending_here
			start = s
			end = i
		if max_ending_here < 0:
			max_ending_here = 0
			s = i + 1
	return (max_so_far, start, end)

def lis(arr):
	n = len(arr)
	lis = [1] * n
	for i in range(1, n):
		for j in range(0, i):
			if arr[i] >= arr[j] and lis[i] < lis[j] + 1:
				lis[i] = lis[j] + 1
	maximum = 0
	for i in range(n):
		maximum = max(maximum, lis[i])
	return maximum

def solve():
	(n1, n2, n3, summ) = sorted(num_input())
	print(summ - n1, summ - n2, summ - n3)
t = 1
for _ in range(t):
	solve()


t = list(map(int, input().split()))
r = max(t)
t.remove(r)
(ab, ac, bc) = t
print(r - bc, r - ac, r - ab)


cin = list(map(int, input().split()))
max_index = cin.index(max(cin))
all_sum = max(cin)
cin.pop(max_index)
elements = [all_sum - element for element in cin]
for element in elements:
	print(element)


numbersInput = input()
numbersArr = numbersInput.split()
for num in range(len(numbersArr)):
	numbersArr[num] = int(numbersArr[num])
abc = numbersArr.pop(numbersArr.index(max(numbersArr)))
(ab, bc, ac) = numbersArr
a = abc - bc
b = abc - ac
c = abc - ab
print(a, b, c)


sums = list(map(int, input(' ').split(' ')))
total = max(sums)
integers = [total - i for i in sums]
integers.remove(0)
integers = list(map(str, integers))
print(' '.join(integers))


(a, b, c, d) = map(int, input().split())
x = []
x.append(a)
x.append(b)
x.append(c)
x.append(d)
x.sort()
z = x[-1]
del x[-1]
for i in x:
	print(z - i, end=' ')


x = list(map(int, input().split()))
x.sort()
k = x.pop(-1)
a = k - x[-1]
b = k - x[-2]
c = k - x[-3]
print(a, b, c)


(x, y, z, w) = map(int, input().split())
apbpc = max(x, y, z, w)
if x == apbpc:
	print(apbpc - y, apbpc - w, apbpc - z)
elif y == apbpc:
	print(apbpc - z, apbpc - w, apbpc - x)
elif z == apbpc:
	print(apbpc - y, apbpc - w, apbpc - x)
elif w == apbpc:
	print(apbpc - y, apbpc - x, apbpc - z)


(s1, s2, s3, s) = sorted([int(i) for i in input().split()])
(a, b, c) = (s - s3, s - s2, s - s1)
print(a, b, c)


c = sorted(map(int, input().split()))
print(c[-1] - c[0], c[-1] - c[1], c[-1] - c[2])


t = [int(x) for x in input().split()]
t.sort()
print(max(t) - t[1], max(t) - t[2], max(t) - t[0])


l = list(map(int, input().split()))
l.sort()
(s1, s2, s3, s) = l
a = s - s1
b = s - s2
c = s - s3
print(a, b, c)


nums = [int(i) for i in input().split()]
summ = max(nums)
for i in nums:
	if i != summ:
		print(summ - i)


(v, x, y, z) = sorted(map(int, input().split()))
print(z - v, z - x, z - y)


l = list(map(int, input().split()))
l.sort()
print(l[-1] - l[0], l[-1] - l[1], l[-1] - l[2], sep=' ')


nums = [int(x) for x in input().split(' ')]
[ab, ac, bc, abc] = sorted(nums)
a = abc - bc
b = abc - ac
c = abc - ab
print('{} {} {}'.format(a, b, c))


num = sorted([int(i) for i in input().split()], reverse=True)
res = []
for i in range(len(num)):
	if num[0] - num[i] != 0:
		print(num[0] - num[i], end=' ')


import sys

def input():
	return sys.stdin.readline().strip()

def print(*x, sep=' ', end='\n'):
	return sys.stdout.write(sep.join(map(str, x)) + end)

def read():
	return sys.stdin.read()

def get():
	return map(int, input().split())

def out(*arg):
	if type(arg[0]) == list:
		for i in arg[0]:
			print(i)
	else:
		print(arg)

def main():
	(a, b, c, d) = sorted(list(get()))
	x = (d - 2 * b + a + c) // 3
	print(x, b - c + x, b - a + x)
main()


numbers = [int(x) for x in input().split()]
total = max(numbers)
numbers.remove(total)
for i in range(3):
	print(numbers[i] + numbers[(i + 1) % 3] - total, end=' ')


def sint():
	return int(input())

def sints():
	return map(int, input().split())

def sara():
	return list(map(int, input().split()))

def sstr():
	s = input()
	return list(s[:len(s)])

def main():
	ara = sara()
	ara.sort()
	for i in range(3):
		print(ara[3] - ara[i], end=' ')
	print('')
main()


import sys
m = list(map(int, input().split()))
n = m.index(max(m))
z = []
for i in range(len(m)):
	if i != n:
		z.append(m[n] - m[i])
for i in z:
	print(i, end=' ')


nums = list(map(int, input().split()))
biggest = max(nums)
biggest_ind = nums.index(biggest)
rems = []
for i in range(4):
	if i != biggest_ind:
		rems.append(nums[i])
ans = []
ans.append((rems[0] - rems[1] + rems[2]) // 2)
if biggest - ans[0] == rems[0]:
	ans.append(rems[1] - ans[0])
	ans.append(biggest - ans[0] - ans[1])
else:
	ans.append(rems[0] - ans[0])
	ans.append(biggest - ans[0] - ans[1])
print(*ans)


k = [int(i) for i in input().split()]
p = max(k)
k.remove(p)
x = p - k[0]
y = p - k[1]
z = p - k[2]
print(x, y, z)


s = sorted(map(int, input().split()))
print(s[3] - s[0], s[3] - s[1], s[3] - s[2])


lst = list(map(int, input().split()))
max_value = max(lst)
result = []
for element in lst:
	if element != max_value:
		result.append(max_value - element)
print(*result)


data = [int(i) for i in input().split()]
data.sort()
print(data[-1] - data[0], data[-1] - data[1], data[-1] - data[2])


l = input().split()
m = []
for i in l:
	m.append(int(i))
for i in m:
	if max(m) - i != 0:
		print(max(m) - i, end=' ')


a = list(map(int, input().strip().split()))
m = a[0]
for i in range(1, len(a)):
	if a[i] > m:
		m = a[i]
for i in range(len(a)):
	if m != a[i]:
		print(m - a[i], end=' ')


arr = [int(x) for x in input().split(' ')]
arr.sort()
ab = arr[0]
ac = arr[1]
bc = arr[2]
abc = arr[3]
b = (ab - ac + bc) // 2
a = ab - b
c = bc - b
print(a, b, c)


(val1, val2, val3, val4) = input().split()
vals = []
(a, b, c) = (0, 0, 0)
for val in (int(val1), int(val2), int(val3), int(val4)):
	vals.append(val)
vals.sort()
sum = int(vals[-1])
a = sum - int(vals[-2])
b = sum - int(vals[-3])
c = sum - int(vals[-4])
if a + b + c == int(sum):
	print(str(a) + ' ' + str(b) + ' ' + str(c))


ar = list(map(int, input().split()))
ar = sorted(ar)[::-1]
print(ar[0] - ar[1], ar[0] - ar[2], ar[0] - ar[3])


s = list(map(int, input().split()))
s.sort()
l = s[-1]
print(l - s[0], l - s[1], l - s[2])


(x1, x2, x3, x4) = [int(x) for x in input().split()]
if max(x1, x2, x3, x4) == x1:
	print(x1 - x2, x1 - x3, x1 - x4)
elif max(x1, x2, x3, x4) == x2:
	print(x2 - x1, x2 - x3, x2 - x4)
elif max(x1, x2, x3, x4) == x3:
	print(x3 - x1, x3 - x2, x3 - x4)
else:
	print(x4 - x1, x4 - x3, x4 - x2)


input = input()
numbers = map(int, input.split())
sortnum = sorted(numbers)
for i in sortnum:
	if int(i) != int(sortnum[3]):
		print(int(sortnum[3]) - int(i))


def restoThreeNum(arr):
	m = max(arr)
	if m % 3 == 0 and arr.count(m // 3 + m // 3) > 2:
		return [m // 3, m // 3, m // 3]
	elif arr.index(m) == 0:
		return [m - arr[1], m - arr[2], m - arr[3]]
	elif arr.index(m) == 1:
		return [m - arr[0], m - arr[2], m - arr[3]]
	elif arr.index(m) == 2:
		return [m - arr[1], m - arr[0], m - arr[3]]
	elif arr.index(m) == 3:
		return [m - arr[1], m - arr[2], m - arr[0]]
np = list(map(int, input().split()))
print(*restoThreeNum(np))


lst = list(map(int, input().split()))
max_lst = max(lst)
for i in lst:
	if i != max_lst:
		print(str(max_lst - i), end=' ')


l = list(map(int, input().split()))
max = max(l)
l1 = []
for x in l:
	if x != max:
		l1.append(max - x)
for x in l1:
	print(x, end=' ')


IN = input().split()
A = [0] * 4
for i in range(0, 4):
	A[i] = int(IN[i])
A.sort()
for i in range(0, 3):
	print(A[3] - A[i], end=' ')


(p1, q1, r1, s1) = input().split()
p = int(p1)
q = int(q1)
r = int(r1)
t = int(s1)
s = 0
h = 0
for h in [p, q, r, t]:
	if h - p >= 0 and h - q >= 0 and (h - r >= 0) and (h - t >= 0):
		s = h
		break
if s == p:
	b = s - t
	a = s - r
	c = s - q
	print(a, b, c)
elif s == q:
	b = s - t
	a = s - r
	c = s - p
	print(a, b, c)
elif s == r:
	b = s - t
	a = s - q
	c = s - p
	print(a, b, c)
elif s == t:
	b = s - r
	a = s - q
	c = s - p
	print(a, b, c)


a = list(map(int, input().split()))
a.sort()
x = a[3]
ans1 = a[0] + a[1] - x
ans2 = a[1] + a[2] - x
ans3 = a[0] + a[2] - x
print(ans1, ' ', ans2, ' ', ans3)


(x1, x2, x3, x4) = [int(i) for i in input().split()]
list = []
list.extend([x1, x2, x3, x4])
list.sort()
max = list[3]
sec = list[2]
c = max - sec
thr = list[1]
b = thr - c
fur = list[0]
a = fur - c
list1 = [a, b, c]
for k in range(0, len(list1)):
	m = list1[k]
	print(m, end=' ')
print()


import sys
table = list(map(int, sys.stdin.readline().strip().split()))
table.sort()
a = table[3] - table[0]
b = table[3] - table[1]
c = table[3] - table[2]
m = [a, b, c]
n = map(str, m)
print(' '.join(n))


numbers = list(map(int, input().split()))
numbers.sort()
numbers.pop()
(x, y, z) = numbers
a = (x - y + z) // 2
b = x - a
c = z - a
print(f'{a} {b} {c}')


inin = []
inin = input().split()
x1 = int(inin[0])
x2 = int(inin[1])
x3 = int(inin[2])
x4 = int(inin[3])
count = 0
while True:
	if count != 1:
		temp = x1
		x1 = x2
		x2 = x3
		x3 = x4
		x4 = temp
	a = x1 + x2 - x4
	b = x1 + x3 - x4
	c = -x1 + x4
	if a + b == x1 and a + c == x2 and (b + c == x3) and (a + b + c == x4):
		print(' '.join([str(a), str(b), str(c)]))
		break
	count = count + 1


l = list(map(int, input().split()))
abc = max(l)
l.remove(abc)
ab = l[0]
bc = l[1]
ca = l[2]
print(abs(abc - ab - bc), abs(abc - bc - ca), abs(abc - ca - ab))


a = [int(a) for a in input().split()]
for i in range(3):
	if a[i] > a[i + 1]:
		(a[i], a[i + 1]) = (a[i + 1], a[i])
print(a[3] - a[0], a[3] - a[1], a[3] - a[2])


l = list(map(int, input().split()))
s4 = max(l)
t = ''
for i in range(len(l)):
	a = s4 - l[i]
	if a > 0:
		t = t + str(a) + ' '
print(t)


import sys
inputs = list(map(int, sys.stdin.readline().split()))
high = max(inputs)
inputs.remove(high)
r = []
for i in inputs:
	r.append(high - i)
print(' '.join(map(str, r)))


(x1, x2, x3, x4) = map(int, input().split())
y1 = 0
y2 = 0
y3 = 0
y4 = 0
a = 0
b = 0
c = 0
y3 = (x1 + x2 + x3 + x4) // 3 - x1
y1 = (x1 + x2 + x3 + x4) // 3 - x2
y2 = (x1 + x2 + x3 + x4) // 3 - x3
y4 = (x1 + x2 + x3 + x4) // 3 - x4
if y1 == 0:
	a = y2
	b = y3
	c = y4
if y2 == 0:
	a = y1
	b = y3
	c = y4
if y3 == 0:
	a = y2
	b = y1
	c = y4
if y4 == 0:
	a = y2
	b = y3
	c = y1
print(a, b, c, end=' ')


numbers = list(map(int, input().split(' ')))
numbers.sort()
s = ''
for i in range(3):
	s += str(numbers[-1] - numbers[i])
	if i != 2:
		s += ' '
print(s)


sums = list(input().split(' '))
sums = list(map(int, sums))
sums.sort()
abc = max(sums)
print(abc - sums[0], abc - sums[1], abc - sums[2])


(x1, x2, x3, x4) = sorted(map(int, input().split()))
if 2 <= x1 <= 10 ** 9 and 2 <= x2 <= 10 ** 9 and (2 <= x3 <= 10 ** 9) and (2 <= x4 <= 10 ** 9):
	print(x4 - x1, x4 - x2, x4 - x3)


import sys
(x1, x2, x3, x4) = map(int, sys.stdin.readline().split())
if 2 * x1 == x2 + x3 + x4:
	flag = x1
	print(flag - x2, flag - x3, flag - x4)
elif 2 * x2 == x1 + x3 + x4:
	flag = x2
	print(flag - x1, flag - x3, flag - x4)
elif 2 * x3 == x1 + x2 + x4:
	flag = x3
	print(flag - x1, flag - x2, flag - x4)
elif 2 * x4 == x1 + x2 + x3:
	flag = x4
	print(flag - x1, flag - x2, flag - x3)


n = input().split(' ')
n = [int(x) for x in n]
n = sorted(n)
a = n[-1] - n[0]
b = n[-1] - n[1]
c = n[-1] - a - b
print(a, b, c)


def solve(s):
	s.sort()
	a = s[3] - s[0]
	b = s[3] - s[1]
	c = s[3] - s[2]
	return str(a) + ' ' + str(b) + ' ' + str(c)
s = list(map(int, input().split()))
print(solve(s))


numbers = list(map(int, input().split()))
nn = []
rec = ''
m = max(numbers)
x = numbers.index(max(numbers))
for i in range(0, 4):
	if i != x:
		nn.append(m - numbers[i])
		rec += str(m - numbers[i]) + ' '
print(rec.strip())


(a, b, c, d) = list(map(int, input().split()))
s = max(max(a, b), max(c, d))
if a > d:
	(a, d) = (d, a)
if b > d:
	(b, d) = (d, b)
if c > d:
	(c, d) = (d, c)
print(s - a, s - b, s - c, sep=' ')


s = input()
s = s.split()
s = list(map(int, s))
st = ''
ind = s.index(max(s))
for i in range(len(s)):
	if i != ind:
		st = st + str(s[ind] - s[i]) + ' '
print(st)


t = list(map(int, input().split()))
sum = max(t)
t.remove(sum)
print(sum - t[0], end=' ')
print(sum - t[1], end=' ')
print(sum - t[2])


s = input().split()
l = []
for i in range(len(s)):
	l.append(int(s[i]))
l.sort()
k = []
for i in range(len(s) - 1):
	k.append(str(l[len(s) - 1] - l[i]))
c = ' '.join(k)
print(c)


inp = input().split()
l = []
(a, b, c) = (0, 0, 0)
for num in inp:
	num = int(num)
	l.append(num)
l.sort()
y = l[-1]
l = l[:-1]
a = y - l[0]
for num in l:
	if num == a:
		l.remove(num)
b = abs(a - l[1])
c = y - (a + b)
print(a, b, c)


numList = list(map(int, input().split(' ')))
x = max(numList)
numList.pop(numList.index(x))
(x1, x2, x3) = numList
a = x1 + x3 - x
b = x - x3
c = x3 + x2 - x
print('{b} {a} {c}'.format(a=a, b=b, c=c))


li = list(map(int, input().split()))
sum = max(li)
l = [sum - i for i in li if i < max(li)]
print(' '.join((str(j) for j in l)))


while 1:
	try:
		x = [int(e) for e in input().split()]
		x.sort()
	except:
		break
	a = x[0] + x[1] - x[3]
	b = x[0] + x[2] - x[3]
	c = x[1] + x[2] - x[3]
	print(a, b, c)


n1 = list(map(int, input().split()))
n1 = sorted(n1)
print(n1[3] - n1[0], n1[3] - n1[2], n1[3] - n1[1])


l = [int(x) for x in input().split()]
ma = max(l)
for each in l:
	if each != ma:
		print(ma - each, end=' ')


a = list(map(int, input().split()))
a.sort()
res = (a[0] + a[2] - a[1]) // 2
res2 = (a[0] + a[1] - a[2]) // 2
res3 = a[3] - res - res2
print(res, res2, res3)


a = 0
b = 0
c = 0
d = 0
lst = list(map(int, input().strip().split()))[:4]
lst.sort()
a = lst[0]
b = lst[1]
c = lst[2]
d = lst[3]
print(d - a, d - b, d - c)


a = [int(i) for i in input().split()]
m = max(a)
j = a.index(m)
for i in range(4):
	if i != j:
		print(m - a[i])


n = list(map(int, input().split()))
maxi = max(n)
res = [str(maxi - num) for num in n]
res.remove('0')
print(' '.join(res))


l = [int(i) for i in input().split()]
l.sort()
m = l[3]
print(m - l[0], m - l[1], m - l[2])


line1 = [int(x) for x in input().split()]
m = max(line1)
line1.remove(m)
print(' '.join((str(m - x) for x in line1)))


num = sorted(list(map(int, input().split())), reverse=True)
a = num[0] - num[1]
b = num[2] - a
c = num[0] - (a + b)
print(a, b, c)


def main():
	n = [int(a) for a in input().split(' ')]
	t = max(n)
	n.pop(n.index(t))
	for s in n:
		print(t - s, end=' ')
main()


t = input()
l = list(map(int, t.split(' ')))
p = max(l)
s = ''
for i in l:
	if i != p:
		s = s + str(p - i) + ' '
print(s)


four_number = list(map(int, input().split()))
sumof_abc = max(four_number)
four_number.remove(sumof_abc)
print(sumof_abc - four_number[0], sumof_abc - four_number[1], sumof_abc - four_number[2])


pair = list(map(int, input().split(' ')))
pair.sort()
pair[0] = pair[3] - pair[0]
pair[1] = pair[3] - pair[1]
pair[2] = pair[3] - pair[2]
pair = [str(i) for i in pair]
print(' '.join(pair[:3]))


l = []
lst = list(map(int, input().split()))
mx = max(lst)
for i in lst:
	if mx != i:
		l.append(mx - i)
print(*l)


from __future__ import print_function
x = input().split()
for i in range(len(x)):
	x[i] = int(x[i])
summa = max(x)
x.remove(summa)
out = [summa - x_i for x_i in x]
for i in out:
	print(i, end=' ')


(*inplist,) = map(int, input().split())
inplist = sorted(inplist)
print(inplist[-1] - inplist[0], sep=' ')
print(inplist[-1] - inplist[1], sep=' ')
print(inplist[-1] - inplist[2], sep=' ')


def function(arr):
	arr.sort()
	new = []
	for x in range(3):
		new.append(str(arr[3] - arr[x]))
	print(' '.join(new))
arr = list(map(int, input().strip().split()))
function(arr)


l = [int(n) for n in input().split()]
l = sorted(l)
print(l[3] - l[0], end=' ')
print(l[3] - l[1], end=' ')
print(l[3] - l[2], end=' ')


s = input().split()
for i in range(len(s)):
	s[i] = int(s[i])
maxi = 0
for i in range(len(s) - 1):
	if s[maxi] <= s[i + 1]:
		maxi = i + 1
for i in range(len(s)):
	if i == maxi:
		continue
	print(s[maxi] - s[i], end=' ')


z = input
from math import ceil
(a, b, c, d) = sorted(list(map(int, z().split())))
print(abs(d - (b + c)), abs(d - (a + c)), abs(d - (a + b)))


(a, b, c, d) = map(int, input().split())
mas = [a, b, c, d]
m1 = max(mas)
for i in range(len(mas)):
	if mas[i] != m1:
		print(m1 - mas[i])


(x1, x2, x3, s) = sorted(list(map(int, input().split())))
c = s - x1
a = x2 - c
b = x3 - c
print(a, b, c)


l1 = list(map(int, input().split()))
l1.sort()
l = []
s = 0
for i in range(len(l1)):
	s = s + l1[i]
n = int(s / 3)
for i in range(len(l1) - 1):
	l.append(n - l1[i])
print(*l)


num = input().split()
l = []
for i in num:
	i = int(i)
	l.append(i)
summ = int(max(l))
lt = []
for i in l:
	if summ - i != 0:
		lt.append(summ - i)
for i in lt:
	print(i, end=' ')


d = list(map(int, input().split()))
s = max(d)
for k in d:
	if s - k != 0:
		print(s - k, end=' ')


(n1, n2, n3, n4) = map(int, input().split())
ls = [n1, n2, n3, n4]
combine3 = (n1 + n2 + n3 + n4) // 3
res = []
for num in ls:
	if num != combine3:
		res.append(combine3 - num)
print(*res)


inp = [int(i) for i in input().split()]
m = max(inp)
inp.remove(m)
print(m - inp[2], m - inp[1], m - inp[0])


(p, q, r, s) = map(int, input().split())
abc = max(p, q, r, s)
ls1 = [p, q, r, s]
flg = ls1.index(abc)
ls2 = []
for i in range(0, 4):
	if i == flg:
		continue
	else:
		ls2.append(abc - ls1[i])
a = ls2[0]
b = ls2[1]
c = ls2[2]
print(a, b, c, sep=' ')


(a, b, c, d) = [int(x) for x in input().split()]
m = 0
ls = list()
ls.append(a)
ls.append(b)
ls.append(c)
ls.append(d)
l = max(ls)
for i in range(0, 4):
	if ls[i] == l:
		continue
	else:
		print(l - ls[i], end=' ')


l = list(map(int, input().split()))
m = max(l)
l[0] = m - l[0]
l[1] = m - l[1]
l[2] = m - l[2]
l[3] = m - l[3]
l.remove(min(l))
print(*l, sep=' ')


def main(A, B, C, D):
	c = abs(D - A)
	a = abs(D - B)
	b = abs(D - C)
	return (c, a, b)
try:
	while True:
		(a, b, c, d) = sorted(list(map(int, input().split())))
		(a, b, c) = main(a, b, c, d)
		print(a, '', b, '', c)
except:
	pass


ipt = input().split()
for x in range(0, len(ipt)):
	ipt[x] = int(ipt[x])
ipt = sorted(ipt)
a = ipt[0] + ipt[1] - ipt[3]
b = ipt[1] + ipt[2] - ipt[3]
c = ipt[0] + ipt[2] - ipt[3]
print(a, ' ', b, ' ', c)


(a, b, c, tot) = sorted(map(int, input().split()))
print(tot - c, tot - b, tot - a)


x = input().split()
y = [int(i) for i in x]
a = max(y)
for j in y:
	if a - j != 0:
		print(a - j, end=' ')
	else:
		continue


array = [int(item) for item in input().split()]
abc = max(array)
array.remove(max(array))
a = abc - array.pop()
b = abc - array.pop()
c = abc - array.pop()
print(str(a) + ' ' + str(b) + ' ' + str(c))


(a, b, c, d) = map(int, input().split())
x = []
x.append(a)
x.append(b)
x.append(c)
x.append(d)
x.sort()
y = []
for i in range(0, 3):
	y.append(x[3] - x[i])
y.sort()
print(*y)


import sys
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())

def foo():
	li = inlt()
	li = sorted(li)
	a = li[3] - li[0]
	b = li[3] - li[1]
	c = li[3] - li[2]
	print(a, b, c)
foo()


n = list(map(int, input().split()))
if n[0] > n[1] and n[0] > n[2] and (n[0] > n[3]):
	print(n[0] - n[1], n[0] - n[2], n[0] - n[3])
if n[1] > n[0] and n[1] > n[2] and (n[1] > n[3]):
	print(n[1] - n[0], n[1] - n[2], n[1] - n[3])
if n[2] > n[1] and n[2] > n[0] and (n[2] > n[3]):
	print(n[2] - n[1], n[2] - n[0], n[2] - n[3])
if n[3] > n[1] and n[3] > n[2] and (n[3] > n[0]):
	print(n[3] - n[1], n[3] - n[2], n[3] - n[0])


abcd = list(map(int, input().split()))
abcd = sorted(abcd)
ans = []
m = max(abcd)
for i in abcd:
	if i != m:
		ans.append(m - i)
print(*ans[::-1])


k = list(map(int, input().split()))
s = sorted(k)
for i in s:
	t = s[-1] - i
	if t == 0:
		continue
	else:
		print(t, end=' ')


(x1, x2, x3, x4) = [int(i) for i in input().split()]
sumall = max(x1, x2, x3, x4)
a = sumall - x1
b = sumall - x2
c = sumall - x3
d = sumall - x4
arr = []
for i in (a, b, c, d):
	if i != 0:
		arr.append(i)
print(' '.join((str(x) for x in arr)))


a = [int(x) for x in input().split(' ')]
m = max(a)
for i in a:
	if i == m:
		continue
	print(m - i, end=' ')


ao = list(map(int, input().split()))
p = max(ao)
if p == ao[0]:
	a = p - ao[1]
	b = p - ao[2]
	c = p - ao[3]
elif p == ao[1]:
	a = p - ao[0]
	b = p - ao[2]
	c = p - ao[3]
elif p == ao[2]:
	a = p - ao[0]
	b = p - ao[1]
	c = p - ao[3]
elif p == ao[3]:
	a = p - ao[0]
	b = p - ao[1]
	c = p - ao[2]
print(c, b, a)


l = list(map(int, input().split()))
xm = max(l)
for i in range(4):
	if l[i] == xm:
		(l[i], l[3]) = (l[3], l[i])
c = xm - l[0]
b = xm - l[2]
a = xm - l[1]
print(a, b, c)


p = list((int(x) for x in input().split()))
p.sort()
a = int((p[0] + p[1] - p[2]) / 2)
b = int((p[1] + p[2] - p[0]) / 2)
c = int((p[0] + p[2] - p[1]) / 2)
print(a, b, c)


li = (n1, n2, n3, n4) = list(input().split())
li = list(map(int, li))
max_num = max(li)
li.remove(max(li))
print(max_num - int(li[0]), max_num - int(li[1]), max_num - int(li[2]))


l = list(map(int, input().split()))
max = l[0]
l1 = []
a = 0
b = 0
c = 0
for i in l:
	if i > max:
		max = i
for i in l:
	if i != max:
		l1.append(i)
x = l1[0] - l1[1]
a = int((l1[2] + x) / 2)
b = l1[0] - a
c = l1[1] - b
print(a, b, c)


a = [int(e) for e in input().split()]
a.sort()
print(a[-1] - a[0], a[-1] - a[1], a[-1] - a[2])


import itertools
l = list(map(int, input().split()))
for a in itertools.permutations(l, 4):
	(x, y, z, t) = a
	p = [x + y - t, t - y, t - x]
	if all([x >= 0 for x in p]) and p[1] + p[2] == z:
		print(' '.join(list(map(str, p))))
		break


l = [int(x) for x in input().split()]
m = l.index(max(l))
ma = l[m]
del l[m]
print(ma - l[0], ma - l[1], ma - l[2])


a = list(map(int, input().split()))
s = max(a)
for i in a:
	num = s - i
	if num != 0:
		print(num, end=' ')


x = [int(p) for p in input().split()]
m = max(x)
del x[x.index(m)]
for i in x[::-1]:
	print(m - i, end=' ')


numbers = map(int, input().split())
worker = sorted(numbers, reverse=True)
total = worker[0]
a = total - worker[1]
b = total - worker[2]
c = total - worker[3]
print(a, b, c)


list = [int(i) for i in input().split()]
list.sort()
temp = list[:3]
som = sum(temp)
print(int((som - 2 * temp[0]) / 2), int((som - 2 * temp[1]) / 2), int((som - 2 * temp[2]) / 2))


(e, f, g, h) = input().split()
e = int(e)
f = int(f)
g = int(g)
h = int(h)
abc = max(e, f, g, h)
if e != abc:
	print(abc - e, end=' ')
if f != abc:
	print(abc - f, end=' ')
if g != abc:
	print(abc - g, end=' ')
if h != abc:
	print(abc - h, end=' ')


l = [int(i) for i in input().split()]
l.sort()
a = l.pop()
for i in l:
	print(a - i, end=' ')
print()


li = [int(x) for x in input().split()]
m = max(li)
for i in li:
	if i != m:
		print(m - i, end=' ')


input_sums = input()
(w, x, y, z) = input_sums.split()
sums = [int(w), int(x), int(y), int(z)]
sums.sort(reverse=False)
max_sums = sums[3]
next_max = sums[2]
a = max_sums - next_max
smallest = sums[0]
b = smallest - a
subtract = b
if a > b:
	subtract = a
c = next_max - subtract
print(a, b, c)


nums = list(map(int, input().split(' ')))
nums.sort()
print(' '.join(map(str, [nums[-1] - nums[i] for i in range(3)])))


da = list(map(int, input().split()))
su = da[0]
for i in da:
	if i > su:
		su = i
for i in da:
	if su - i > 0:
		print(su - i, end=' ')


q = list(map(int, input().split()))
z = max(q)
q.remove(max(q))
for i in q:
	print(z - i, end=' ')


a = map(int, input().split())
a = list(a)
a.sort()
(ab, ca, bc, abc) = map(int, a)
c = abc - ab
b = abc - ca
a = abc - bc
print(abs(a), abs(b), abs(c))


a = input()
b = [int(x) for x in a.split()]
b.sort()
l = int(b[0])
m = int(b[1])
n = int(b[2])
o = int(b[3])
a = o - l
b = o - m
c = o - n
print(a, b, c)


input_raw = input()
input_all = input_raw.split(' ')
for i in range(4):
	input_all[i] = int(input_all[i])
total_inputs = input_all[0] + input_all[1] + input_all[2] + input_all[3]
aplusbplusc = total_inputs / 3
for index in range(4):
	if input_all[index] == aplusbplusc:
		input_all.pop(index)
		break
for index in range(3):
	input_all[index] = int(aplusbplusc - input_all[index])
print(input_all[0], input_all[1], input_all[2])


n = input()
li = []
for i in n.split():
	li.append(int(i))
li.sort()
print(li[3] - li[0], li[3] - li[1], li[3] - li[2])


a = list(map(int, input().split()))
b = max(a)
c = 0
ans = ''
for i in range(len(a)):
	if max(a) != a[i]:
		if c == 0:
			x = max(a) - a[i]
			ans = ans + str(x) + ' '
		if c == 1:
			y = max(a) - a[i]
			ans = ans + str(y) + ' '
		if c == 2:
			z = max(a) - a[i]
			ans = ans + str(z)
		c += 1
print(ans)


(x1, x2, x3, x4) = map(int, input().split())
L = []
L.append(x1)
L.append(x2)
L.append(x3)
L.append(x4)
L.sort()
if 2 <= x1 <= 10 ** 9 and 2 <= x2 <= 10 ** 9 and (2 <= x3 <= 10 ** 9) and (2 <= x4 <= 10 ** 9):
	a = max(L) - L[2]
	b = max(L) - L[1]
	c = max(L) - L[0]
	print(a, b, c)


xs = list(map(int, input().split()))
x1 = max(xs)
xs.remove(x1)
x2 = max(xs)
xs.remove(x2)
x3 = max(xs)
xs.remove(x3)
x4 = max(xs)
a = x1 - x2
b = x1 - x3
c = x1 - x4
print(a, b, c)


L = list(map(int, input().split()))
L = sorted(L)
print(str(L[3] - L[0]) + ' ' + str(L[3] - L[1]) + ' ' + str(L[3] - L[2]))


import sys
line = sys.stdin.readline().strip('\n')
num = list(map(int, line.split()))
num.sort()
print(num[-1] - num[0], ' ', num[-1] - num[1], ' ', num[-1] - num[2])


l = sorted(list(map(int, input().split())))
l1 = []
l1.append(l[3] - l[2])
l1.append(l[3] - l[1])
l1.append(l[3] - l[0])
print(*l1)


ele = list(map(int, input().split()))
ele.sort(reverse=True)
a = ele[0] - ele[3]
b = ele[1] - a
c = ele[2] - a
print(a, b, c)


abcd = list(map(int, input().split()))
abcd.sort()
ab = abcd[0] + abcd[1]
a1 = abcd[-1] - ab
ac = abcd[0] + abcd[2]
c1 = abcd[-1] - ac
bc = abcd[1] + abcd[2]
b1 = abcd[-1] - bc
print(abs(a1), abs(c1), abs(b1))


arr = list(map(int, input().split()))
mx = max(arr)
idx = arr.index(mx)
res = [mx - arr[i] for i in range(4) if i != idx]
print(' '.join(map(str, res)))


n = list(map(int, input().split()))
mav = max(n)
n.remove(mav)
print(mav - n[0], end=' ')
print(mav - n[1], end=' ')
print(mav - n[2], end=' ')


n = [int(i) for i in input().split()]
n = sorted(n)
x1 = max(n) - n[2]
x2 = max(n) - n[1]
x3 = max(n) - n[0]
if max(n) != x1 and max(n) != x2 and (max(n) != x3):
	print(x1, x2, x3)
else:
	print(max(n), min(n), min(n))


def main():
	s = list(map(int, input().split()))
	s.sort()
	c = s[3] - s[2]
	b = s[1] - c
	a = s[0] - c
	print(a, b, c)
main()


(a, b, c, d) = list(map(int, input().split()))
m = max(a, b, c, d)
if m == a:
	print(a - b, a - c, a - d)
elif m == b:
	print(b - a, b - c, b - d)
elif m == c:
	print(c - a, c - b, c - d)
else:
	print(d - a, d - b, d - c)


(x, y, z, w) = map(int, input().strip().split())
the_sum = max(x, y, z, w)
for i in [x, y, z, w]:
	if i != the_sum:
		print(the_sum - i, end=' ')


(a, b, c, d) = map(int, input().split())
s = max(a, b, c, d)
if s != a:
	print(s - a, end=' ')
if s != b:
	print(s - b, end=' ')
if s != c:
	print(s - c, end=' ')
if s != d:
	print(s - d, end=' ')


nums = [int(num) for num in input().split()]

def solve(nums):
	nums = sorted(nums)
	c = nums[0] + nums[1] - nums[3]
	b = nums[0] + nums[2] - nums[3]
	a = nums[1] + nums[2] - nums[3]
	return (a, b, c)
sol = solve(nums)
for item in sol:
	print(item)


import sys, itertools, math
(s1, s2, s3, s4) = sorted([int(i) for i in sys.stdin.readline().strip().split(' ')])
c = s4 - s1
b = s3 - c
a = s1 - b
print(a, b, c)


l = list(map(int, input().strip().split()))
m = max(l)
for i in l:
	if i != m:
		print(m - i, end=' ')


(a, b, c, d) = map(int, input().split())
v = sorted([a, b, c, d])
print(v[3] - v[0], v[3] - v[1], v[3] - v[2])


sums = [int(x) for x in input().split()]
sums.sort()
a = sums[3] - sums[2]
b = sums[0] - a
c = sums[2] - b
print(a, b, c)


n = list(map(int, input().split()))
n.sort()
n1 = n[3] - n[2]
n2 = abs(n[1] - n1)
n3 = n[3] - n1 - n2
print(n1, n2, n3)


l = list(map(int, input().split()))
l.sort()
k = l[3]
for i in range(3):
	print(k - l[i], end=' ')
print('\n')


(x1, x2, x3, x4) = map(int, input().split())
arr = [x1, x2, x3, x4]
arr.sort()
print(arr[3] - arr[0], arr[3] - arr[1], arr[3] - arr[2])


nums = list(map(int, input().split()))
highest = max(nums)
highestIn = nums.index(highest)
out = []
for i in range(len(nums)):
	if i != highestIn:
		out.append(highest - nums[i])
print(' '.join(map(str, out)))


(a, b, c, d) = map(int, input().split())
maxm = max(a, b, c, d)
if maxm == d:
	print(maxm - c, maxm - b, maxm - a)
if maxm == a:
	print(maxm - c, maxm - b, maxm - d)
if maxm == b:
	print(maxm - c, maxm - d, maxm - a)
if maxm == c:
	print(maxm - d, maxm - b, maxm - a)


(sab, sac, sbc, sabc) = map(int, input().split())
total = max(max(sab, sac), max(sbc, sabc))
c = total - sab
b = total - sac
a = total - sbc
if c == 0:
	c = total - sabc
if b == 0:
	b = total - sabc
if a == 0:
	a = total - sabc
print(a, b, c)


(m, n, o, p) = input().split()
m = int(m)
n = int(n)
o = int(o)
p = int(p)
maximo = max(m, n, o, p)
if maximo == m:
	print(maximo - n, maximo - o, maximo - p)
if maximo == n:
	print(maximo - m, maximo - o, maximo - p)
if maximo == o:
	print(maximo - n, maximo - m, maximo - p)
if maximo == p:
	print(maximo - n, maximo - o, maximo - m)


def Three(l):
	res = sum(l) // 3
	r = ''
	for i in range(4):
		if res != l[i]:
			r = r + str(res - l[i]) + ' '
	return r
l = [int(n) for n in input().split()]
print(Three(l))


lst = list(map(int, input().split()))
lst.sort(reverse=True)
n = len(lst)
for i in range(1, n):
	print(lst[0] - lst[i])


a = [int(x) for x in input().split()]
a = sorted(a)
hasil1 = max(a) - min(a)
hasil2 = a[1] - hasil1
hasil3 = min(a) - hasil2
print(hasil3, hasil2, hasil1)


x = input()
y = x.split()
w = [int(d) for d in y]
w.sort(reverse=True)
sum = w[0]
no = []
for i in range(1, 4):
	no.append(sum - w[i])
print(no[0], no[2], no[1])


l = [int(i) for i in input().split()]
s = max(l)
l1 = []
for i in l:
	l1 += [s - i]
l1.remove(0)
for i in l1:
	print(i, end=' ')


arr = list(map(int, input().split()))
summary = max(arr)
answer = [summary - i for i in arr if summary - i > 0]
print(' '.join(list(map(str, answer))))


(a1, a2, a3, a4) = map(int, input().split())
sm = max(a1, a2, a3, a4)
if a1 == sm:
	ab = a2
	ac = a3
	bc = a4
if a2 == sm:
	ab = a4
	ac = a3
	bc = a1
if a3 == sm:
	ab = a2
	ac = a4
	bc = a1
if a4 == sm:
	ab = a2
	ac = a3
	bc = a1
a = 0
b = 0
c = 0
a = sm - bc
b = sm - ac
c = sm - ab
print(a, b, c)


a = input().split()
for s in range(4):
	a[s] = int(a[s])
l = max(a)
j = ''
for i in range(4):
	if l - a[i] != 0:
		j = j + str(l - a[i]) + ' '
	else:
		pass
print(j)


l = list(map(int, input().split()))
m = max(l)
l.remove(m)
print(m - l[2], end=' ')
print(m - l[1], end=' ')
print(m - l[0])


(n1, n2, n3, n4) = map(int, input().split())
a = max((max(n1, n2), max(n3, n4)))
b = [a - n1] + [a - n2] + [a - n3] + [a - n4]
for i in b:
	if i != 0:
		print(i, end=' ')


a = input().split()
p = int(a[0])
q = int(a[1])
r = int(a[2])
s = int(a[3])
o = max(p, q, r, s)
x = o - p
y = o - q
z = o - r
u = o - s
if x == 0:
	print(y, z, u)
elif y == 0:
	print(x, z, u)
elif z == 0:
	print(x, y, u)
elif u == 0:
	print(x, y, z)


a = sorted(list(map(int, input().split())))
print(a[3] - a[2], end=' ')
print(a[3] - a[1], end=' ')
print(-a[3] + a[2] + a[1])


def main():
	(a, b, c, d) = map(int, input().split())
	temp = max(a, b, c, d)
	if temp - a > 0:
		print(temp - a)
	if temp - b > 0:
		print(temp - b)
	if temp - c > 0:
		print(temp - c)
	if temp - d > 0:
		print(temp - d)
main()


(a, b, c, d) = map(int, input().split(' '))
k = [a, b, c, d]
m = max(k)
ans = []
for i in k:
	if i != m:
		ans.append(str(m - i))
print(' '.join(ans))


(n, m, k, l) = map(int, input().split())
ma = max(n, m, k, l)
if ma == n:
	print(abs(ma - (m + k)), abs(ma - (m + l)), abs(ma - (k + l)))
elif ma == m:
	print(abs(ma - (n + k)), abs(ma - (n + l)), abs(ma - (k + l)))
elif ma == k:
	print(abs(ma - (m + n)), abs(ma - (m + l)), abs(ma - (n + l)))
elif ma == l:
	print(abs(ma - (m + k)), abs(ma - (m + n)), abs(ma - (k + n)))


def main():
	list1 = list(map(int, input().split(' ')))
	x4 = 0
	for i in list1:
		sum1 = 0
		for j in range(len(list1)):
			if list1[j] != i:
				sum1 += list1[j]
		if 2 * i == sum1:
			x4 = i
			break
	list1.remove(x4)
	x1 = list1[0]
	x2 = list1[1]
	x3 = list1[2]
	print(x1 + x2 - x4, x1 + x3 - x4, x2 + x3 - x4)
main()


l = input().split()
l = [int(i) for i in l]
m = max(l)
l.remove(m)
for n in l:
	print(m - n, end=' ')


ls = list(map(int, input().split()))
ls.sort()
(x1, x2, x3, x4) = map(int, ls)
c = x4 - x1
b = x4 - x2
a = x4 - x3
print(a, b, c)


lst = list(map(int, input().split()))
maxi = max(lst)
for num in lst:
	if num != maxi:
		print(maxi - num, end=' ')


(x, y, z, n) = sorted([int(z) for z in input().split()])
print(f'{n - x} {n - y} {n - z}')


(x1, x2, x3, x4) = sorted(map(int, input().split()))
X = (x1 + x2 - x3) // 2
Y = x2 + x3 - x4
Z = x4 - X - Y
print(X, Y, Z)


(x, y, z, s) = sorted((int(x) for x in input().split()))
print(s - x, s - y, s - z)


v = input()
arr = v.split()
maxs = 0
for i in arr:
	tu = int(i)
	maxs = max(tu, maxs)
ans = []
for i in arr:
	vv = int(i)
	k = maxs - vv
	ans.append(k)
ar2 = sorted(ans)
k = ''
for i in range(1, 4):
	if i == 3:
		k += str(ar2[i])
	else:
		k += str(ar2[i])
		k += ' '
print(k)


enter = input()
e = enter.split(' ')
x = (int(e[0]), int(e[1]), int(e[2]), int(e[3]))
x = sorted(x)
a = x[3] - x[2]
b = x[3] - x[1]
c = x[3] - x[0]
print(a, b, c)


nums = [int(i) for i in input().split()]
abc = max(nums)
nums.remove(abc)
ans = ''
for i in nums:
	ans += str(abc - i) + ' '
print(ans)


n = map(int, input().split())
n = list(n)
n.sort()
x0 = n[3] - n[0]
x1 = n[3] - n[1]
x2 = n[3] - n[2]
print(x0, x1, x2)


xs = input()
(x1, x2, x3, x4) = (int(i) for i in xs.split())
lst = sorted([x1, x2, x3, x4])
c = max(lst) - lst[2]
b = lst[1] - c
a = lst[0] - c
print(' '.join((str(i) for i in sorted([a, b, c]))))


(s1, s2, s3, s4) = sorted(list(map(int, input().split())))
print(s4 - s1, s4 - s2, s4 - s3)


numbers = [int(i) for i in input().split()]
m = max(numbers)
numbers.remove(m)
(a, b, c) = (m - numbers[0], m - numbers[1], m - numbers[2])
print(a, b, c)


sums = [int(i) for i in input().split(' ')]
a_b_c_sum = max(sums)
for partial_sum in sums:
	if a_b_c_sum - partial_sum:
		print(a_b_c_sum - partial_sum, end=' ')


n = list(map(int, input().split()))
n.sort()
sum3 = n.pop()
ab = n.pop()
c = sum3 - ab
bc = n.pop()
b = bc - c
a = ab - b
print(a, end=' ')
print(b, end=' ')
print(c, end='')


lst = list(map(int, input().split()))
l = sorted(lst)
max = l[3]
a = l[3] - l[0]
b = l[3] - l[1]
c = l[3] - l[2]
print(a, b, c, sep=' ')


l = [int(x) for x in input().split()]
m = max(l)
l.remove(m)
print(m - l[0], end=' ')
print(m - l[1], end=' ')
print(m - l[2], end=' ')


l = list(map(int, input().split()[:4]))
m = max(l)
n = min(l)
l.remove(m)
l.remove(n)
b = n + l[0] - m
a = n + l[1] - m
c = l[0] + l[1] - m
print(a, b, c)


numbers = input().split(' ')
guessed_numbers = []
output = ' '
numbers = sorted(numbers)
for i in range(1, len(numbers)):
	if int(numbers[len(numbers) - 1]) > int(numbers[0]):
		guessed_numbers.append(int(numbers[len(numbers) - 1]) - int(numbers[i - 1]))
	else:
		guessed_numbers.append(int(numbers[0]) - int(numbers[i]))
for number in guessed_numbers:
	output += str(number) + ' '
print(output[1:])


ls = list(map(int, input().split()))
ls.sort()
A = ls[3] - ls[0]
B = ls[3] - ls[1]
C = ls[3] - ls[2]
print(A, B, C)


x = input().split()
bz = 0
for i in x:
	if int(i) > bz:
		bz = int(i)
lis = []
for i in x:
	if int(i) != bz:
		lis += [str(bz - int(i))]
print(lis[0], lis[1], lis[2])


line = [int(i) for i in input().split()]
total = max(line)
answer = ''
for j in line:
	if total - j != 0:
		answer += str(total - j) + ' '
print(answer)


(x, y, z, k) = sorted([int(i) for i in input().split()])
print(k - x, k - y, k - z)


(a, b, c, d) = map(int, input().split())
largest = max(a, b, c, d)
if largest == a:
	print(largest - b, largest - c, largest - d)
elif largest == b:
	print(largest - a, largest - c, largest - d)
elif largest == c:
	print(largest - b, largest - a, largest - d)
else:
	print(largest - b, largest - c, largest - a)


x = [int(q) for q in input().split()]
y = sorted(x)
m = max(y)
print(m - y[0], m - y[1], m - y[2])


(sum1, sum2, sum3, sum4) = [int(x) for x in input().split()]
list_sum = [sum1, sum2, sum3, sum4]
list_sum.sort()
a = 0
b = 0
c = 0
c = int(list_sum[3]) - int(list_sum[0])
a = int(list_sum[1]) - int(list_sum[3]) + int(list_sum[0])
b = int(list_sum[2]) - int(list_sum[3]) + int(list_sum[0])
print(a, b, c)


x = list(map(int, input().split()))
r = []
mx = max(x)
for i in range(0, len(x)):
	if x[i] != mx:
		r.append(mx - x[i])
print(r[0], r[1], r[2])


a = input()
x = [int(i) for i in a.split()]
b = []
x.sort(reverse=True)
maks = max(x)
for i in range(1, len(x)):
	b.append(maks - x[i])
for i in b:
	print(i, end=' ')


from sys import setcheckinterval, stdin, setrecursionlimit
setcheckinterval(1000)
setrecursionlimit(10 ** 6)
iin = lambda : int(stdin.readline())
lin = lambda : list(map(int, stdin.readline().split()))
from itertools import combinations as cb
(a, b, c, d) = lin()
sm = a + b + c + d
ll = list(cb((a, b, c, d), 3))
for (i, j, k) in ll:
	sm1 = i + j + k
	z = sm - sm1
	if z * 2 == sm1:
		(x1, x2) = (i - j + k, j - i + k)
		x1 //= 2
		x2 //= 2
		x3 = z - x1 - x2
		print(x1, x2, x3)
		break


arr = sorted(list(map(int, input().split())))
print(' '.join([str(arr[3] - arr[i]) for i in range(3)]))


x = [int(i) for i in input().split()]
x.sort()
c = x[3] - x[0]
b = x[2] - c
a = x[0] - b
print(a, end=' ')
print(b, end=' ')
print(c, end=' ')


z = list(map(int, input().split()))
z = sorted(z)
m = z[-1]
print(m - z[0], m - z[1], m - z[2])


while True:
	try:
		(a, b, c, d) = map(int, input().split())
		if a > d:
			x = a
			a = d
			d = x
		if b > d:
			x = b
			b = d
			d = x
		if c > d:
			x = c
			c = d
			d = x
		aa = d - c
		bb = d - b
		cc = d - a
		print('{} {} {}'.format(aa, bb, cc))
	except:
		break


xs = list(map(int, input().strip().split(' ')))

def ok(a, b, c):
	print('%d %d %d' % (a, b, c))
	exit(0)

def check(a, b, c):
	a = sorted([a + b, a + c, b + c, a + b + c])
	return a == sorted(xs)
for i in range(4):
	for j in range(i, 4):
		for k in range(j, 4):
			a = xs[i] - xs[k] + xs[j]
			if a % 2 != 0:
				continue
			a = a // 2
			b = xs[i] - a
			c = xs[j] - a
			if check(a, b, c):
				ok(a, b, c)


s = list(map(int, input().split()))
s.sort()
ans = []
for i in range(3):
	ans.append(str(s[-1] - s[i]))
print(' '.join(ans))


import os
lis = [int(x) for x in input().split()]
lis.sort()
c = (lis[1] - lis[0] + lis[2]) // 2
b = -lis[1] + lis[0] + c
a = lis[3] - b - c
print(b, a, c)


s = list(map(int, input().split()))
s.sort()
an = []
for i in s[:-1]:
	an.append(s[-1] - i)
print(' '.join(list(map(str, an))))


nums = list(map(int, input().split(' ')))
m = max(nums)
for num in nums:
	if num != m:
		print(m - num, end=' ', flush=True)


input_array = [int(x) for x in input().split(' ')]
max_input = max(input_array)
input_array.remove(max_input)
var1 = max_input - input_array[0]
var2 = max_input - input_array[1]
var3 = max_input - input_array[2]
print(var1, var2, var3)


arr = list(map(int, input().split()))
m = max(arr)
s = ''
for a in arr:
	if m == a:
		continue
	s += str(m - a) + ' '
print(s.strip())


(s1, s2, s3, s4) = map(int, input().split())
total_sum = max(s1, s2, s3, s4)
guessed_values = [total_sum - value for value in (s1, s2, s3, s4)]
guessed_values.remove(0)
print(*guessed_values)


(a, b, c, d) = map(int, input().split())
e = max(a, b, c, d)
f = e - a
g = e - b
h = e - c
i = e - d
if f == 0:
	print(g, h, i)
elif g == 0:
	print(f, h, i)
elif h == 0:
	print(f, g, i)
else:
	print(f, g, h)


a = list(map(int, input().split(' ')))
m = max(a)
for e in a:
	if e != m:
		print(m - e, end=' ')
print()


n = input()
l = map(int, n.split())
main = list(l)
maxi = max(main)
maxind = main.index(maxi)
main.pop(maxind)
for i in main:
	print(maxi - i, end=' ')


(a, b, c, d) = sorted(map(int, input().split()))
e = d - a
f = d - b
g = d - c
print(f, g, e)


(x1, x2, x3, x4) = input().split()
e = max(int(x1), int(x2), int(x3), int(x4))
if e == int(x1):
	print(e - int(x2), e - int(x3), e - int(x4))
elif e == int(x2):
	print(e - int(x1), e - int(x3), e - int(x4))
elif e == int(x3):
	print(e - int(x2), e - int(x1), e - int(x4))
elif e == int(x4):
	print(e - int(x2), e - int(x3), e - int(x1))


x = list(map(int, input().strip().split()))
x.sort()
mx = x[-1]
a = x[0] + x[1] - mx
b = x[1] + x[2] - mx
c = x[0] + x[2] - mx
print(str(a) + ' ' + str(b) + ' ' + str(c))


judge = True
if judge:
	from sys import stdin, stdout
else:
	stdin = open('input.txt', 'r')
	stdout = open('output.txt', 'w')
x = list(sorted(map(int, stdin.readline().split())))
for i in range(3):
	stdout.write(str(x[3] - x[i]) + ' ')
stdin.close()
stdout.close()


def answer():
	a = input().split()
	a = [int(x) for x in a]
	targ = max(a)
	a.remove(targ)
	c = []
	for x in a:
		c.append(targ - x)
	print(str(c[0]), str(c[1]), str(c[2]))
answer()


A = list(map(int, input().split(' ')))
a_b = min(A)
A.remove(a_b)
a_c = min(A)
A.remove(a_c)
b_c = min(A)
A.remove(b_c)
a_b_c = A[0]
a = a_b_c - b_c
b = a_b_c - a_c
c = a_b_c - a_b
print(a, b, c)


(n1, n2, n3, n4) = [int(i) for i in input().split()]
a = [n1, n2, n3, n4]
abc = max(a)
a.remove(max(a))
b = []
for i in a:
	n = abc - i
	b.append(n)
for i in b:
	print(i, end=' ')


x = input().split()
for i in range(4):
	x[i] = int(x[i])
x.sort()
for j in range(3):
	print(x[3] - x[j], end=' ')


args = list(map(int, input().split()))
total = max(args)
args.pop(args.index(total))
for a in args:
	print(total - a, end=' ')


def rlist():
	return list(map(int, input().split()))

def rdi():
	return int(input())
(q, w, e, r) = sorted(rlist())
print(r - q, r - w, r - e)


n = sorted(list(map(int, input().split())))
c = abs(n[-1] - n[0] - n[1])
print(n[0] - c, n[1] - c, c)


(x1, x2, x3, x4) = [int(i) for i in input().split()]
x = [x1, x2, x3, x4]
maximum = max(x1, x2, x3, x4)
new = []
for i in range(0, 4):
	a = maximum - x[i]
	if a != 0:
		new.insert(i, a)
p = new[0]
q = new[1]
r = new[2]
print(p, q, r)


maxi = [int(x) for x in input().split()]
x = max(maxi)
maxi.pop(maxi.index(max(maxi)))
for i in maxi:
	print(x - i, end=' ')


cl = sorted(list(map(int, input().split())))
res = []
sm = cl[-1]
x1 = (cl[0] + cl[1] - cl[2]) // 2
x2 = (cl[0] + cl[2] - cl[1]) // 2
x3 = (cl[1] + cl[2] - cl[0]) // 2
print(x1, x2, x3)


z = list(map(int, input().split()))
z.sort()
r = max(z)
print(r - z[0], r - z[1], r - z[2])


(a, b, c, d) = map(int, input().split())
e = max(a, b, c, d)
f = e - a
g = []
if f:
	g.append(f)
f = e - b
if f:
	g.append(f)
f = e - c
if f:
	g.append(f)
f = e - d
if f:
	g.append(f)
for i in range(2):
	print(g[i], end=' ')
print(g[-1])


(w, x, y, z) = map(int, input().split(' '))
if w > x and w > y and (w > z):
	print(w - x, w - y, w - z)
elif x > w and x > y and (x > z):
	print(x - w, x - y, x - z)
elif y > w and y > x and (y > z):
	print(y - w, y - x, y - z)
else:
	print(z - x, z - y, z - w)


def f():
	(a, b, c, d) = [int(i) for i in input().split()]
	x = []
	if a + b + c == d * 2:
		x = [a, b, c, d]
	elif b + c + d == a * 2:
		x = [b, c, d, a]
	elif a + b + d == c * 2:
		x = [a, b, d, c]
	else:
		x = [a, c, d, b]
	for i in range(3):
		print(x[-1] - x[i], end=' ')
f()


n = input()
nList = n.split()
ints = [int(string) for string in nList]
ints.sort()
print(ints[3] - ints[0], ints[3] - ints[1], ints[3] - ints[2])


a = list(map(int, input().split()))
print(*sorted([max(a) - x for x in a])[1:])


N = [int(x) for x in input().split()]
N.sort()
print(N[-1] - N[0], N[-1] - N[1], N[-1] - N[2])


n = [int(x) for x in input().split()]
n = sorted(n)
for i in n:
	if i != n[3]:
		print(n[3] - i, end=' ')


(n, m, nn, mm) = map(int, input().split())
l = [n, m, nn, mm]
l.sort()
print(l[-1] - l[0], l[-1] - l[1], l[-1] - l[2])


lst = list(map(int, input().split()))
lst.sort()
tot = lst[3]
print(tot - lst[0], tot - lst[1], tot - lst[2])


(n1, n2, n3, n4) = map(int, input().split())
sum = (n1 + n2 + n3 + n4) // 3
if n1 != sum:
	num1 = n1
	n1 = -1
else:
	num1 = n2
	n2 = -1
if n2 != sum and n2 >= 0:
	num2 = n2
	n2 = -1
else:
	num2 = n3
	n3 = -1
if n3 != sum and n3 >= 0:
	num3 = n3
	n3 = -1
else:
	num3 = n4
	n4 = -1
a = (num2 + (num1 - num3)) // 2
b = num1 - a
c = num2 - a
print(a, b, c)


x = list(map(int, input().split()))
x.sort()
for i in range(len(x) - 1):
	z = x[-1] - x[i]
	print(z, end=' ')


s = input().split()
s = [int(i) for i in s]
a = ''
m = max(s)
for i in s:
	if i != m:
		a = a + str(m - i) + ' '
print(a)


listan = list(map(int, input().split()))
x1 = max(listan)
i = listan.index(x1)
listan.pop(i)
a = x1 - listan[0]
b = x1 - listan[1]
c = x1 - listan[2]
print(f'{a} {b} {c}')


data = list(map(int, input().split()))
data.sort()
n1 = data[3] - data[0]
n2 = data[3] - data[1]
n3 = data[3] - data[2]
print(n1, n2, n3)


s = list(map(int, input().split()))
x = max(s)
ok = 0
for i in s:
	if i == x and ok == 0:
		ok = 1
	else:
		print(x - i, end=' ')


li = list(map(int, input().split()))
li.sort()
res = [li[3] - n for n in li]
print(*res[:3])


(w, x, y, z) = list(map(int, input().split()))[:4]
maxi = max([w, x, y, z])
if maxi == w:
	(a, b, c) = (maxi - x, maxi - y, maxi - z)
elif maxi == x:
	(a, b, c) = (maxi - w, maxi - y, maxi - z)
elif maxi == y:
	(a, b, c) = (maxi - x, maxi - w, maxi - z)
elif maxi == z:
	(a, b, c) = (maxi - x, maxi - y, maxi - w)
print(a, b, c)


(a, b, c, d) = input().split(' ')
x = [int(a), int(b), int(c), int(d)]
x.remove(max(x))
print((x[0] + x[1] - x[2]) // 2, (x[1] + x[2] - x[0]) // 2, (x[2] + x[0] - x[1]) // 2)


lis_1 = input().split(' ')
lis_2 = list(map(int, lis_1))
lis = []
for i in lis_2:
	if i != max(lis_2):
		lis.append(i)
val_1 = max(lis_2) - lis[0]
val_2 = max(lis_2) - lis[1]
val_3 = max(lis_2) - lis[2]
print(val_1, val_2, val_3)


s = list(map(int, input().split()))
l = []
x = max(s)
p = s.index(x)
i = 0
while i < len(s):
	if i != p:
		l.append(str(x - s[i]))
	i = i + 1
print(l[0] + ' ' + l[1] + ' ' + l[2])


arr = []
for i in input().split():
	arr.append(int(i))
arr.sort()
ans = ''
for i in range(3):
	val = arr[-1] - arr[i]
	ans = ans + ' ' + str(val)
print(ans)


l = list(map(int, input().split()))
mx = max(l)
for i in range(4):
	if l[i] == mx:
		continue
	print(str(mx - l[i]), end=' ')


text = input().split()
list1 = [int(i) for i in text]
list1.sort()
print(list1[3] - list1[0], list1[3] - list1[1], list1[3] - list1[2])


c = list(map(int, input().split()))
b = max(c)
s = c.pop(c.index(b))
o = max(c)
io = c.index(o)
d = min(c)
ed = c.index(d)
for i in range(len(c)):
	if i != io and i != ed:
		t = c[i]
x = s - o
y = s - d
z = s - t
print(x, y, z)


(i, j, k, l) = map(int, input().split())
if i + j + k == 2 * l:
	a_b_c = l
	a = a_b_c - i
	b = a_b_c - j
	c = a_b_c - k
	print(a, b, c)
elif i + j + l == 2 * k:
	a_b_c = k
	a = a_b_c - i
	b = a_b_c - j
	c = a_b_c - l
	print(a, b, c)
elif i + l + k == 2 * j:
	a_b_c = j
	a = a_b_c - i
	b = a_b_c - l
	c = a_b_c - k
	print(a, b, c)
elif l + j + k == 2 * i:
	a_b_c = i
	a = a_b_c - l
	b = a_b_c - j
	c = a_b_c - k
	print(a, b, c)


nums = [int(x) for x in input().split()]
summa = max(nums)
nums.remove(summa)
a = summa - nums[0]
b = summa - nums[1]
c = summa - nums[2]
print(a, b, c)


s = str(input())
li = list(s.split(' '))
x1 = int(li[0])
x2 = int(li[1])
x3 = int(li[2])
x4 = int(li[3])
newli = [x1, x2, x3, x4]
tsum = max(x1, x2, x3, x4)
for i in range(0, 4):
	if tsum != newli[i]:
		print(tsum - newli[i], end=' ')


l = [int(i) for i in input().split()]
soma = 0
l.sort()
print(l[3] - l[2], end=' ')
print(l[3] - l[1], end=' ')
print(l[3] - l[0])


def main():
	s = [int(x) for x in input().split()]
	s.sort()
	d = s[3]
	a = d - s[0]
	b = d - s[1]
	c = d - s[2]
	print(a, b, c)
main()


takein = input()
num_list = map(int, takein.split())
num_list = sorted(num_list)
result = []
if num_list[3] == num_list[2]:
	print(num_list[3], 0, 0)
else:
	result.append(str(num_list[3] - num_list[0]))
	result.append(str(num_list[3] - num_list[1]))
	result.append(str(num_list[3] - num_list[2]))
	print(' '.join(result))


arr = sorted((int(i) for i in input().split()))
c = arr[-1]
ans = [c - i for i in arr[:-1]]
print(*ans)


lis = [int(x) for x in input().split()]
mx = max(lis)
(a, b, c, d) = lis
for i in lis:
	if i != mx:
		print(mx - i, end=' ')


st = input()
ls = st.split()
ls[0] = int(ls[0])
ls[1] = int(ls[1])
ls[2] = int(ls[2])
ls[3] = int(ls[3])
ls.sort()
print(int(ls[3]) - int(ls[0]), int(ls[3]) - int(ls[1]), int(ls[3]) - int(ls[2]))


l = map(int, input().split())
l = sorted(l)
a = abs(l[3] - l[0])
b = abs(l[3] - l[2])
c = abs(l[3] - l[1])
print(a, b, c)


A = list(map(int, input().split()))
m = max(A)
A = [m - a for a in A]
A.sort()
print(A[1], A[2], A[3])


(x1, x2, x3, x4) = map(int, input().split())
maks = max(x1, x2, x3, x4)
if maks == x1:
	print(maks - x2, maks - x3, maks - x4)
if maks == x2:
	print(maks - x1, maks - x3, maks - x4)
if maks == x3:
	print(maks - x2, maks - x1, maks - x4)
if maks == x4:
	print(maks - x2, maks - x3, maks - x1)


s = [int(x) for x in input().split()]
x = max(s)
arr = []
for i in range(len(s)):
	if s[i] != x:
		arr.append(str(x - s[i]))
print(' '.join(arr))


x = [int(s) for s in input().split()]
abc = max(x)
x.pop(x.index(abc))
ab = x[0]
ac = x[1]
bc = x[2]
c = abc - ab
a = abc - bc
b = abc - ac
print(a, b, c)


L = input().split()
L = [int(i) for i in L]
L.sort()
a = 0
b = 0
c = 0
a = L[0] + L[1] - L[3]
b = L[0] - a
c = L[2] - b
print(a, b, c)


from math import sqrt, ceil, floor
from sys import stdin, stdout
from heapq import heapify, heappush, heappop
import string
import bisect

def solve():
	a = list(map(int, stdin.readline().split()))
	a.sort()
	ans1 = a[-1] - a[0]
	ans2 = a[-1] - a[1]
	ans3 = a[-1] - a[2]
	print(ans1, ans2, ans3)
solve()


L = list(map(int, input().split()))
L.sort()
(A, B, C, D) = L
print(D - C, D - B, D - A)


from sys import stdin, stdout
LI = lambda : list(map(int, input().split()))
MAP = lambda : map(int, input().split())
IN = lambda : int(input())
S = lambda : input()
import math
from collections import Counter

def solve():
	(a, b, c, d) = sorted(MAP())
	print(d - a, d - b, d - c)
for i in range(1):
	solve()


x = list(map(int, input().split()))
y = sum(x)
for i in x:
	if 3 * i == y:
		k = i.__index__()
		break
for i in x:
	if i.__index__() != k:
		print(y // 3 - i)


x = [int(x) for x in input().split()]
c = max(x) - x[(x.index(max(x)) + 1) % 4]
b = max(x) - x[(x.index(max(x)) + 2) % 4]
a = max(x) - x[(x.index(max(x)) + 3) % 4]
print(a, b, c)


L = [int(x) for x in input().split()]
t = max(L)
L.remove(t)
for i in range(3):
	print(t - L[i], end=' ')


list = input().split()
nlist = []
for each in list:
	nlist.append(int(each))
total = max(nlist)
nlist.remove(total)
for each in nlist:
	print(total - each, end=' ')


l = list(map(int, input().split()))
abc = max(l)
l1 = []
l.remove(abc)
print(abc - l[0], abc - l[1], abc - l[2])


l = list(map(int, input().split()))
(a, b, c, d) = sorted(l)
l1 = []
l1.append(d - c)
l1.append(d - b)
l1.append(d - a)
print(*l1, end='')


l = list(map(int, input().split()))
a = []
for i in range(4):
	a.append(max(l) - l[i])
a.remove(0)
a.reverse()
print(*a)


str_arr = input().split(' ')
arr = [int(num) for num in str_arr]
arr.sort()
print(arr[3] - arr[0], arr[3] - arr[1], arr[3] - arr[2])


(m, n, p, q) = map(int, input().split())
ma = max(m, n, p, q)
a = ma - m
b = ma - n
c = ma - p
d = ma - q
if a != 0:
	print(a)
if b != 0:
	print(b)
if c != 0:
	print(c)
if d != 0:
	print(d)


import sys
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())

def function(list_):
	sorted_list = list_.sort()
	c = list_[3] - list_[0]
	a = list_[1] - c
	b = list_[2] - c
	print(a, b, c)
list_ = inlt()
function(list_)


(x1, x2, x3, x4) = map(int, input().strip().split())
max_i = max(x1, x2, x3, x4)
arr = []
arr.append(x1)
arr.append(x2)
arr.append(x3)
arr.append(x4)
for i in range(4):
	if arr[i] == max_i:
		del arr[i]
		break
a = (arr[1] - arr[2] + arr[0]) // 2
b = a + arr[2] - arr[1]
c = max_i - a - b
print(a, b, c)


li = list(map(int, input().split()))
maxim = max(li)
ind = li.index(maxim)
li.pop(ind)
li = [maxim - i for i in li]
print(*li, sep=' ')


l = list(map(int, input().split()))
l.sort(reverse=True)
c = l[0] - l[1]
b = l[2] - c
a = l[3] - c
print(str(a) + ' ' + str(b) + ' ' + str(c))


s = list(map(int, input().split()))
a = max(s)
l = []
for i in s:
	l.append(a - i)
for i in l:
	if i != 0:
		print(i, end=' ')


elements = list(map(int, input().split()))
abcd = max(elements)
elements.remove(abcd)
print(abcd - elements[0], abcd - elements[1], abcd - elements[2])


no = sorted([int(i) for i in input().split()])
bno = no[-1]
print(f'{bno - no[0]} {bno - no[1]} {bno - no[2]}')


inp_lst = list(map(int, input().split()))
lst = sorted(inp_lst)
a = lst[3] - lst[0]
b = lst[3] - lst[2]
c = lst[3] - lst[1]
print(a, b, c)


L = map(int, input().split())
L = list(L)
L = sorted(L)
c = L[3] - L[0]
b = L[2] - c
a = L[0] - b
print(a, b, c)


s = [int(i) for i in input().split()]
a = []
m = max(s)
for i in range(len(s)):
	if m - s[i] != 0:
		a.append(m - s[i])
print(*a)


z = [int(s) for s in input().split()]
z.sort()
abc = z[3]
z.pop(3)
a = abc - z[2]
b = z[1] - a
c = z[0] - a
print(a, b, c)


(s, a, h, i) = sorted(map(int, input().split()))
print(i - h, i - a, i - s)


a = sorted([int(n) for n in input().split()])
print(' '.join([str(a[-1] - e) for e in a][:3]))


a = []
s = ''
a = list(map(int, input().split()))
k = max(a)
for i in range(0, 4):
	a[i] = k - a[i]
a.remove(0)
for i in a:
	print(i, end=' ')


def main():
	nums = list(map(int, input().split(' ')))
	sm = sum(nums) // 3
	nums.remove(sm)
	(a, b, c) = [sm - nums[i] for i in range(3)]
	print(a, b, c)
main()


numbers = sorted([int(x) for x in str(input()).split()])
abc = max(numbers)
a = abc - numbers[0]
b = abc - numbers[1]
c = abc - numbers[2]
print(a, b, c)


arr = list(map(int, input().split(' ')))
abc = max(arr)
arr.remove(abc)
for val in arr:
	print(str(abc - val) + ' ', end='')


array = list(map(int, input().split()[:4]))
array.sort()
print(array[3] - array[0], array[3] - array[1], array[3] - array[2])


input_str = input().split(' ')
num_list = [int(x) for x in input_str]
abc = max(num_list)
pop_flag = False
for x in num_list:
	if x == abc and (not pop_flag):
		pop_flag = True
		pass
	else:
		print(abc - x, end=' ')


ls = list(map(int, input().split()))
M = max(ls)
for i in ls:
	if i != M:
		print(M - i, end=' ')
print()


(a, b, c, d) = map(int, input().split())
mx = max(a, b, c, d)
x1 = mx - a
x2 = mx - b
x3 = mx - c
x4 = mx - d
if x1 == x2 == x3 == x4 == 0:
	print('0 0 0')
	raise SystemExit
if mx - a == 0:
	print(x2, x3, x4)
elif mx - b == 0:
	print(x3, x4, x1)
elif mx - c == 0:
	print(x2, x1, x4)
elif mx - d == 0:
	print(x2, x3, x1)


L = [int(x) for x in input().split(' ')]
M = max(L)
for i in range(4):
	L[i] -= M
for x in L:
	if x == 0:
		pass
	else:
		print(-x, end=' ')


a = list(map(int, input().split()))
(x1, x2, x3) = (0, 0, 0)
maxim = max(a)
a.pop(a.index(max(a)))
x1 = maxim - max(a)
x2 = min(a) - x1
x3 = maxim - x1 - x2
print(x1, '', x2, '', x3)


l = list(map(int, input().split()))
if l[0] == max(l):
	print(l[0] - l[1], l[0] - l[2], l[0] - l[3])
elif l[1] == max(l):
	print(l[1] - l[0], l[1] - l[2], l[1] - l[3])
elif l[2] == max(l):
	print(l[2] - l[0], l[2] - l[1], l[2] - l[3])
elif l[3] == max(l):
	print(l[3] - l[0], l[3] - l[2], l[3] - l[1])


l = list(map(int, input().split()))
total = max(l)
l.remove(total)
for i in range(3):
	print(total - l[i])


a = list(map(int, input().split()))[:4]
x = max(a)
for i in range(len(a)):
	if a[i] != x:
		print(x - a[i], end=' ')


l = [int(x) for x in input().split()]
l.sort()
print(l[-1] - l[0], l[-1] - l[1], l[-1] - l[2])


(f1, f2, f3, f4) = map(int, input().split())
if f1 > f2 and f1 > f3 and (f1 > f4):
	print(f1 - f2, f1 - f3, f1 - f4)
elif f2 > f1 and f2 > f3 and (f2 > f4):
	print(f2 - f1, f2 - f3, f2 - f4)
elif f3 > f1 and f3 > f2 and (f3 > f4):
	print(f3 - f1, f3 - f2, f3 - f4)
elif f4 > f1 and f4 > f2 and (f4 > f3):
	print(f4 - f1, f4 - f2, f4 - f3)


(s1, s2, s3, s4) = map(int, input().split())
a = [s1, s2, s3, s4]
s = 0
for i in range(len(a)):
	if a[i] == max(a):
		s = a[i]
		del a[i]
		break
b = []
for i in range(len(a)):
	b.append(s - a[i])
for i in b:
	print(i, end=' ')


a = sorted([int(x) for x in input().split()])
a4 = a[3] - a[0]
a2 = a[1] - a4
a3 = a[2] - a4
print(a2, a3, a4)


(p, q, r, s) = [int(p) for p in input().split()]
max = p
if q > max:
	max = q
if r > max:
	max = r
if s > max:
	max = s
list = [p, q, r, s]
list.remove(max)
for i in list:
	print(max - i, end=' ')


a = list(map(int, input().split()))
a.remove(max(a))
x = int((a[0] + a[1] - a[2]) / 2)
y = int((a[1] + a[2] - a[0]) / 2)
z = int((a[0] + a[2] - a[1]) / 2)
print(x, y, z)


(w, x, y, z) = input().split(' ')
w = int(w)
x = int(x)
y = int(y)
z = int(z)
l = [w, x, y, z]
s = w + x + y + z
d = []
for n in l:
	if n == s // 3:
		x4 = n
	else:
		d.append(n)
m = []
for n in d:
	m.append(x4 - n)
print(m[0], m[1], m[2])


numbers = list(map(int, input().split(' ')))
max = max(numbers)
numbers.remove(max)
for number in numbers:
	print(max - number)


ans = list(map(int, input().split()))
maxvaluesum = max(ans)
ans[0] = maxvaluesum - ans[0]
ans[1] = maxvaluesum - ans[1]
ans[2] = maxvaluesum - ans[2]
ans[3] = maxvaluesum - ans[3]
ans = list(filter(lambda x: x != 0, ans))
print(*ans)


li = [int(i) for i in input().split()]
k = max(li)
li.remove(k)
print(*[k - i for i in li])


num = [int(i) for i in input().split()]
num.sort()
res = []
a = num[3] - num[0]
b = num[1] - a
c = num[2] - a
print(str(a) + ' ' + str(b) + ' ' + str(c))


s = [int(s) for s in input().split()]
maxx = max(s)
for ele in s:
	if maxx - ele != 0:
		print(maxx - ele, end=' ')


(a, b, c, d) = map(int, input().split())
n = max(a, b, c, d)
if n == a:
	x = n - b
	y = n - c
	z = n - d
elif n == b:
	x = n - a
	y = n - c
	z = n - d
elif n == c:
	x = n - a
	y = n - b
	z = n - d
else:
	x = n - a
	y = n - b
	z = n - c
print(x, y, z)


l = list(map(int, input().split()))
p = max(l)
l.remove(max(l))
q = max(l)
l.remove(max(l))
c = p - q
r = max(l)
a = r - c
l.remove(max(l))
f = max(l)
b = f - c
print(a, b, c)


import sys
sys.setrecursionlimit(2000)
from collections import Counter
from functools import reduce
vec = [int(val) for val in sys.stdin.readline().split()]
abc = max(vec)
vec.remove(abc)
for val in vec:
	print(abc - val, end=' ')
print('')


l = [*map(int, input().split())]
a = b = c = 0
l.sort()
c = l[3] - l[0]
b = l[2] - c
a = l[0] - b
h = [a, b, c]
h.sort()
print(a, b, c)


inputlist = input()
inputs = inputlist.split(' ')
for i in range(0, len(inputs)):
	inputs[i] = int(inputs[i])
highest = max(inputs)
inputs.pop(inputs.index(highest))
x1 = -(highest - (inputs[0] + inputs[1]))
x2 = -(highest - (inputs[1] + inputs[2]))
x3 = -(highest - (inputs[0] + inputs[2]))
print(str(x1) + ' ' + str(x2) + ' ' + str(x3))


a = [int(x) for x in input().split()]
sum = max(a)
a.sort()
x = sum - a[0]
y = sum - a[1]
z = sum - a[2]
print(x, y, z)


a = input().split(' ')
for b in range(4):
	a[b] = int(a[b])
a.sort()
print(a[3] - a[0], a[3] - a[1], a[3] - a[2])


n = list(map(int, input().split()))
total_sum = max(n)
for i in n:
	if total_sum - i != 0:
		print(total_sum - i, end=' ')


L = list(map(int, input().split()))
S = L[0]
k = 0
for i in range(1, 4):
	if L[i] > S:
		(S, k) = (L[i], i)
for i in range(4):
	if i != k:
		print(S - L[i])


a = [int(k) for k in input().split()]
m = max(a)
a.remove(max(a))
for i in range(3):
	print(m - a[i], end=' ')


n = list(map(int, input().split()))
sum = sum(n) // 3
x = 0
for i in n:
	if i != sum:
		x = sum - i
		print(x, end=' ')


def func(input):
	sol = []
	d = max(input)
	sol = [d - i for i in input if i != d]
	print(sol[0], sol[1], sol[2])

def main():
	n = input()
	arr = [int(x) for x in n.split()]
	func(arr)
main()


arr = list(map(int, input().split()))
mx = max(arr)
for i in range(4):
	if mx == arr[i]:
		continue
	else:
		print(mx - arr[i], end=' ')
print()


list = input().split()
a = []
for i in list:
	a.append(int(i))
a.sort()
print(a[3] - a[1], a[3] - a[2], a[3] - a[0])


(n1, n2, n3, n4) = map(int, input().split())
if n1 > n2 and n1 > n3 and (n1 > n4):
	print(n1 - n2, n1 - n3, n1 - n4)
elif n2 > n1 and n2 > n3 and (n2 > n4):
	print(n2 - n1, n2 - n3, n2 - n4)
elif n3 > n1 and n3 > n2 and (n3 > n4):
	print(n3 - n1, n3 - n2, n3 - n4)
elif n4 > n1 and n4 > n3 and (n4 > n2):
	print(n4 - n1, n4 - n3, n4 - n2)


arr = list(map(int, input().split()))
sum1 = max(arr)
arr.remove(sum1)
for i in range(0, len(arr)):
	print(sum1 - arr[i], end=' ')


sums = list(map(int, input().split()))
sums.sort()
(x1, x2, x3, x4) = map(int, (i for i in sums))
c = x4 - x1
b = x4 - x3
a = x4 - x2
if a + b + c == x4:
	print(str(a) + ' ' + str(b) + ' ' + str(c))


n = list(map(int, input().split()))

def restore(n):
	n.sort(reverse=True)
	print(n[0] - n[1], end=' ')
	print(n[0] - n[2], end=' ')
	print(n[0] - n[3], end=' ')
restore(n)


a = [int(x) for x in input().split()]
a = [max(a) - x for x in a if x != max(a)]
print(' '.join((str(x) for x in a)))


a = input().split()
x = (int(a[0]) + int(a[1]) + int(a[2]) + int(a[3])) // 3
q = 0
w = 0
e = 0
if int(a[0]) == x:
	q = x - int(a[1])
	w = x - int(a[2])
	e = x - int(a[3])
elif int(a[1]) == x:
	q = x - int(a[0])
	w = x - int(a[2])
	e = x - int(a[3])
elif int(a[2]) == x:
	q = x - int(a[0])
	w = x - int(a[1])
	e = x - int(a[3])
elif int(a[3]) == x:
	q = x - int(a[0])
	w = x - int(a[1])
	e = x - int(a[2])
print(q, w, e)


xs = [int(x) for x in input().split()]
s = max(xs)
for x in xs:
	if x != s:
		print(s - x, end=' ')


(x, y, z, w) = map(int, input().split())
m = [x, y, z, w]
m = sorted(m)
n = max(m)
a = n - m[0]
b = n - m[1]
c = n - m[2]
print(a, b, c, sep=' ')


x = list(map(int, input().split()))
x.sort()
x4 = x[-1]
a = []
for i in range(len(x) - 1):
	a.append(x4 - x[i])
	print(a[i], end=' ')


x = [int(_) for _ in input().split()]
x.sort()
(a, b, c, d) = x
A = d - c
B = d - b
C = d - a
print(A, B, C)


l = list(map(int, input().split()))
l = sorted(l)
c = l[3] - l[0]
b = l[3] - l[1]
a = l[3] - l[2]
print(a, end=' ')
print(b, end=' ')
print(c)


def three(ar):
	for i in range(len(ar)):
		if ar[i] != max(ar):
			print(max(ar) - ar[i])
arr = list(map(int, input().strip().split()))
three(arr)


l = list(map(int, input().split(' ')))
maxim = max(l)
for el in l:
	if el != maxim:
		print(maxim - el, end=' ')


s = input().split()
for i in range(4):
	s[i] = int(s[i])
s.sort()
ab = s[0]
ac = s[1]
bc = s[2]
abc = s[3]
ans = []
ans.append(ab + ac - abc)
ans.append(ac + bc - abc)
ans.append(ab + bc - abc)
for i in range(3):
	print(ans[i], end=' ')


(ab, bc, ca, abc) = map(int, input().split())
d = max(ab, bc, ca, abc)
f = min(ab, bc, ca, abc)
a = d - f
if ab != f and ab != d:
	b = ab - a
elif bc != f and bc != d:
	b = bc - a
elif ca != f and ca != d:
	b = ca - a
elif abc != f and abc != d:
	b = abc - a
else:
	b = a
c = d - a - b
print(a, b, c)


def main():
	(ab, ac, bc, abc) = sorted(map(int, input().split()))
	print(abc - bc, abc - ac, abc - ab)
main()


n = list(map(int, input().strip().split()))[:4]
maxNum = n[0]
for i in range(len(n)):
	if n[i] > maxNum:
		maxNum = n[i]
for j in range(len(n)):
	if maxNum - n[j] != 0:
		print(maxNum - n[j], end=' ')


(w, x, y, z) = map(int, input().split())
n = [w, x, y, z]
mx = max(n)
n.remove(mx)
dec = []
for i in range(3):
	dec.append(mx - n[i])
print(*dec, sep=' ')


l = list(map(int, input().split()))
d = max(l)
l.remove(d)
b = (l[0] - l[1] + l[2]) // 2
a = l[0] - b
c = l[2] - b
print(a, b, c)


inputNumber = list(map(int, input().split()))
maxNum = max(inputNumber)
inputNumber.remove(maxNum)
x1 = maxNum - inputNumber[0]
x2 = maxNum - inputNumber[1]
x3 = maxNum - inputNumber[2]
print(x1, x2, x3)


x = list(input().split())
x = list(map(int, x))
for i in range(0, 4, 1):
	for j in range(i + 1, 4, 1):
		if x[i] > x[j]:
			temp = x[i]
			x[i] = x[j]
			x[j] = temp
c = int((x[0] - x[1] - x[2]) / -2)
b = int((x[1] - x[0] - x[2]) / -2)
a = int(x[3] - b - c)
print(a, b, c)


def main():
	numeros = list(map(int, input().split()))
	numeros.sort()
	c = numeros[3] - numeros[0]
	a = numeros[1] - c
	b = numeros[0] - a
	print(str(a) + ' ' + str(b) + ' ' + str(c))
main()


d = [int(i) for i in input().split()]
d.sort()
print(' '.join([str(d[3] - d[0]), str(d[3] - d[1]), str(d[3] - d[2])]))


Q = map(int, input().split())
L = list(Q)
L.sort()
m = L[3]
c = m - L[2]
a = L[0] - c
b = L[1] - c
print(a, b, c)


(a1, a2, a3, a4) = map(int, input().split())
list = [a1, a2, a3, a4]
for i in range(3):
	if list[i] > list[i + 1]:
		(list[i], list[i + 1]) = (list[i + 1], list[i])
print(list[3] - list[0], ' ', list[3] - list[1], ' ', list[3] - list[2])


(n1, n2, n3, n4) = map(int, input().split())
numbers = [n1, n2, n3, n4]
abc = max(numbers)
numbers.remove(abc)
a = abs(abc - (numbers[0] + numbers[1]))
b = abs(abc - (numbers[0] + numbers[2]))
c = abs(abc - (numbers[1] + numbers[2]))
print(a, b, c)


x = list(input().rstrip().split())
x[0] = int(x[0])
x[1] = int(x[1])
x[2] = int(x[2])
x[3] = int(x[3])
j = x.index(max(x))
m = x[j]
a = []
for i in range(len(x)):
	if i != j:
		print(-x[i] + m, end=' ')


(x, y, z, w) = list(map(int, input().split()))
maxi = max(x, y, z, w)
r = [x, y, z, w]
r.remove(maxi)
print(maxi - r[0], maxi - r[1], maxi - r[2])


n = list(map(int, input().split()))
max_elem = max(n)
mass = []
for elem in n:
	if elem != max_elem:
		mass.append(str(max_elem - elem))
print(' '.join(mass))


w = input().split()
m = int(w[0])
n = int(w[1])
k = int(w[2])
p = int(w[3])
q = [m, n, k, p]
abc = max(q)
q.remove(abc)
ans = ''
for el in q:
	ans += str(abc - el)
	ans += ' '
print(ans[:-1])


L = list(map(int, input().split()))
D = max(L)
out = []
for i in L:
	if i != D:
		out.append(str(D - i))
print(' '.join(out))


sums = [int(num) for num in input().split(' ')]
g = max(sums)
sums.remove(g)
a = sums[0] + sums[1] - g
b = sums[0] + sums[2] - g
c = sums[1] + sums[2] - g
print(a, b, c)


l = list(map(int, input().split()))
m = max(l)
l.remove(m)
ans = [m - i for i in l]
print(*ans)


def r(t=int):
	return list(map(t, input().split()))

def ri(t=int):
	return t(input())

def cd(it):
	ret_val = dict()
	for v in it:
		ret_val[v] = ret_val.get(v, 0) + 1
	return ret_val
a = r()
c = max(a)
for v in a:
	if v == c:
		continue
	print(c - v, end=' ')
print()


values = list(map(int, input().split()))
max_value = max(values)
for v in values:
	if max_value == v:
		continue
	print(max_value - v, end=' ')


def main():
	x = list(map(int, input().split()))
	x.sort()
	max = x[-1]
	x.remove(max)
	print(' '.join([str(max - i) for i in x]))
main()


sums = [int(x) for x in input().split(' ')]
sums.sort()
(ab, bc, ca, abc) = sums
a = abc - bc
b = abc - ca
c = abc - ab
print(a, b, c)


nums = list(map(int, input().split()))
abc = max(nums)
nums.remove(abc)
ab = nums[0]
ac = nums[1]
bc = nums[2]
c = (bc - (ab - ac)) // 2
a = ac - c
b = bc - c
print(a, b, c)


(x1, x2, x3, x4) = [int(x) for x in input().split()]
l = [x1, x2, x3, x4]
x_max_idx = l.index(max(l))
l_idx_without_max = [i for i in range(4) if i != x_max_idx]
x1 = l[l_idx_without_max[0]]
x2 = l[l_idx_without_max[1]]
x3 = l[l_idx_without_max[2]]
a = int((x1 + x2 - x3) / 2)
b = int(x1 - a)
c = int(x2 - a)
print(a, b, c)


a = list(map(int, input().split(' ')))
big = a[0]
c = []
for i in range(len(a)):
	if a[i] > big:
		big = a[i]
a.remove(big)
for k in range(len(a)):
	value = big - a[k]
	c.append(value)
for i in range(len(c)):
	print(c[i], end=' ')


l = list(map(int, input().split()))
l.sort()
d = []
for i in range(3):
	d.append(l[3] - l[i])
print(*d)


n = list(map(int, input().split()))
i = n.index(max(n))
(n[0], n[i]) = (max(n), n[0])
print(n[0] - n[1], n[0] - n[2], n[0] - n[3])


x = [int(i) for i in input().split()]
m = max(x)
x.remove(m)
for i in x:
	print(m - i, end=' ')


import sys
from sys import stdin

def main():
	(A, B, C, D) = sorted([int(x) for x in stdin.readline().strip().split()])
	c = D - A
	b = C - c
	a = A - b
	print(a, b, c)
main()


(a, b, c, d) = map(int, input().split())
for i in range(4):
	if a > b:
		(a, b) = (b, a)
	if b > c:
		(b, c) = (c, b)
	if c > d:
		(c, d) = (d, c)
print(d - a, d - c, d - b, end=' ')


def restore(lst):
	return (lst[3] - lst[0], lst[3] - lst[1], lst[3] - lst[2])
(a, b, c, d) = [int(i) for i in input().split()]
print(*restore(sorted([a, b, c, d])))


l = [int(x) for x in input().split()]
p = max(l)
del l[l.index(max(l))]
x = l[0]
y = l[1]
z = l[2]
c = p - x
a = y - c
b = z - c
print(a, b, c)


(a, b, c, d) = map(int, input().split())
arr = [a, b, c, d]
max1 = max(arr)
arr.remove(max1)
for i in range(len(arr)):
	print(max1 - arr[i], end=' ')


arr = list(map(int, input().split()))
grt = max(arr)
arr.remove(max(arr))
ans = []
for i in arr:
	ans.append(grt - i)
print(*ans)


a = input()
z = v = [int(n) for n in a.split()]
sm = max(z)
del v[v.index(max(v))]
c = sm - v[0]
b = v[1] - c
a = v[0] - b
print(a, b, c)


(a, b, c, d) = list(map(int, input().split()))
ma = max(a, b, c, d)
ans = []
for i in [a, b, c, d]:
	if i != ma:
		ans.append(abs(i - ma))
print(*ans)


import math
mod = 1000000007
a = [int(i) for i in input().split()]
x = max(a)
for i in range(4):
	a[i] = x - a[i]
	if a[i] != 0:
		print(a[i], end=' ')


(w, x, y, z) = map(int, input().split())
tot = (w + x + y + z) // 3
if w == tot:
	a = tot - x
	b = tot - y
	c = tot - z
if x == tot:
	a = tot - y
	b = tot - w
	c = tot - z
if y == tot:
	a = tot - x
	b = tot - w
	c = tot - z
if z == tot:
	a = tot - y
	b = tot - w
	c = tot - x
print(a, b, c)


n = input()
n = n.split(' ')
d = []
for num in n:
	d.append(int(num))
d = sorted(d)
ab = d[0]
ac = d[1]
bc = d[2]
abc = d[3]
c = abc - ab
b = bc - c
a = ac - c
print(a, ' ', b, ' ', c)


from sys import stdin, stdout
p1 = list(map(int, stdin.readline().rstrip().split()))
p1.sort()
stdout.write(str(p1[3] - p1[0]) + ' ' + str(p1[3] - p1[1]) + ' ' + str(p1[3] - p1[2]))


s = list(map(int, input().split()))
m = max(s)
s.remove(m)
print(' '.join(map(lambda x: str(m - x), s)))


t = [int(x) for x in input().split()]
q = max(t)
d = ''
f = t.index(q)
for i in range(4):
	if i != f:
		d += str(q - t[i]) + ' '
print(d)


(x1, x2, x3, x4) = map(int, input().split())
x = max(x1, x2, x3, x4)
if x == x1:
	a = (x2 + x3 - x4) // 2
	b = (x4 + x2 - x3) // 2
	c = (x3 + x4 - x2) // 2
elif x == x2:
	a = (x1 + x3 - x4) // 2
	b = (x4 + x1 - x3) // 2
	c = (x3 + x4 - x1) // 2
elif x == x3:
	a = (x1 + x2 - x4) // 2
	b = (x4 + x1 - x2) // 2
	c = (x2 + x4 - x1) // 2
elif x == x4:
	a = (x1 + x2 - x3) // 2
	b = (x3 + x1 - x2) // 2
	c = (x2 + x3 - x1) // 2
print(a, b, c)


xs = list(map(int, input().split(' ')))
sum = max(xs)
remaining = list(filter(lambda x: x != sum, xs))
inverse = [[0.5, 0.5, -0.5], [0.5, -0.5, 0.5], [-0.5, 0.5, 0.5]]

def dot(v1, v2):
	s = 0
	for (e1, e2) in zip(v1, v2):
		s += e1 * e2
	return s
for i in range(3):
	print(int(dot(inverse[i], remaining)))


z = list(map(int, input().split()))
z.sort()
l = len(z)
print(z[l - 1] - z[0], end=' ')
print(z[l - 1] - z[1], end=' ')
print(z[l - 1] - z[2])


nums = sorted(list(map(int, input().split())))
abc = nums[-1]
print('{} {} {}'.format(abc - nums[0], abc - nums[1], abc - nums[2]))


lst = list((int(num) for num in input().split()))[:]
lst1 = []
for ele in lst:
	if ele != max(lst):
		x = max(lst) - ele
		lst1.append(x)
print(*lst1, sep=' ')


l = [int(i) for i in input().split()]
h = max(l)
for x in l:
	if h - x > 0:
		print(h - x, end=' ')


number = list(map(int, input().split()))
number.sort()
print(number[3] - number[2], number[3] - number[1], number[3] - number[0])


sk = [int(x) for x in input().split()]
sk.sort()
for x in range(3):
	print(sk[-1] - sk[x])


a = list(map(int, input().split()))
S = a[0]
j = 0
b = []
for i in range(len(a)):
	if a[i] > S:
		S = a[i]
		j = i
for i in range(len(a)):
	if i != j:
		b.append(a[i])
print(-S + b[0] + b[1], -S + b[0] + b[2], -S + b[1] + b[2])


x = list(map(int, input().split()))
x.sort()
a = x[3] - x[0]
b = x[3] - x[1]
c = x[3] - x[2]
p = []
p.append(a)
p.append(b)
p.append(c)
print(*p)


arr = [int(x) for x in input().split()]
for x in arr:
	if x != max(arr):
		print(max(arr) - x, end=' ')


(s1, s2, s3, s4) = map(int, input().split())
s = []
h = []
s.append(s1)
s.append(s2)
s.append(s3)
s.append(s4)
allsumm = max(s)
for i in range(4):
	if s[i] == allsumm:
		s.pop(i)
		break
for i in range(3):
	h.append(allsumm - s[i])
print(' '.join([str(elem) for elem in h]))


res = [int(n) for n in input().split()]
res1 = sorted(res)
l = []
l.append(res1[3] - res1[1])
l.append(res1[3] - res1[2])
l.append(res1[3] - res1[0])
print(*l)


from sys import stdin, stdout
input = stdin.readline()
numbers = [int(l) for l in input.split()]

def main():
	sorted_number = sorted(numbers, reverse=True)
	print(f'{sorted_number[0] - sorted_number[2]} {sorted_number[0] - sorted_number[1]} {sorted_number[0] - sorted_number[3]}')
main()


arr = list(map(int, input().split()))
max = max(arr)
foundmax = False
for num in arr:
	if not foundmax and num == max:
		continue
	print(max - num, end=' ')


mas = list(map(int, input().split()))
q = max(mas)
mas.remove(max(mas))
w = max(mas)
mas.remove(max(mas))
e = max(mas)
mas.remove(max(mas))
r = max(mas)
print(q - w, end=' ')
print(q - e, end=' ')
print(q - r)


(s, a, b, c) = reversed(sorted(map(int, input().split())))
print(s - a, s - b, s - c)


def solve():
	x = [int(k) for k in input().split()]
	x.sort()
	print(x[-1] - x[0], x[-1] - x[1], x[-1] - x[2])
solve()


arr = [int(val) for val in input().split()]
hi = -1
for i in range(len(arr)):
	if hi == -1 or arr[i] > arr[hi]:
		hi = i
abc = []
for i in range(len(arr)):
	if i != hi:
		abc.append(arr[hi] - arr[i])
for a in abc:
	print(a, end=' ')


(a, b, c, d) = map(int, input().split())
ma = a
poz = 1
if ma < b:
	ma = b
	poz = 2
if ma < c:
	ma = c
	poz = 3
if ma < d:
	ma = d
	poz = 4
if a != ma or (a == ma and poz != 1):
	x = ma - a
	poz_2 = 1
elif b != ma or (b == ma and poz != 2):
	x = ma - b
	poz_2 = 2
elif c != ma or (c == ma and poz != 3):
	x = ma - c
	poz_2 = 3
elif d != ma or (d == ma and poz != 4):
	x = ma - d
	poz_2 = 4
if poz != 1 and poz_2 != 1:
	y = a - x
elif poz != 2 and poz_2 != 2:
	y = b - x
elif poz != 3 and poz_2 != 3:
	y = c - x
elif poz != 4 and poz_2 != 4:
	y = d - x
z = ma - x - y
print(x, y, z)


(x1, x2, x3, x4) = map(int, input().split())
list = []
list.append(x1)
list.append(x2)
list.append(x3)
list.append(x4)
list.sort()
x = list[3]
y = list[2]
z = list[1]
w = list[0]
a = x - w
b = y - a
c = x - a - b
print(b, c, a)


q = list(map(int, input().split()))
q = sorted(q)
x = q[-1] - q[0]
y = q[-1] - q[1]
z = q[-1] - q[2]
print(x, y, z)


arr = sorted(list(map(int, input().split())))
B = (arr[1] - arr[0] + arr[2]) // 2
A = arr[1] - B
C = arr[3] - (A + B)
print(A, B, C)


list_ = list(map(int, input().split()))
max_list = max(list_)
for i in list_:
	if i != max_list:
		print(max_list - i, end=' ')


ns = [int(x) for x in input().split()]
max_n = max(ns)
print(' '.join([str(max_n - x) for x in ns if max_n - x]))


raw = input().split()
inputs = [int(item) for item in raw]
maxN = 0
for item in inputs:
	if item > maxN:
		maxN = item
ans = []
for item in inputs:
	if item != maxN:
		ans.append(item)
print(ans[0] + ans[1] - maxN, ans[0] + ans[2] - maxN, ans[1] + ans[2] - maxN)


a = list(map(int, input().split()))
maxm = max(a)
for e in range(len(a)):
	if maxm - a[e] is not 0:
		print(maxm - a[e])


s = input().split()
r = []
for i in range(0, 4):
	r.append(int(s[i]))
q = sum(r)
d = 0
for i in range(0, 4):
	if r[i] == q / 3:
		d = i
ran = []
for i in range(0, 4):
	if i != d:
		ran.append(i)
a = (r[ran[0]] + r[ran[1]] - r[ran[2]]) / 2
b = r[ran[0]] - a
c = r[ran[2]] - b
print(int(a), int(b), int(c))


li = [int(x) for x in input().split()]
li.sort()
m = li[-1]
print(m - li[0], end=' ')
print(m - li[1], end=' ')
print(m - li[2], end=' ')


import sys
x = [int(i) for i in input().split()]
x.sort()
print(x[3] - x[0])
print(x[3] - x[1])
print(x[3] - x[2])


l = list(map(int, input().split()))
a = max(l)
l.remove(a)
l = [a - x for x in l]
for _ in l:
	print(_, end=' ')


def find(arr):
	top = max(arr)
	ret = []
	for val in arr:
		a = top - val
		if a != 0:
			ret.append(a)
	return ret

def main():
	arr = input().split(' ')
	for i in range(len(arr)):
		arr[i] = int(arr[i])
	ret = find(arr)
	st = ''
	for val in ret:
		st = st + str(val) + ' '
	print(st)
main()


x = list(map(int, input().split(' ')))
c = max(x)
x.remove(c)
x = [c - i for i in x]
print(' '.join(map(str, x)))


sums = [int(x) for x in input().split()]
all_sum = max(sums)
abc = [str(all_sum - i) for i in sums if all_sum - i != 0]
print(' '.join(abc))


x = sorted(list(map(int, input().split())))
mx = x[3]
for i in range(3):
	print(mx - x[i], end=' ')


arr = list(map(int, input().split()))
arr.sort()
if arr[0] == arr[1] and arr[1] == arr[2]:
	a = arr[3] // 3
	b = a
	c = a
	print(a, end=' ')
	print(a, end=' ')
	print(a)
else:
	x = arr[0] + arr[1] - arr[3]
	y = arr[1] + arr[2] - arr[3]
	z = arr[3] - x - y
	print(x, end=' ')
	print(y, end=' ')
	print(z)


def restoreThreeNumbers():
	values = input().split()
	values = sorted([int(i) for i in values])
	a = int(values[3]) - int(values[0])
	b = int(values[3]) - int(values[1])
	c = int(values[3]) - int(values[2])
	print(a, b, c)
restoreThreeNumbers()


A = list(map(int, input().split()))
A.sort()
for i in range(0, 3):
	print(A[3] - A[i], end=' ')


(i, j, k, m) = map(int, input().split())
if i * 2 == j + k + m:
	print(i - j, i - k, i - m)
elif j * 2 == i + k + m:
	print(j - i, j - k, j - m)
elif k * 2 == i + j + m:
	print(k - i, k - j, k - m)
else:
	print(m - i, m - j, m - k)


def main():
	nums = input().split(' ')
	n = len(nums)
	for i in range(n):
		nums[i] = int(nums[i])
	nums.sort(reverse=True)
	triple_sum = nums[0]
	a = triple_sum - nums[1]
	b = triple_sum - nums[2]
	c = triple_sum - nums[3]
	print(str(a) + ' ' + str(b) + ' ' + str(c))
main()


l = list((int(x) for x in input().split()))
l.sort()
a = l[3] - l[0]
b = l[3] - l[1]
c = l[3] - l[2]
print(a, end=' ')
print(b, end=' ')
print(c)


randomSumList = [int(x) for x in input().split()]
totalSum = max(randomSumList)
result = []
for randomSum in randomSumList:
	randomNumber = totalSum - randomSum
	if randomNumber > 0:
		result.append(randomNumber)
print(*result)


list = [int(x) for x in input('').split()]
del list[4:]
x = max(list)
for p in list:
	if x - p != 0:
		print(x - p, end=' ')
print('\n')


x = [int(i) for i in input().split()]
m = max(x)
results = list(map(lambda d: m - d, x))
results.remove(0)
print(*results)


nums = sorted(map(int, input().split()), reverse=True)
print(nums[0] - nums[1], nums[0] - nums[2], nums[0] - nums[3])


n = [int(x) for x in input().split(' ')]
s = max(n)
n.remove(s)
a = int((n[0] + n[1] - n[2]) / 2)
b = int((n[0] - n[1] + n[2]) / 2)
c = int((n[0] - n[1] - n[2]) / -2)
print(a, b, c)


(x1, x2, x3, x4) = map(int, input().split())
y = 0
z = 0
m = 0
if x1 > x2:
	y = x1
else:
	y = x2
if x3 > x4:
	z = x3
else:
	z = x4
if y > z:
	m = y
else:
	m = z
if m - x1 != 0:
	print(m - x1, end=' ')
if m - x2 != 0:
	print(m - x2, end=' ')
if m - x3 != 0:
	print(m - x3, end=' ')
if m - x4 != 0:
	print(m - x4, end=' ')


x = list(map(int, input().split()))
mx = max(max(max(x[0], x[1]), x[2]), x[3])
result = []
for i in range(4):
	if mx - x[i] != 0:
		result.append(mx - x[i])
print(' '.join(map(str, result)))


import math
(a, b, c, d) = map(int, input().split())
if a == max(a, b, c, d):
	print(a - b, a - c, a - d)
elif b == max(a, b, c, d):
	print(b - a, b - c, b - d)
elif c == max(a, b, c, d):
	print(c - a, c - b, c - d)
else:
	print(d - a, d - c, d - b)


nums = sorted(list(map(int, input().split())))
abc = [nums[-1] - i for i in nums[:-1]]
print(*abc)


(w, x, y, z) = input().split()
w = int(w)
x = int(x)
y = int(y)
z = int(z)
greatest = max(w, x, y, z)
if greatest == w:
	c = greatest - x
	a = y - c
	b = z - c
	print(c, a, b)
elif greatest == x:
	c = greatest - w
	a = z - c
	b = y - c
	print(c, a, b)
elif greatest == y:
	c = greatest - z
	a = x - c
	b = w - c
	print(c, a, b)
elif greatest == z:
	c = greatest - y
	a = x - c
	b = w - c
	print(c, a, b)


lst = list(map(int, input().split()))
temp = max(lst)
lst.remove(temp)
lst[0] = temp - lst[0]
for i in range(1, 3):
	lst[i] -= lst[0]
for item in lst:
	print(item, end=' ')


l = input().split()
ar = []
max = 2
for i in range(4):
	n = int(l[i])
	ar.append(n)
	if n > max:
		max = n
		index = i
i = 0
for i in range(4):
	if i != index:
		print(max - ar[i], end=' ')


l = list(map(int, input().rstrip().split()))
s = max(l)
l.remove(max(l))
b = []
l.reverse()
for i in range(len(l)):
	d = s - l[i]
	b.append(d)
for x in b:
	print(x, end=' ')


(w, x, y, z) = map(int, input().split())
s = max(w, x, y, z)
if s == w:
	a = w - x
	b = w - y
	c = w - z
elif s == x:
	a = x - w
	b = x - y
	c = x - z
elif s == y:
	a = y - w
	b = y - x
	c = y - z
else:
	a = z - w
	b = z - x
	c = z - y
print(str(a) + ' ' + str(b) + ' ' + str(c))


import sys
input = sys.stdin.buffer.readline

def solution():
	(a, b, c, d) = sorted(map(int, input().split()))
	x = b - a
	num1 = (c + x) // 2
	num2 = b - num1
	num3 = a - num2
	print(num1, num2, num3)
solution()


from sys import stdin
import math
from collections import defaultdict, deque
arr = list(map(int, stdin.readline().split()))
arr.sort()
(x1, x2, x3, x4) = arr
a = x4 - x3
b = x4 - x2
c = x4 - a - b
print(a, b, c)


def res(ar):
	out = []
	totalSum = max(ar)
	for i in ar:
		if i != totalSum:
			out.append(totalSum - i)
	print(' '.join(map(str, out)))
ar = list(map(int, input().rstrip().split()))
res(ar)


(a, b, c, d) = map(int, input().rstrip().split())
sum_all = max(a, b, c, d)
an = []
an.append(sum_all - a)
an.append(sum_all - b)
an.append(sum_all - c)
an.append(sum_all - d)
for i in an:
	if i == 0:
		continue
	print(i, end=' ')


(x, y, z, k) = [int(x) for x in input().split()]
if x > y and x > z and (x > k):
	x = k
elif y > x and y > z and (y > k):
	y = k
elif z > y and z > x and (z > k):
	z = k
b = int((x - y + z) / 2)
a = int((x - z + y) / 2)
c = int((z - x + y) / 2)
print(a, b, c)


def li():
	return list(map(int, input().split(' ')))
a = sorted(li())
print(a[3] - a[0], a[3] - a[1], a[3] - a[2])


a = list(map(int, input().rstrip().split()))
ma = max(a)
a.remove(ma)
res = [ma - el for el in a]
result = ' '.join(map(str, res))
print(result)


lst = []
temp = []
temp = input().split()
for i in range(len(temp)):
	lst.append(int(temp[i]))
lst = sorted(lst)
print(lst[3] - lst[0], lst[3] - lst[1], lst[3] - lst[2])


from sys import stdin
l = list(map(int, stdin.readline().split()))
m = max(l)
for i in range(len(l)):
	if l[i] != m:
		print(str(m - l[i]) + ' ', end='')


lst = list(map(int, input().split()))
lst.sort()
(k, l, m, n) = lst
print(n - k, n - l, n - m)


abcd = list(map(int, input().split()))
abcd.sort()
a = abcd[0]
b = abcd[1]
c = abcd[2]
d = abcd[3]
x = d - a
y = d - b
z = d - c
s = str(x) + ' ' + str(y) + ' ' + str(z)
print(s)


m = sorted(list(map(int, input().split())))
print(m[3] - m[0], m[3] - m[1], m[3] - m[2])


(s1, s2, s3, so) = map(int, input().split())
p = max(s1, s2, s3, so)
if p == so:
	print(p - s1, p - s2, p - s3)
if p == s1:
	print(p - s2, p - s3, p - so)
if p == s2:
	print(p - s1, p - s3, p - so)
if p == s3:
	print(p - s1, p - s2, p - so)


val = input()
num = val.split()
num1 = num
x = int(num[0])
y = int(num[1])
z = int(num[2])
w = int(num[3])
d = max(x, y, z, w)
del num[num1.index(str(d))]
for i in range(3):
	print(d - int(num[i]), end=' ')


x = list(map(int, input().split()))
x.sort()
x4 = x.pop()
for i in range(len(x)):
	print(x4 - x[i], end=' ')


x = [int(x) for x in input().split(' ')]
q = x.index(max(x))
xq = x[q]
del x[q]
a = xq - x[0]
b = xq - x[1]
c = xq - x[2]
print(a, b, c)


ls = []

def selection_sort(ls):
	for i in range(len(ls)):
		flag = False
		for j in range(len(ls) - 1 - i):
			if ls[j] > ls[j + 1]:
				tem = ls[j + 1]
				ls[j + 1] = ls[j]
				ls[j] = tem
				flag = True
		if flag == False:
			break
while True:
	put = input()
	ls = [int(x) for x in put.split()]
	if len(ls) == 4:
		break
selection_sort(ls)
print(ls[3] - ls[0], end=' ')
print(ls[3] - ls[2], end=' ')
print(ls[3] - ls[1])


(a, b, c, d) = [int(x) for x in input().split()]
li = [a, b, c, d]
li.sort()
for i in range(0, 3):
	print(li[3] - li[i], end=' ')


def solucion(x1, x2, x3):
	return ((x1 + x2 - x3) // 2, (x1 + x3 - x2) // 2, (x2 + x3 - x1) // 2)
(x1, x2, x3, x4) = map(int, input().split())
S = 0
if x1 + x2 + x3 == 2 * x4:
	S = solucion(x1, x2, x3)
elif x1 + x2 + x4 == 2 * x3:
	S = solucion(x1, x2, x4)
elif x1 + x3 + x4 == 2 * x2:
	S = solucion(x1, x3, x4)
else:
	S = solucion(x2, x3, x4)
print(S[0], S[1], S[2])


import sys

def solve():
	arr = [int(x) for x in input().split(' ')]
	abc = max(arr)
	arr.remove(abc)
	a = abc - arr[0]
	b = abc - arr[1]
	c = abc - arr[2]
	return (a, b, c)
(a, b, c) = solve()
print(str(a) + ' ' + str(b) + ' ' + str(c))


arr = list(map(int, input().split()))
m = max(arr)
print(*[m - e for e in arr if m != e])


(x1, x2, x3, x4) = map(int, input().split())
m = max(x1, x2, x3, x4)
for i in [x1, x2, x3, x4]:
	if m != i:
		print(m - i)


import sys

def main():
	nums = list(map(int, input().split()))
	total = sum(nums) // 3
	ans = [total - num for num in nums if total - num != 0]
	print(' '.join([str(num) for num in ans]))
main()


L = list(map(int, input().split()))
m = max(L)
L.remove(m)
Ans = []
for l in L:
	Ans.append(m - l)
print(*Ans)


arr = list(map(int, input().split()))
arr.sort()
(m, arr) = (arr[-1], arr[:-1])
res = []
for i in range(len(arr)):
	res.append(m - arr[i])
print(' '.join(map(str, res)))


import sys
import os.path
import math
import heapq
from sys import stdin, stdout
from collections import *
from math import gcd, ceil, floor
mod = int(1000000000.0 + 7)
if os.path.exists('Updated prg/Input3d.txt'):
	sys.stdout = open('Updated prg/Output3d.txt', 'w')
	sys.stdin = open('Updated prg/Input3d.txt', 'r')

def sinp():
	return input()

def ninp():
	return int(sinp())

def mapinp():
	return map(int, sinp().split())

def linp():
	return list(mapinp())

def sl():
	return list(sinp())

def prnt(a):
	print(a)

def prntl(a):
	print(a, end=' ')

def power(n):
	return 1 << n
(a, b, c, d) = mapinp()
l1 = [a, b, c, d]
m1 = max(l1)
l1.remove(m1)
l2 = []
for i in l1:
	l2.append(m1 - i)
print(*l2)


l = list(map(int, input().split()))
v = max(l)
i = l.index(max(l))
for j in range(4):
	if i != j:
		print(v - l[j])


s = list(map(int, input().split()))
s.sort()
l = []
for i in range(len(s) - 1):
	l.append(max(s) - s[i])
print(*l)


(A, B, C, D) = sorted(map(int, input().split()))
print(D - C, D - B, D - A)


l = list(map(int, input().split()))
l.sort()
ans = ''
for i in l[:len(l) - 1]:
	ans += str(l[-1] - i) + ' '
print(ans)


u = [int(u) for u in input().split()]
u = sorted(u)
m = max(u)
n = min(u)
v = []
diff = max(u) - min(u)
v.append(diff)
for i in range(1, len(u) - 1):
	v.append(u[i] - diff)
print(*v)


arr = list(map(int, input().split()))
arr.sort()
W = arr[3]
X = arr[2]
Y = arr[1]
Z = arr[0]
print(W - X)
print(Z - W + X)
print(Y - W + X)


valores = [int(c) for c in input().split()]
maior = int(sum(valores) / 3)
valores.pop(valores.index(maior))
a = maior - valores[0]
b = maior - valores[1]
c = maior - valores[2]
print(a, b, c)


n = list(input().split())
numbers = sorted([int(i) for i in n])
print(numbers[3] - numbers[2], numbers[3] - numbers[1], numbers[3] - numbers[0], sep=' ')


r = list(map(int, input().split()))
p = max(r)
r.remove(p)
(x, y, z) = r
d = [y + z - p, x + z - p, x + y - p]
print(*d)


a = list(map(int, input().split()))
x = a.index(max(a))
if x == 0:
	print(max(a) - a[1], '', max(a) - a[2], '', max(a) - a[3])
elif x == 1:
	print(max(a) - a[2], '', max(a) - a[0], '', max(a) - a[3])
elif x == 2:
	print(max(a) - a[0], '', max(a) - a[1], '', max(a) - a[3])
elif x == 3:
	print(max(a) - a[0], '', max(a) - a[1], '', max(a) - a[2])


a = [int(i) for i in input().split()]
a.sort()
x = a[3] - a[0]
y = a[3] - a[2]
z = a[3] - a[1]
print(x, end=' ')
print(y, end=' ')
print(z, end=' ')
print()


vvod = input()
(x1, x2, x3, x4) = vvod.split()
x1 = int(x1)
x2 = int(x2)
x3 = int(x3)
x4 = int(x4)
s = [x1, x2, x3, x4]
z = max(s)
s.remove(max(s))
y = z - s[0]
w = z - s[1]
q = z - s[2]
print(q, w, y)


(x, y, z, w) = [int(x) for x in input().split()]
nums = [x, y, z, w]
nums.sort()
a = nums[3] - nums[0]
b = nums[1] - a
print(a, b, nums[3] - a - b)


l = list(map(int, input().split()))
l.sort()
ans = [l[-1] - l[i] for i in range(3)]
print(*ans)


def func1(n1, n2, n3):
	r = int((n1 + n2 - n3) / 2)
	return (r, n1 - r, n2 - r)

def check(n1n2n3, r):
	if n1n2n3 == sum(r):
		return True
	else:
		return False
input_numbers = input()
input_numbers = list(map(lambda y: int(y), input_numbers.split(' ')))
n1n2n3 = int(input_numbers.pop(input_numbers.index(max(input_numbers))))
possible_r = []
for i in (0, 1, 2):
	for j in (0, 1, 2):
		for k in (0, 1, 2):
			if i != j and j != k:
				possible_r.append(func1(input_numbers[i], input_numbers[j], input_numbers[k]))
for r in possible_r:
	if n1n2n3 == sum(r):
		(a, b, c) = r
		print(a, b, c)
		break


(a, b, c, d) = map(int, input().split())
x = max(a, b, c, d)
ans = ''
if x != a:
	ans += str(x - a) + ' '
if x != b:
	ans += str(x - b) + ' '
if x != c:
	ans += str(x - c) + ' '
if x != d:
	ans += str(x - d) + ' '
print(ans)


nums = sorted(list(map(int, input().split())))
a = nums[-1] - nums[-2]
b = nums[-1] - nums[-3]
c = nums[-1] - nums[-4]
print(f'{a} {b} {c}')


from sys import stdin
List = list(map(int, stdin.readline().split()))
s = List[0] + List[1] + List[2] + List[3]
ans = 0
for i in range(4):
	if s % List[i] == 0 and s // List[i] == 3:
		ans = List.pop(i)
		break
for i in range(3):
	List[i] = str(ans - List[i])
print(' '.join(List))


num = [int(i) for i in input().split()]
Sum = sum(num) // 3
print(' '.join([str(Sum - i) for i in num if i != Sum]))


a = list(map(int, input().split()))
for _ in range(4):
	if max(a) != a[_]:
		print(max(a) - a[_], end=' ')


(a, b, c, d) = map(int, input().split())
if a >= b and a >= c and (a >= d):
	(a, d) = (d, a)
elif b >= c and b >= d:
	(b, d) = (d, b)
elif c >= d:
	(c, d) = (d, c)
x = d - a
y = d - b
z = d - c
print(x, y, z)


num = input()
list = [int(i) for i in num.split()]
list2 = list
l = []
k = max(list)
list2.remove(k)
g = min(list)
l.append(k - g)
g = max(list2)
l.append(k - g)
list2.remove(g)
g = max(list2)
l.append(k - g)
for i in l:
	print(i, end=' ')


import math
from collections import defaultdict, Counter, deque

def primeFactor(n):
	if n % 2 == 0:
		return 2
	i = 3
	while i ** 2 <= n:
		if n % i == 0:
			return i
		i += 1
	return n

def main():
	nums = list(map(int, input().split()))
	nums.sort()
	print(nums[-1] - nums[0], nums[-1] - nums[1], nums[-1] - nums[2])
t = 1
for _ in range(t):
	main()


a = list((int(i) for i in input().split()))
m = max(a)
k = a.index(m)
li = []
for i in range(0, 4):
	if i == k:
		continue
	li.append(m - a[i])
print(*li)


a = list(map(int, input().split()))
max = max(a)
a.remove(max)
print(' '.join(map(str, [max - x for x in a])))


lst = list(map(int, input().split()))
x1 = max(lst)
lst.remove(x1)
a = x1 - lst[0]
b = x1 - lst[1]
c = x1 - lst[2]
print(a, b, c)


array = list(map(int, input().split()))
a = 0
b = 0
c = 0
W = max(array)
array.remove(max(array))
X = array[0]
Y = array[1]
Z = array[2]
x = X - Y
a = int((Z + x) / 2)
b = array[0] - a
c = array[2] - a
print(str(a) + ' ' + str(b) + ' ' + str(c))


def restore_numbers(arr):
	output_string = ''
	sorted_array = sorted(arr)
	arr[0] = sorted_array[3] - sorted_array[0]
	arr[1] = sorted_array[3] - sorted_array[1]
	arr[2] = sorted_array[3] - sorted_array[2]
	arr.pop(3)
	for i in arr:
		output_string = output_string + str(i) + ' '
	return output_string
arr = [int(x) for x in input().split(' ')]
response = restore_numbers(arr)
print(response)


(p, q, r, s) = (int(x) for x in input().strip().split(' '))
temp = (p + q + r + s) // 3
if p != temp:
	print(temp - p, end=' ')
if q != temp:
	print(temp - q, end=' ')
if r != temp:
	print(temp - r, end=' ')
if s != temp:
	print(temp - s, end=' ')


h = list(map(int, input().split()))
g = h[0]
g1 = h[1]
g2 = h[2]
g3 = h[3]
s = max(h)
a = s - g
b = s - g1
c = s - g2
f = s - g3
if a == 0:
	print(b, c, f)
elif b == 0:
	print(a, c, f)
elif c == 0:
	print(a, b, f)
elif f == 0:
	print(a, b, c)


R = lambda : map(int, input().split())
(x1, x2, x3, x4) = sorted(R())
a = x4 - x3
print(a, x1 - a, x2 - a)


from array import *
vals = [int(nums) for nums in input().split()]
m = int(max(vals))
for i in vals:
	originals = []
	n = m - int(i)
	originals.append(n)
	for k in originals:
		if k != 0:
			print(k, end=' ')


data = list(map(int, input().split(' ')))
data.sort()
print(str(data[-1] - data[0]) + ' ' + str(data[-1] - data[1]) + ' ' + str(data[-1] - data[2]))


def f():
	l = list(map(int, input().split()))
	mx = max(l)
	(a, b, c) = (0, 0, 0)
	for i in l:
		if i != mx and c == 0:
			c = mx - i
		elif i != mx and b == 0:
			b = mx - i
		elif i != mx and a == 0:
			a = mx - i
	print(a, b, c)
f()


d = list(map(int, input().split()))
d.sort()
print(d[-1] - d[-2], d[-1] - d[-3], d[-1] - d[-4])


myLis = []
lis = list(map(int, input().split()))
lis.sort()
p = lis.pop()
for i in lis:
	myLis.append(p - i)
print(*myLis)


x = list(map(int, input().split()))
x.sort()
a1 = (x[0] - x[1] + x[2]) // 2
a2 = (-x[0] + x[1] + x[2]) // 2
a3 = (x[0] + x[1] - x[2]) // 2
print(a1, a2, a3)


import math
from decimal import Decimal

def na():
	n = int(input())
	b = [int(x) for x in input().split()]
	return (n, b)

def nab():
	n = int(input())
	b = [int(x) for x in input().split()]
	c = [int(x) for x in input().split()]
	return (n, b, c)

def dv():
	(n, m) = map(int, input().split())
	return (n, m)

def dva():
	(n, m) = map(int, input().split())
	a = [int(x) for x in input().split()]
	b = [int(x) for x in input().split()]
	return (n, m, b)

def eratosthenes(n):
	sieve = list(range(n + 1))
	for i in sieve:
		if i > 1:
			for j in range(i + i, len(sieve), i):
				sieve[j] = 0
	return sorted(set(sieve))

def nm():
	n = int(input())
	b = [int(x) for x in input().split()]
	m = int(input())
	c = [int(x) for x in input().split()]
	return (n, b, m, c)

def dvs():
	n = int(input())
	m = int(input())
	return (n, m)
(x, y, z, a) = map(int, input().split())
d = max(x, y, z, a)
a = [d - x, d - y, d - z, d - a]
a = sorted(a)
print(a[1], a[2], a[3])


x_list = list(map(int, input().split()))
sum_three = max(x_list)
result = []
for x in x_list:
	if x == sum_three:
		continue
	result.append(sum_three - x)
print(*result)


s = sorted(map(int, input().split()))
s.pop()
x = s[0]
y = s[1]
z = s[2]
print((x - z + y) // 2, (y - x + z) // 2, (z - y + x) // 2)


results = [int(n) for n in input().split()]
results.sort(reverse=True)
c = results[0] - results[3]
b = results[0] - results[2]
a = results[0] - results[1]
print(f'{a} {b} {c}')


import itertools
from math import *
(x1, x2, x3, x4) = input().split()
x = [int(x1), int(x2), int(x3), int(x4)]
perm = list(itertools.permutations(x))
for pos in perm:
	if pos[0] + pos[1] + pos[2] == 2 * pos[3]:
		a = (pos[0] + pos[1] - pos[2]) / 2
		b = (pos[0] + pos[2] - pos[1]) / 2
		c = (pos[1] + pos[2] - pos[0]) / 2
		if a == floor(a) and b == floor(b) and (c == floor(c)):
			print(floor(a), floor(b), floor(c))
			break


numbers = list(map(int, input().split()[:4]))
numbers.sort(reverse=True)
for i in range(1, 4):
	print(numbers[0] - numbers[i], end=' ')


def change(a, b, c, m):
	if m == 1:
		return (a, b, c)
	elif m == 2:
		return (a, c, b)
	elif m == 3:
		return (b, a, c)
	elif m == 4:
		return (b, c, a)
	elif m == 5:
		return (c, a, b)
	elif m == 6:
		return (c, b, a)
arr = list(map(int, input().split()))
arr.sort()
a = arr[0]
b = arr[1]
c = arr[2]
d = arr[3]
m = 1
while m != 6:
	(p, q, r) = change(a, b, c, m)
	x = (p - r + q) // 2
	y = (p - q + r) // 2
	z = (r - p + q) // 2
	print(x, y, z)
	break
	m = m + 1


def main():
	x = list(map(int, input().split()))
	x.sort()
	print(x[3] - x[0], x[2] - (x[3] - x[0]), x[3] - (x[3] - x[0] + (x[2] - (x[3] - x[0]))))
main()


from collections import defaultdict
from sys import stdin
from bisect import bisect_left as bl, bisect_right as br, insort
import heapq
from collections import deque
import math
a = list(map(int, input().rstrip().split()))
maxi = max(a)
index = a.index(maxi)
for i in range(4):
	if i == index:
		pass
	else:
		print(maxi - a[i], end=' ')


lst = list(map(int, input().split()))
x1 = lst.pop(lst.index(max(lst)))
a = x1 - lst[0]
b = x1 - lst[1]
c = x1 - lst[2]
print(a, b, c)


(a, b, c, d) = [int(i) for i in input().split()]
max = max([a, b, c, d])
if a != max:
	print(max - a, end=' ')
if b != max:
	print(max - b, end=' ')
if c != max:
	print(max - c, end=' ')
if d != max:
	print(max - d, end=' ')


lst = [int(x) for x in input().split()]
summ = lst.pop(lst.index(max(lst)))
(a, b, c) = lst
x1 = (a + b - c) // 2
x2 = (a - b + c) // 2
x3 = (b - a + c) // 2
print(str(x1), str(x2), str(x3))


a = list(map(int, input().split()))
a = sorted(a)
(w, x, y) = (a[0], a[1], a[2])
print((w + x - y) // 2, (w + y - x) // 2, (x + y - w) // 2)


m = list(map(int, input().split()))
m.sort()
ma = m.pop()
print(ma - m[0], end=' ')
print(ma - m[1], end=' ')
print(ma - m[2], end=' ')


li = list(map(int, input().split()))
li = sorted(li)
li = li[::-1]
first = li[0] - li[1]
second = li[2] - first
third = li[1] - second
print(first, ' ', second, ' ', third)


a = list(map(int, input().split()))
m = max(a)
b = []
for i in a:
	if i < m:
		b.append(m - i)
	else:
		pass
for i in b:
	print(i, end=' ')


input_string = [int(x) for x in input().split()]
max1 = int(input_string[0])
pos = 0
for i in range(len(input_string)):
	number = input_string[i]
	if number > max1:
		max1 = number
		pos = i
del input_string[pos]
first_num = int(max1) - int(input_string[0])
second_num = int(max1) - int(input_string[1])
third_num = int(max1) - int(input_string[2])
print(first_num, second_num, third_num)


mass = list(map(int, input().split(' ')))
summ = max(mass)
mass.remove(summ)
for i in range(3):
	c = summ - mass[i % 3]
	a = mass[(i + 1) % 3] - summ + mass[i % 3]
	b = mass[(i + 2) % 3] - summ + mass[i % 3]
	if a + b + c == summ:
		print(a, b, c)
		break


x = [int(a) for a in input().split()]
x = sorted(x)
y = [x[-1] - x[i] for i in range(3)]
y = sorted(y)
print(*y)


strings = input().split()
numbers = []
for i in range(len(strings)):
	numbers.append(int(strings[i]))
numbers = sorted(numbers)
output = ''
for i in range(len(numbers) - 1):
	output += str(numbers[len(numbers) - 1] - numbers[i]) + ' '
print(output)


l = [int(i) for i in input().split()]
a = max(l)
for i in l:
	if i != a:
		print(a - i, end=' ')


a = [int(x) for x in input().split()]
v = 0
for i in a:
	v += i
v //= 3
for i in sorted(a[:])[:-1]:
	print(v - i, end=' ')


def readList():
	l = ''
	while not l:
		try:
			l = input()
		except:
			pass
	return list(map(int, l.split()))
nums = readList()
nums.remove(max(nums))
(a_b, a_c, b_c) = nums
a = (a_b - b_c + (a_c - b_c) + b_c) // 2
b = a_b - a
c = a_c - a
print(a, b, c)


s = [int(x) for x in input().split()]
sum = 0
for i in s:
	sum = sum + i
a = sum // 3
l = []
for i in s:
	if i != a:
		l.append(i)
t = []
for i in l:
	t.append(a - i)
for i in t:
	print(i, end=' ')


a = [int(i) for i in input().split()]
x = max(a[0], a[1], a[2], a[3])
c = a.index(x)
if c == 0:
	print(x - a[1], x - a[2], x - a[3])
elif c == 1:
	print(x - a[0], x - a[2], x - a[3])
elif c == 2:
	print(x - a[0], x - a[1], x - a[3])
else:
	print(x - a[0], x - a[1], x - a[2])


l = list(map(int, input().split()))
s = max(l)
l.remove(s)
m2 = max(l)
a = s - m2
mi = min(l)
b = mi - a
c = s - (a + b)
print(a, b, c)


X = []
str = input().split()[:4]
for i in range(4):
	x = int(str[i])
	X.append(x)
max = max(X)
X.remove(max)
for i in range(3):
	print(max - X[i], end=' ')


arr = input()
arr = arr.split(' ')
max = -1
for i in arr:
	if int(i) > max:
		max = int(i)
for i in arr:
	temp = max - int(i)
	if temp != 0:
		print(temp, end=' ')
	else:
		continue


nums = list(map(int, input().split()))
max = max(nums)
del nums[nums.index(max)]
print(' '.join(list(map(lambda x: str(max - x), nums))))


z = [int(s) for s in input().split()]
su = max(z)
r = []
for i in range(4):
	if z[i] != su:
		r.append(su - z[i])
print(*r)


inp = input().split(' ')
new_list = []
for x in inp:
	new_list.append(int(x))
new_list.sort()
m = int(new_list[3])
x = int(new_list[0])
y = int(new_list[1])
z = int(new_list[2])
a = m - x
b = m - y
c = m - a - b
print(str(a) + ' ' + str(b) + ' ' + str(c))


xyzw = input().split()
x = int(xyzw[0])
y = int(xyzw[1])
z = int(xyzw[2])
w = int(xyzw[3])
if x > y and x > z and (x > w):
	a = x - y
	b = x - z
	c = x - w
	print(a, ' ', b, ' ', c)
elif y > x and y > z and (y > w):
	a = y - x
	b = y - z
	c = y - w
	print(a, ' ', b, ' ', c)
elif z > x and z > y and (z > w):
	a = z - x
	b = z - y
	c = z - w
	print(a, ' ', b, ' ', c)
elif w > x and w > y and (w > z):
	a = w - x
	b = w - y
	c = w - z
	print(a, ' ', b, ' ', c)


nums = [int(i) for i in input().split()]
m = max(nums)
del nums[nums.index(m)]
print(m - nums[0], m - nums[1], m - nums[2])


lst = list(map(int, input().split()))
ans = []
lst.sort(reverse=True)
for i in range(1, 4):
	ans += [lst[0] - lst[i]]
print(*ans, sep=' ')


numbersString = input().split(' ')
numbers = []
for n in numbersString:
	numbers.append(int(n))
suma = max(numbers)
numbers.remove(suma)
a = suma - numbers[0]
b = suma - numbers[1]
c = suma - numbers[2]
print(a, b, c)


arr = sorted(list(map(int, input().split())))
for index in range(len(arr) - 1):
	print(arr[-1] - arr[index])


x = [int(i) for i in input().split()]
maxitem = max(x)
for i in x:
	if i != maxitem:
		print(maxitem - i, end=' ')


p = [int(n) for n in input().split()]
p1 = p[0]
p2 = p[1]
p3 = p[2]
p4 = p[3]
p5 = sorted(p)
p6 = p5[3]
print(int(p6 - p5[0]))
print(int(p6 - p5[1]))
print(int(p6 - p5[2]))


def find_max(numbers):
	ret = numbers[0]
	for i in numbers:
		if i > ret:
			ret = i
	return ret

def main():
	sums = [int(z) for z in input().split()]
	m = find_max(sums)
	ans = []
	for i in sums:
		j = m - i
		if j > 0:
			ans.append(j)
	print(ans[0], ans[1], ans[2])
main()


input_line = input()
input_line = input_line.split()
input_line = [int(i) for i in input_line]
abc = input_line.pop(input_line.index(max(input_line)))
a = abc - input_line[2]
b = abc - input_line[1]
c = abc - input_line[0]
print(a, b, c)


x = list(map(int, input().split()))
x = sorted(x)
for i in range(0, 3):
	print(x[-1] - x[i], end=' ')


x = [int(i) for i in input().split()]
x.sort()
a = x[3] - x[2]
b = x[3] - x[1]
c = x[3] - a - b
print(a, b, c)


a = input().split()
a[0] = int(a[0])
a[1] = int(a[1])
a[2] = int(a[2])
a[3] = int(a[3])
s = (a[0] + a[1] + a[2] + a[3]) // 3
ans = []
for i in range(4):
	if s - a[i] > 0:
		ans.append(str(s - a[i]))
print(' '.join(ans))


num = list(map(int, input().split()))
num.sort()
a = sum(num) - 2 * max(num)
print(a - num[0], a - num[1], a - num[2])


s = []
(s1, s2, s3, s4) = input().split()
s.append(int(s1))
s.append(int(s2))
s.append(int(s3))
s.append(int(s4))
s.sort()
print(f'{s[3] - s[0]} {s[3] - s[1]} {s[3] - s[2]}')


import math
(w, x, y, z) = input().split()
w = int(w)
x = int(x)
y = int(y)
z = int(z)
sorted = sorted([w, x, y, z])
a = sorted[3] - sorted[2]
b = sorted[3] - sorted[1]
c = sorted[3] - sorted[0]
print(a, b, c)


a = list(map(int, input().split()))
soma = max(a)
i = a.index(soma)
for q in range(4):
	if q == i:
		continue
	f = soma - a[q]
	print(f)


(a, b, c, d) = map(int, input().split())
t = max(a, b, c, d)
if t == a:
	print(a - b, a - c, a - d)
if t == b:
	print(-a + b, b - c, b - d)
if t == c:
	print(c - b, -a + c, c - d)
if t == d:
	print(d - b, d - c, -a + d)


lst = input()
lst = lst.split(' ')
lst = [int(x) for x in lst]
lst.sort(reverse=True)
a = lst[0] - lst[2]
b = lst[0] - lst[1]
c = lst[0] - lst[3]
print(a, b, c)


l = list(map(int, input().split()))
n = l.pop(l.index(max(l)))
for i in l:
	print(n - i)


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, copy, functools
import random
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return list(map(int, sys.stdin.readline().split()))

def LLI():
	return [list(map(int, l.split())) for l in sys.stdin.readlines()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def pe(s):
	return print(str(s), file=sys.stderr)

def main():
	a = sorted(LI())
	k = a[1] - a[0]
	c = (a[2] - k) // 2
	d = a[2] - c
	b = a[0] - c
	return '{} {} {}'.format(b, c, d)
print(main())


n = list(map(int, input().split()))
v = max(n)
n.remove(v)
for i in n:
	s = v - i
	print(s, end=' ')


(a, b, c, d) = sorted(map(int, input().split()), reverse=1)
print(a - b, a - c, a - d)


import sys
from bisect import bisect_left, bisect_right, insort
from collections import deque, Counter
from math import gcd, sqrt, factorial, ceil, log10, log2, floor
from itertools import permutations
from heapq import heappush, heappop, heapify
inf = float('inf')
mod = 1000000007
sys.setrecursionlimit(10 ** 9)

def factorial_p(n, p):
	ans = 1
	if n <= p // 2:
		for i in range(1, n + 1):
			ans = ans * i % p
	else:
		for i in range(1, p - n):
			ans = ans * i % p
		ans = pow(ans, p - 2, p)
		if n % 2 == 0:
			ans = p - ans
	return ans

def nCr_p(n, r, p):
	ans = 1
	while n != 0 or r != 0:
		(a, b) = (n % p, r % p)
		if a < b:
			return 0
		ans = ans * factorial_p(a, p) * pow(factorial_p(b, p), p - 2, p) * pow(factorial_p(a - b, p), p - 2, p) % p
		n //= p
		r //= p
	return ans

def prime_sieve(n):
	flag = n % 6 == 2
	sieve = bytearray((n // 3 + flag >> 3) + 1)
	for i in range(1, int(n ** 0.5) // 3 + 1):
		if not sieve[i >> 3] >> (i & 7) & 1:
			k = 3 * i + 1 | 1
			for j in range(k * k // 3, n // 3 + flag, 2 * k):
				sieve[j >> 3] |= 1 << (j & 7)
			for j in range(k * (k - 2 * (i & 1) + 4) // 3, n // 3 + flag, 2 * k):
				sieve[j >> 3] |= 1 << (j & 7)
	return sieve

def prime_list(n):
	res = []
	if n > 1:
		res.append(2)
	if n > 2:
		res.append(3)
	if n > 4:
		sieve = prime_sieve(n + 1)
		res.extend((3 * i + 1 | 1 for i in range(1, (n + 1) // 3 + (n % 6 == 1)) if not sieve[i >> 3] >> (i & 7) & 1))
	return res

def is_prime(n):
	if n < 5 or n & 1 == 0 or n % 3 == 0:
		return 2 <= n <= 3
	s = (n - 1 & 1 - n).bit_length() - 1
	d = n >> s
	for a in [2, 325, 9375, 28178, 450775, 9780504, 1795265022]:
		p = pow(a, d, n)
		if p == 1 or p == n - 1 or a % n == 0:
			continue
		for _ in range(s):
			p = p * p % n
			if p == n - 1:
				break
		else:
			return False
	return True

def all_factors(n):
	(small, large) = ([], [])
	for i in range(1, int(n ** 0.5) + 1, 2 if n & 1 else 1):
		if not n % i:
			small.append(i)
			large.append(n // i)
	if small[-1] == large[-1]:
		large.pop()
	large.reverse()
	small.extend(large)
	return small

def dfs(r, c, mark, A):
	if r < 0 or r >= n or c < 0 or (c >= n):
		return
	if mat[r][c] == 1:
		return
	if mat[r][c] == mark:
		return
	mat[r][c] = mark
	A.append((r, c))
	for (x, y) in ((0, 1), (1, 0), (-1, 0), (0, -1)):
		dfs(r + x, c + y, mark, A)

def get_array():
	return list(map(int, sys.stdin.readline().strip().split()))

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def input():
	return sys.stdin.readline().strip()
(a, b, c, d) = get_ints()
maxi = max(a, b, c, d)
lst = []
if maxi - a != 0:
	lst.append(maxi - a)
if maxi - b != 0:
	lst.append(maxi - b)
if maxi - c != 0:
	lst.append(maxi - c)
if maxi - d != 0:
	lst.append(maxi - d)
print(*lst, sep=' ')


(z, zz) = (input, lambda : list(map(int, z().split())))
zzz = lambda : [int(i) for i in stdin.readline().split()]
(szz, graph, mod, szzz) = (lambda : sorted(zz()), {}, 10 ** 9 + 7, lambda : sorted(zzz()))
from string import *
from re import *
from collections import *
from queue import *
from sys import *
from collections import *
from math import *
from heapq import *
from itertools import *
from bisect import *
from collections import Counter as cc
from math import factorial as f
from bisect import bisect as bs
from bisect import bisect_left as bsl
from itertools import accumulate as ac

def lcd(xnum1, xnum2):
	return xnum1 * xnum2 // gcd(xnum1, xnum2)

def prime(x):
	p = ceil(x ** 0.5) + 1
	for i in range(2, p):
		if x % i == 0 and x != 2 or x == 0:
			return 0
	return 1

def dfs(u, visit, graph):
	visit[u] = True
	for i in graph[u]:
		if not visit[i]:
			dfs(i, visit, graph)
(x1, x2, x3, x4) = szzz()
a = x4 - x1
b = x4 - x2
c = x4 - x3
print(a, b, c)


(x, y, z, s) = map(int, input().split())
m = max(x, y, z, s)
if m == x:
	a = x - y
	b = x - z
	c = x - s
elif m == y:
	a = y - x
	b = y - z
	c = y - s
elif m == z:
	a = z - x
	b = z - y
	c = z - s
elif m == s:
	a = s - x
	b = s - y
	c = s - z
print(a, b, c)


(p, q, r, s) = map(int, input().split())
a = []
a.append(p)
a.append(q)
a.append(r)
a.append(s)
a.sort()
print(a[3] - a[0], a[3] - a[1], a[3] - a[2])


arr = list(map(int, input().split()))
arr.sort(reverse=True)
maxi = arr[0]
lst = []
for i in range(1, len(arr)):
	lst.append(maxi - arr[i])
for element in lst:
	print(element)


emon = input().split()
emon2 = emon.copy()
emon1 = []
for i in emon2:
	g = int(i)
	emon1.append(g)
emon1.sort()
x = emon1[-1]
p = int(x)
emon.remove(str(x))
m = int(emon[0])
n = int(emon[1])
o = int(emon[2])
a = m + n - p
b = m + o - p
c = n + o - p
print(f'{a} {b} {c}')


(x1, x2, x3, x4) = map(int, input().split())
sum = max(x1, x2, x3, x4)
a = sum - x1
b = sum - x2
c = sum - x3
d = sum - x4
if a != 0:
	print(a, end=' ')
if b != 0:
	print(b, end=' ')
if c != 0:
	print(c, end=' ')
if d != 0:
	print(d, end=' ')


a = list(map(int, input().split()))
max = 0
for i in range(len(a)):
	if a[i] > max:
		max = a[i]
		ind = i
del a[ind]
for i in range(len(a)):
	print(max - a[i], end=' ')


numbers = list(map(int, input().split(' ')))
numbers.sort()
max = numbers.pop(-1)
a = max - numbers[0]
b = max - numbers[1]
c = max - numbers[2]
print(a, b, c)


nums = [int(s) for s in input().split()]
M = max(nums)
LIST = []
for elem in nums:
	if elem != M:
		LIST.append(M - elem)
print(*LIST)


(w, x, y, z) = map(int, input().split())
inputlist = [w, x, y, z]
inputlist.sort()
k = inputlist[-4]
l = inputlist[-3]
m = inputlist[-2]
n = inputlist[-1]
a = n - k
b = n - l
c = n - m
print(a, b, c)


l = [*map(int, input().split())]
l.sort()
s = l.pop()
for e in l:
	print(s - e, end=' ')
print()


(a, b, c, d) = map(int, input().split())
lst1 = [a, b, c, d]
lst1.sort()
if lst1[0] != lst1[1] and lst1[1] != lst1[2] and (lst1[0] != lst1[2]):
	a = lst1[3] - lst1[2]
	b = lst1[3] - lst1[1]
	c = lst1[3] - lst1[0]
	print(a, b, c)
elif lst1[0] == lst1[1] and lst1[1] == lst1[2] and (lst1[0] == lst1[2]):
	a = b = c = lst1[3] // 3
	print(a, b, c)
else:
	a = lst1[3] - lst1[2]
	b = lst1[3] - lst1[1]
	c = lst1[3] - lst1[0]
	print(a, b, c)


x = input().split()
res = []
for i in x:
	res.append(int(i))
ma = max(res)
res.remove(ma)
for l in res:
	print(ma - l, '', end='')


(a, b, c, d) = map(int, input().split())
b = [max(a, b, c, d) - a, max(a, b, c, d) - b, max(a, b, c, d) - c, max(a, b, c, d) - d]
b.remove(0)
print(*b)


__version__ = '0.1'
__date__ = '2019-04-16'
import sys

def find_abc(numbers):
	abc = max(numbers)
	numbers.remove(abc)
	return (abc - n for n in numbers)

def main(argv=None):
	xs = list(map(int, input().split()))
	print(' '.join(map(str, find_abc(xs))))
	return 0
STATUS = main()
sys.exit(STATUS)


h = [int(i) for i in input().split()]
h = sorted(h)
a = h[3] - h[2]
b = h[0] - a
if b <= 0:
	b = h[1] - a
	c = h[2] - b
	if c <= 0:
		c = h[0] - b
else:
	c = h[2] - b
	if c <= 0:
		c = h[0] - b
print(a, b, c)


lst_input = list(map(int, input().split()))
lst_input.sort()
a = lst_input[0]
b = lst_input[1]
c = lst_input[2]
d = lst_input[3]
print(d - a, d - c, d - b, sep=' ')


l = list(map(int, input().split()))
l.sort()
a = l[0] + l[1] - l[3]
print(f'{a} {l[0] - a} {l[1] - a}')


def restoring_three_numbers(arr):
	arr.sort()
	return [arr[-1] - arr[i] for i in range(3)]
arr = list(map(int, input().split()))
print(*restoring_three_numbers(arr))


x = list(map(int, input().split()))
x1 = max(x)
for l in x:
	if x1 - l != 0:
		print(x1 - l, end=' ')


s = list(map(int, input().split()))[:4]
m = max(s)
st = []
for i in range(4):
	if s[i] != m:
		a = m - s[i]
		st.append(a)
print(st[0], st[1], st[2])


num = list(map(int, input().split()))
a = 0
b = 0
c = 0
num.sort()
c = (num[2] + num[1] - num[0]) / 2
b = num[1] - c
a = num[0] - b
print('{} {} {}'.format(int(a), int(b), int(c)))


(a, b, c, d) = input().split()
list_1 = [a, b, c, d]
list_2 = []
for i in list_1:
	i = int(i)
	list_2.append(i)
list_2.sort()
print(list_2[3] - list_2[2], list_2[3] - list_2[1], list_2[3] - list_2[0])


import sys
input = sys.stdin.readline

def ii():
	return int(input())

def mi():
	return map(int, input().rstrip().split())

def lmi():
	return list(map(int, input().rstrip().split()))

def li():
	return list(input().rstrip())
S = lmi()
S.sort()
print(S[3] - S[0], S[3] - S[1], S[3] - S[2])


arr = list(map(int, input().split()))
w = max(arr)
arr.remove(w)
(x, y, z) = arr
a = w - y
b = w - z
c = w - x
print(str(a) + ' ' + str(b) + ' ' + str(c))


def main():
	array = list(map(int, input().split()))
	abc = max(array)
	array.remove(abc)
	(ab, ac, bc) = array
	a = abc - bc
	b = abc - ac
	c = abc - ab
	print(a, b, c)
main()


a = sorted([int(i) for i in input().split()], reverse=True)
print(*[a[0] - i for i in a[1:]])


s = input()
x = s.split()
for i in range(0, 4):
	x[i] = int(x[i])
x.sort()
m = int(x[3])
a = int(x[0])
b = int(x[1])
c = int(x[2])
x = m - a
y = m - b
z = m - c
print(x, y, z)


[s, t, u, v] = sorted(list(map(int, input().split())))
if s == t == u:
	ret = int(s / 2)
	print(ret, ret, ret)
else:
	a = int((s + t - u) / 2)
	b = int((s + u - t) / 2)
	c = int((t + u - s) / 2)
	print(a, b, c)


r = lambda : map(int, input().split())
s = sorted(r())
a = s[3] - s[0]
b = s[1] - a
c = s[2] - a
print(a, b, c)


l = list(map(int, input().split()))
l.sort()
for i in range(len(l)):
	x = l[3] - l[0]
	y = l[3] - l[1]
	z = l[3] - l[2]
print(x, y, z)


numbers = list(map(int, input().split()))
max_n = max(numbers)
L = []
for i in numbers:
	if i != max_n:
		L.append(max_n - i)
print(str(L[0]) + ' ' + str(L[1]) + ' ' + str(L[2]))


l = [int(i) for i in input().split()]
l.sort()
print(' '.join((str(l[3] - l[i]) for i in range(3))))


def main():
	numbers = input().split()
	numbers = sorted(numbers, key=int)
	first = int(numbers[0])
	second = int(numbers[1])
	third = int(numbers[2])
	fourth = int(numbers[3])
	a = fourth - first
	b = third - a
	c = second - a
	print(a, b, c)
main()


X = list(map(int, input().split(' ')))
M = -9999999
for i in X:
	if M > i:
		M = M
	else:
		M = i
arr = []
for i in X:
	if M - i != 0:
		arr.append(M - i)
for i in arr:
	print(i, end=' ')


linha = input()
l = []
for a in linha.split():
	if a.isdigit():
		l.append(int(a))
l.sort(reverse=1)
a = l[0]
b = l[1]
c = l[2]
d = l[3]
l = []
x1 = abs(a - d)
x2 = abs(a - c)
x3 = abs(a - b)
print(x1, x2, x3)


e = list(map(int, input().split()))
e.sort()
m = e[3]
a = m - e[0]
b = m - e[1]
c = m - e[2]
print(a, b, c)


(x_1, x_2, x_3, x_4) = map(int, input().split())
lst = [x_1, x_2, x_3, x_4]
lst_res = []
for i in lst:
	if i != max(lst):
		lst_res.append(max(lst) - i)
print(*lst_res)


from sys import stdin, stdout
arr = list(map(int, stdin.readline().split()))
arr.sort()
x1 = arr[0]
x2 = arr[1]
x3 = arr[2]
x4 = arr[3]
stdout.write(str(x4 - x3) + ' ' + str(x4 - x2) + ' ' + str(x4 - x1) + '\n')


def solve(nbs):
	for i in range(len(nbs)):
		if nbs[i] * 2 == sum(nbs[0:i]) + sum(nbs[i + 1:]):
			for x in nbs[0:i] + nbs[i + 1:]:
				yield (nbs[i] - x)
			break

def main():
	nbs = list(map(int, input().split()))
	print(' '.join(map(str, solve(nbs))))
main()


def three_numbers():
	numbers = list(map(int, input().split(sep=' ')))
	m = max(numbers)
	for i in numbers:
		if i != m:
			print(m - i, end=' ')
three_numbers()


numbers = [int(i) for i in input().split()]
big = max(numbers)
output = []
for number in numbers:
	if number != big:
		output.append(str(big - number))
print(' '.join(output))


(a, b, c, d) = map(int, input().split())
line = [a, b, c, d]
line.sort()
ans1 = line[-1] - line[0]
ans2 = line[-1] - line[1]
ans3 = line[-1] - line[2]
print(ans1, ans2, ans3)


ls = list(map(int, input().split()))
sum_ = max(ls)
ls.remove(sum_)
ls.sort(reverse=True)
a = sum_ - ls[0]
b = sum_ - ls[2]
c = sum_ - ls[1]
print(a, b, c)


x = list(map(int, input().split()))
p = max(x)
x.remove(p)
for i in range(3):
	a = p - x[i]
	print(a, end=' ')


import math
l = [int(i) for i in input().split()]
l.sort(reverse=True)
p = l[1]
q = l[2]
r = l[3]
a = l[0] - l[1]
b = l[0] - l[2]
c = l[0] - l[3]
print(a, b, c)


li = input().split(' ')
li = list(map(int, li))
li = sorted(li)
three_sum = li[-1]
print(three_sum - li[0], three_sum - li[1], three_sum - li[2])


user_input = list(map(int, input().split()))
print(*(max(user_input) - item for item in user_input if item != max(user_input)))


X = list(map(int, input('').split()))
Max = max(X)
X.remove(Max)
for i in X:
	print(Max - i, end=' ')


li = [int(x) for x in input().split()]
a = sorted(li)
sum_of_all = a[3]
li_1 = []
for i in range(3):
	b = sum_of_all - a[i]
	li_1.append(b)
print(*li_1)


lis = [int(x) for x in input().split()]
maxi = max(lis)
lis.remove(maxi)
a = maxi - lis[0]
b = maxi - lis[1]
c = maxi - lis[2]
print(a, b, c)


a = [int(i) for i in input().split()]
m = -9999
ind = -1
for i in range(4):
	if m < a[i]:
		m = a[i]
		ind = i
for i in range(4):
	if i != ind:
		print(m - a[i], end=' ')
print()


arr = [int(i) for i in filter(None, input().split(' '))]
arr.sort()
print(arr[3] - arr[0], arr[3] - arr[1], arr[3] - arr[2])


lst = list(map(int, input().split()))
lst.sort()
ab = lst[0]
bc = lst[1]
ac = lst[2]
tsum = lst[3]
b = abs(tsum - ac)
a = abs(ab - b)
c = tsum - (a + b)
print(a, b, c, sep=' ')


l = list(map(int, input().split()))
maxi = max(max(l[0], l[1]), max(l[2], l[3]))
for i in l:
	if i != maxi:
		print(maxi - i, end=' ')
print()


(x, y, z, w) = [int(v) for v in input().split()]
d = [x, y, z, w]
d.sort()
a = d[3] - d[0]
b = d[3] - d[1]
c = d[3] - d[2]
print(str(a) + ' ' + str(b) + ' ' + str(c))


a = list(map(int, input().split()))
m = max(a)
a.remove(m)
b = []
for x in a:
	b.append(m - x)
print(*b)


from itertools import permutations
l = sorted(list(map(int, input().split())))
for e in permutations((0, 1, 2)):
	(i, j, k) = (e[0], e[1], e[2])
	c = l[-1] - l[i]
	a = l[j] - c
	b = l[k] - c
	if a > 0 and b > 0 and (c > 0) and (sorted([a + b, a + c, b + c]) == l[:-1]):
		break
print(a, b, c)


arr = list(map(int, input().strip().split()))
m = max(arr)
arr.pop(arr.index(m))
print(m - arr[0], m - arr[1], m - arr[2])


arr = input()
(x1, x2, x3, x4) = [int(x) for x in arr.split(' ')]
m = max(x1, x2, x3, x4)
ans = sorted([m - x1, m - x2, m - x3, m - x4])
for i in range(1, len(ans)):
	print(ans[i], end=' ')


(x, y, z, q) = map(int, input().split())
if x > y and x > z and (x > q):
	print(x - y, x - z, x - q)
if y > x and y > z and (y > q):
	print(y - x, y - z, y - q)
if z > x and z > y and (z > q):
	print(z - x, z - y, z - q)
if q > x and q > y and (q > z):
	print(q - x, q - y, q - z)


numbers = input().split()
numbers = [int(x) for x in numbers]
sum = max(numbers)
numbers.remove(sum)
x = numbers[0]
y = numbers[1]
z = numbers[2]
b = x + z - sum
a = x - b
c = z - b
print(f'{a} {b} {c}')


l = list(map(int, input().split()))
l.sort()
mx = max(l)
l.pop()
res = []
for i in l:
	diff = mx - i
	res.append(str(diff))
res1 = ' '.join(res)
print(res1)


(p, q, r, s) = map(int, input().split(' '))
total = max([p, q, r, s])
integers = [total - i for i in [p, q, r, s] if total - i != 0]
for i in integers:
	print(i, end=' ')


arr = [int(x) for x in input().split(' ')]
maxSum = max(arr)
nums = []
for i in arr:
	if maxSum - i != 0:
		nums.append(maxSum - i)
print(nums[0], nums[1], nums[2])


a = input()
a = a.split(' ')
for i in range(len(a)):
	a[i] = int(a[i])
a.sort()
m = a[-1]
v = m - a[0]
k = m - a[1]
l = m - a[2]
print(v, k, l)


sums = input()
norm = sums.split(' ')
x1 = int(norm[0])
x2 = int(norm[1])
x3 = int(norm[2])
x4 = int(norm[3])
lis = [x1, x2, x3, x4]
lis.sort()
print(lis[3] - lis[0], lis[3] - lis[1], lis[3] - lis[2])


a = input()
b = []
b = a.split(' ')
z = 0
while len(b) > z:
	b[z] = int(b[z])
	z = z + 1
b.sort()
d = int(b[3]) - int(b[2])
e = int(b[3]) - int(b[1])
f = int(b[3]) - int(b[0])
print(d, end=' ')
print(e, end=' ')
print(f)


from sys import stdin, stdout
import math, sys
from itertools import permutations, combinations
from collections import defaultdict, deque, OrderedDict
from os import path
import bisect as bi
import heapq

def yes():
	print('YES')

def no():
	print('NO')
if path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

	def I():
		return int(input())

	def In():
		return map(int, input().split())
else:

	def I():
		return int(stdin.readline())

	def In():
		return map(int, stdin.readline().split())

def main():
	try:
		l = list(In())
		l.sort()
		a = (l[0] + l[2] - l[1]) // 2
		b = l[0] - a
		c = l[2] - a
		print(a, b, c)
	except:
		pass
M = 998244353
P = 1000000007
for _ in range(1):
	main()


a = input().split()
for j in range(len(a)):
	a[j] = int(a[j])
a = sorted(a)
k = max(a) - a[1]
l = max(a) - a[2]
m = max(a) - a[0]
print(k)
print(l)
print(m)


(w, x, y, z) = input('').split(' ')
n = max(int(w), int(x), int(y), int(z))
a = n - int(w)
b = n - int(x)
c = n - int(y)
d = n - int(z)
t = (a, b, c, d)
output = ''
for item in t:
	if item != 0:
		output = output + str(item) + ' '
print(output)


(a, b, c, d) = map(int, input().split())
e = max(a, b, c, d)
p = []
p.append(a)
p.append(b)
p.append(c)
p.append(d)
p = sorted(p)
for i in range(0, len(p) - 1):
	print(e - p[i], end=' ')


arr = list(map(int, input().split()))
mx = max(arr)
mn = min(arr)
arr.remove(mx)
arr.remove(mn)
diff = mx - mn
print(diff, end=' ')
for values in arr:
	print(abs(values - diff), end=' ')


(a, b, c, d) = map(int, input().split())
k = max(a, b, c, d)
d = [a, b, c, d]
d.remove(k)
print(k - d[0], k - d[1], k - d[2])


numbs = [int(a) for a in input().split()]
ABC = sum(numbs) // 3
results = [0] * 4
for index in range(4):
	results[index] = ABC - numbs[index]
for numb in results:
	if numb == 0:
		continue
	else:
		print(numb, end=' ')


(w, x, y, z) = sorted([int(i) for i in input().split()])
a = z - w
b = z - x
c = z - y
print(a, b, c)


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, queue, copy
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def I():
	return int(sys.stdin.readline())

def LS():
	return sys.stdin.readline().split()

def S():
	return input()

def main():
	l = LI()
	l.sort()
	print(l[-1] - l[0], l[-1] - l[1], l[-1] - l[2])
main()


nums = [int(x) for x in input().split()]
all3 = None
for num in nums:
	if (sum(nums) - num) / 2.0 == float(num):
		all3 = num
		break
nums.remove(all3)
for n in nums:
	print(str(all3 - n), end=' ')


import sys
numbers = input().split()
n = []
for x in numbers:
	n.append(int(x))
n.sort()
c = n[3] - n[2]
b = n[3] - n[1]
a = n[3] - n[0]
print(str(c) + ' ' + str(b) + ' ' + str(a))


x = map(int, input().split(' '))
x = sorted(x)
k = int(x[0])
l = int(x[1])
m = int(x[2])
n = int(x[3])
print(n - m, n - l, n - k)


numList = list(map(int, input().split(' ')))
numList.sort(reverse=True)
diff1 = numList[0] - numList[1]
diff2 = numList[2] - diff1
diff3 = numList[3] - diff1
print(f'{diff1} {diff2} {diff3}')


(p, q, r, s) = [int(i) for i in input().split()]
j = max(p, q, r, s)
if j == p:
	a = j - q
	b = j - r
	c = j - s
elif j == q:
	a = j - p
	b = j - r
	c = j - s
elif j == r:
	a = j - p
	b = j - q
	c = j - s
else:
	a = j - p
	b = j - q
	c = j - r
print(a, b, c)


(x, y, z, k) = map(int, input().split())
summ = (x + y + z + k) // 3
if summ - x != 0:
	print(summ - x, end=' ')
if summ - y != 0:
	print(summ - y, end=' ')
if summ - z != 0:
	print(summ - z, end=' ')
if summ - k != 0:
	print(summ - k, end=' ')


arr = [int(num) for num in input().split()]
arr.sort()
sum = arr.pop(len(arr) - 1)
for i in arr:
	print(sum - i, end=' ')


inp = list(map(int, input().split()))
pair = []
num = sum(inp) // 3
for item in inp:
	if item != num:
		pair.append(item)
numbers = []
numbers.append((pair[0] + pair[1] - pair[2]) // 2)
numbers.append((pair[1] + pair[2] - pair[0]) // 2)
numbers.append((pair[2] + pair[0] - pair[1]) // 2)
for item in numbers:
	print(item, end=' ')


arr = list(map(int, input().split()))
arr.sort()
mx = arr[3]
arr.pop(3)
c = mx - arr[0]
arr.pop(0)
a = arr[0] - c
b = arr[1] - c
print(a, b, c)


import sys
arr = [int(x) for x in input().split()]
for i in range(0, 4):
	for j in range(0, 4):
		for k in range(0, 4):
			for q in range(0, 4):
				if i != j and i != k and (i != q) and (j != k) and (j != q) and (k != q):
					if (arr[i] + arr[j] - arr[k]) % 2 == 0:
						a = int((arr[i] + arr[j] - arr[k]) / 2)
						b = arr[i] - a
						c = arr[j] - a
						if a + b + c == arr[q]:
							print(a, b, c)
							sys.exit()


def solve(i):
	abc = max(i)
	ans = []
	for data in i:
		if data != abc:
			ans.append(abc - data)
	if len(ans) == 0:
		ans = [abc] * 3
	return ' '.join((str(c) for c in ans))
print(solve(list(map(int, input().split(' ')))))


x = input('').split()
list = []
for c in range(4):
	list.append(int(x[c]))
list.sort()
print(list[3] - list[0], list[3] - list[2], list[3] - list[1])


var = [int(x) for x in input().split(' ')]
var_sort = sorted(var)
a = var_sort[1] - 0.5 * (var_sort[2] + var_sort[1] - var_sort[0])
b = var_sort[0] - var_sort[1] + 0.5 * (var_sort[2] + var_sort[1] - var_sort[0])
c = 0.5 * (var_sort[2] + var_sort[1] - var_sort[0])
print(int(a), int(b), int(c))


(x, y, z, w) = map(int, input().split())
p = max(x, y, w, z)
if x != p:
	print(p - x, end=' ')
if y != p:
	print(p - y, end=' ')
if z != p:
	print(p - z, end=' ')
if w != p:
	print(p - w, end=' ')


import sys
read = sys.stdin.read
readlines = sys.stdin.readlines

def main():
	nums = list(map(int, input().split()))
	nums.sort()
	n1 = nums[3] - nums[2]
	n2 = nums[0] - n1
	n3 = nums[2] - n2
	print(n1, n2, n3)
main()


X = list(map(int, input().split()))
X.sort()
x4 = X[-1]
a = x4 - X[0]
b = x4 - X[1]
c = x4 - X[2]
print(a, b, c)


a = list(map(int, input().split()))
a.reverse()
b = max(a)
for i in a:
	if b - i != 0:
		print(b - i, '', end='')


(a, b, c, d) = map(int, input().split())
arr = []
arr.append(a)
arr.append(b)
arr.append(c)
arr.append(d)
arr = sorted(arr)
print(str(arr[3] - arr[2]) + ' ' + str(arr[3] - arr[0]) + ' ' + str(arr[3] - arr[1]))


a = list(map(int, input().split()))
a.sort()
a1 = a[3] - a[0]
a2 = a[3] - a[1]
a3 = a[3] - a[2]
print(a1, a2, a3)


def gi():
	return int(input())

def gai():
	return list(map(int, input().split()))
x = sorted(gai())
abc = x[-1]
print(abc - x[0], abc - x[1], abc - x[2])


xs = list(map(int, input().split()))
s = max(xs)
v = [print(s - i) for i in xs if i != s]


(x, y, z, t) = [int(i) for i in input().split()]
bigst = max(x, y, z, t)
lst = [x, y, z, t]
for i in range(len(lst)):
	if lst[i] == bigst:
		lst.pop(i)
		break
print(f'{bigst - lst[0]} {bigst - lst[1]} {bigst - lst[2]}')


(a, b, c, addition) = sorted(map(int, input().split()))
print(addition - c, addition - b, addition - a)


num = list(map(int, input().split()))
listmax = max(num)
num.remove(max(num))
print(listmax - num[0], listmax - num[1], listmax - num[2])


(p, q, r, s) = map(int, input().split())
List = [p, q, r, s]
sum3 = max(List)
List.remove(sum3)
sol = []
for (i, value) in enumerate(List):
	sol.append(sum3 - value)
a = sol[0]
b = sol[1]
c = sol[2]
print(a, b, c)


(n1, n2, n3, n4) = map(int, input().split())
s = [n1, n2, n3, n4]
maxn = 0
for i in s:
	if i > maxn:
		maxn = i
s.remove(maxn)
s1 = s[0]
s2 = s[1]
s3 = s[2]
print(int((s1 - s2 + s3) / 2), int((s1 + s2 - s3) / 2), int((s2 - s1 + s3) / 2))


(x1, x2, x3, x4) = input().split()
x1 = int(x1)
x2 = int(x2)
x3 = int(x3)
x4 = int(x4)
a = [x1, x2, x3, x4]
a.sort()
ma = a.pop(-1)
for i in range(3):
	c = ma - a[i]
	print(c, end=' ')


a = list(map(int, input().split()))
a.sort()
ans = []
for i in range(3):
	ans.append(a[-1] - a[i])
print(*ans)


def solve():
	sums = list(map(int, input('').split()))
	sums.sort()
	a = sums[3] - sums[2]
	b = sums[3] - sums[1]
	c = sums[3] - sums[0]
	print(a, b, c)
solve()


liste = [i for i in input().split()]
liste1 = []
(a, b, c) = (0, 0, 0)
for i in liste:
	liste1.append(int(i))
liste1.sort(reverse=True)
a = liste1[0] - liste1[1]
b = liste1[0] - liste1[3]
c = liste1[0] - liste1[2]
print(a, b, c)


nums = [int(i) for i in input().split()]
s = max(nums)
nums.remove(s)
print(s - nums[0], end=' ')
print(s - nums[1], end=' ')
print(s - nums[2], end=' ')


lst = [int(x) for x in input().split()]
lst.sort()
print(lst[-1] - lst[0], lst[-1] - lst[1], lst[-1] - lst[2])


l = [int(x) for x in input().split(' ')]
large = l[0]
for i in l:
	if i > large:
		large = i
l.remove(large)
for i in l:
	print(large - i, end=' ')


x = [int(x) for x in input().split()]
total = max(x)
x.remove(total)
a = total - x[0]
b = x[1] - a
c = total - (a + b)
print(str(a) + ' ' + str(b) + ' ' + str(c))


test = list(map(int, input().split()))
test.sort()
answers = []
for i in range(3):
	answers.append(test[3] - test[i])
[print(_, end=' ') for _ in answers]
print('')


arr = list(map(int, input().split()))
arr.sort()
abc = arr[-1]
a = abc - arr[-2]
b = abc - arr[-3]
c = abc - arr[0]
print(a, b, c)


nolist = list(map(int, input().split()))
n = max(nolist)
nolist.sort()
print(n - nolist[0], n - nolist[1], n - nolist[2])


a = input()
l = a.split(' ')
for i in range(4):
	l[i] = int(l[i])
l = sorted(l)
print(str(l[3] - l[1]) + ' ' + str(l[3] - l[2]) + ' ' + str(l[3] - l[0]))


l = [int(x) for x in input().split()]
l.sort()
for i in range(0, 3):
	print(l[-1] - l[i], end=' ')


(a, b, c, d) = map(int, input().split())
p = max(a, b, c, d)
if a > 1 and b > 1 and (c > 1) and (d > 1):
	if p == a:
		print(p - b, end=' ')
		print(p - c, end=' ')
		print(p - d)
	elif p == b:
		print(p - a, end=' ')
		print(p - c, end=' ')
		print(p - d)
	elif p == c:
		print(p - b, end=' ')
		print(p - a, end=' ')
		print(p - d)
	elif p == d:
		print(p - b, end=' ')
		print(p - c, end=' ')
		print(p - a)


(x, y, z, w) = input().split()
x = int(x)
y = int(y)
z = int(z)
w = int(w)
i = max(x, y, z, w)
if i == x:
	b = (y + w - z) / 2
	c = y - b
	a = z - c
elif i == y:
	b = (z + x - w) / 2
	a = x - b
	c = w - a
elif i == z:
	b = (y + x - w) / 2
	c = y - b
	a = w - c
else:
	a = (x - y + z) / 2
	c = z - a
	b = y - c
print(int(a))
print(int(b))
print(int(c))


(m, n, o, p) = map(int, input().split())
x = max(m, n, o, p)
if n == x:
	p = n - p
	o = n - o
	m = n - m
	print(p, o, m)
if m == x:
	p = m - p
	o = m - o
	n = m - n
	print(p, o, n)
if o == x:
	p = o - p
	n = o - n
	m = o - m
	print(p, n, m)
if p == x:
	n = p - n
	o = p - o
	m = p - m
	print(n, o, m)


ls = list(map(int, input().split()))
m = max(ls)
res = filter(lambda x: x > 0, map(lambda y: m - y, ls))
print(*res)


p = list(map(int, input().split()))
a = []
p.sort()
a.append(p[3] - p[0])
a.append(p[3] - p[1])
a.append(p[3] - p[2])
print(*a)


(x, y, z, t) = map(int, input().split())
L = [x, y, z, t]
L.sort()
x = L[-1] - L[0]
y = L[-1] - L[1]
z = L[-1] - L[2]
print(x, y, z)


import sys
import heapq
from math import ceil, floor, gcd, fabs, factorial, fmod, sqrt
from collections import defaultdict as dd, deque, Counter as c
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
mod = pow(10, 9) + 7
mod2 = 998244353

def data():
	return sys.stdin.readline().strip()

def out(var):
	sys.stdout.write(str(var))

def l():
	return list(sp())

def sl():
	return list(ssp())

def sp():
	return map(int, data().split())

def ssp():
	return map(str, data().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(n, val) for j in range(m)]
arr = l()
arr.sort()
out(str(arr[3] - arr[2]) + ' ' + str(arr[3] - arr[1]) + ' ' + str(arr[3] - arr[0]))


l = list(map(int, input().split()))[:4]
l.sort()
a = l[2] + l[0] - l[3]
b = l[0] + l[1] - l[3]
c = l[2] + l[1] - l[3]
print(a, end=' ')
print(b, end=' ')
print(c)


class Solution:

	def solve(self, nums):
		sum = max(nums)
		nums.remove(sum)
		results = []
		for num in nums:
			results.append(sum - num)
		return ' '.join(map(str, results))
sol = Solution()
nums = list(map(int, input().strip().split()))
print(sol.solve(nums))


nums = [int(v) for v in input().split()]
m = max(nums)
res = [str(m - v) for v in nums if m != v]
print(' '.join(res))


x = [int(x) for x in input().split()]
s = max(x)
x.remove(s)
for item in x:
	print(s - item, end=' ')


import time

def calculateABC(anums):
	anums.sort()
	tot = anums[3]
	ab = anums[0]
	ac = anums[1]
	bc = anums[2]
	abc = []
	abc.append(tot - ab)
	abc.append(tot - ac)
	abc.append(tot - bc)
	return ' '.join([str(x) for x in abc])

def solve():
	anums = [int(x) for x in input().split()]
	print(calculateABC(anums))
solve()


import sys
values = list(map(int, sys.stdin.readline().rstrip().split()))
max_index = -1
max_val = -1
for (i, val) in enumerate(values):
	if val > max_val:
		max_val = val
		max_index = i
ret_string = ''
for (i, v) in enumerate(values):
	if i != max_index:
		ret_string += str(max_val - v) + ' '
ret_string = ret_string.rstrip()
print(ret_string + '\n')


(x1, x2, x3, x4) = map(int, input().split())
nums = [x1, x2, x3, x4]
mx = 1
for i in nums:
	if i > mx:
		mx = i
for i in nums:
	if i != mx:
		print(mx - i, end=' ')


list1 = [int(x) for x in input().split()]
b = sorted(list1)
print(b[3] - b[0], b[3] - b[1], b[3] - b[2])


integers = list(map(int, input().split()))
abc = max(integers)
integers.remove(max(integers))
ab = integers[0]
bc = integers[1]
ca = integers[2]
c = abc - ab
b = bc - c
a = ca - c
print(a, b, c)


import sys
(x1, x2, x3, x4) = map(int, sys.stdin.readline().split())
l = [x1, x2, x3, x4]
l.sort()
print(l[3] - l[0], l[3] - l[1], l[3] - l[2])


n = input().split()
n = [int(i) for i in n]
ma = max(n)
for i in n:
	if ma - i != 0:
		print(ma - i, end=' ')


lst = [int(elem) for elem in input().split()]
lst.sort()
print(lst[-1] - lst[0], lst[-1] - lst[1], lst[-1] - lst[2])


N = list(map(int, input().split(' ')))
max_abcd = max(N)
temp = 0
for i in range(4):
	if N[i] != max_abcd:
		print(max_abcd - N[i], end=' ')


m = [int(i) for i in input().split()]
m.sort()
a = (m[0] + m[1] - m[2]) // 2
b = m[0] - a
c = m[1] - a
print(a, b, c, sep=' ')


nums = [int(i) for i in input().split(' ')]
maxnum = max(nums)
nums.remove(maxnum)
print(maxnum - nums[0], maxnum - nums[1], maxnum - nums[2])


n = [int(x) for x in input().split()]
x = n.copy()
x.sort()
maxi = x[-1]
n.remove(maxi)
a = maxi - n[2]
b = maxi - n[1]
c = maxi - n[0]
print(a, b, c)


def findNumbers(x1, x2, x3, x4):
	a = x4 - x3
	b = x4 - x2
	c = x4 - x1
	return ' '.join((str(i) for i in [a, b, c]))
(x1, x2, x3, x4) = sorted(map(int, input().split()))
print(findNumbers(x1, x2, x3, x4))


maxn = -1
jl = 0
arr = []
listt = map(lambda x: int(x), input().split())
for i in listt:
	arr.append(i)
for i in range(4):
	if arr[i] > maxn:
		maxn = arr[i]
		jl = i
ans = []
for i in range(4):
	if i != jl:
		ans.append(maxn - arr[i])
for i in range(3):
	if i == 2:
		print(ans[i])
	else:
		print(ans[i], end=' ')


a = list(map(int, input().split()))
sm = max(a)
a.remove(sm)
for x in a:
	print(sm - x, end=' ')


num = list(map(int, input().split()))
num.sort()
print(str(num[3] - num[0]) + ' ' + str(num[3] - num[1]) + ' ' + str(num[3] - num[2]))


n = list(range(0, 4))
(n[0], n[1], n[2], n[3]) = map(int, input().split())
r = ['1', '2', '3', '4']
m = max(n)
for i in range(len(n)):
	if n[i] != m:
		for k in range(len(n)):
			r[k] = str(m - n[k])
r.reverse()
r.remove('0')
print(' '.join(r))


a = [int(x) for x in input().split(' ')]
a.sort()
b = []
b.append(str(int((a[0] + a[1] - a[2]) / 2)))
b.append(str(int((a[0] + a[2] - a[1]) / 2)))
b.append(str(int((a[1] + a[2] - a[0]) / 2)))
print(' '.join(b))


talika = sorted(list(map(int, input().split())))
prothom = talika[-1] - talika[0]
ditio = talika[-1] - talika[1]
tritio = talika[-1] - (prothom + ditio)
print(prothom, ditio, tritio)


l = [int(x) for x in input().split()]
l.sort()
m = l.pop(-1)
print(' '.join([str(m - x) for x in l]))


l = list(map(int, input().split()))
l.sort()
(a, b, c, d) = l
print(d - a, d - b, d - c)


n = list(map(int, input().split()))
s_n = sorted(n)
a_b = s_n[0]
b_c = s_n[1]
c_a = s_n[2]
a = (a_b - b_c + c_a) // 2
b = (b_c - c_a + a_b) // 2
c = (c_a - a_b + b_c) // 2
ans = [a, b, c]
print(*ans, sep=' ')


import io, sys, atexit, os
import math as ma
from sys import exit
from decimal import Decimal as dec
from itertools import permutations

def li():
	return list(map(int, input().split()))

def num():
	return map(int, input().split())

def nu():
	return int(input())

def find_gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
mm = 1000000007

def solve():
	t = 1
	for tt in range(t):
		a = li()
		a.sort()
		ax = a[3] - a[0]
		b = a[3] - a[1]
		c = a[3] - a[2]
		print(ax, b, c)
solve()


numbers = [int(i) for i in input().split()]
numbers = sorted(numbers, reverse=True)
originals = []
for (idx, number) in enumerate(numbers[1:]):
	originals.append(numbers[0] - number)
print(*map(str, originals))


numbers = list(map(int, input().split()))
x = numbers[0]
y = numbers[1]
z = numbers[2]
u = numbers[3]
abc = max(x, y, z, u)
ab = abc - x
bc = abc - y
ca = abc - z
aa = abc - u
if ab != 0:
	print(ab, end=' ')
if bc != 0:
	print(bc, end=' ')
if ca != 0:
	print(ca, end=' ')
if aa != 0:
	print(aa, end=' ')


x = list(map(int, input().split()))
z = int(sum(x) / 3)
new = []
for i in x:
	if i != z:
		new.append(i)
	else:
		continue
final = []
for i in new:
	final.append(z - i)
for i in final:
	print(i, end=' ')


List = list(map(int, input().split()))
List.sort()
x = (List[0] - List[1] + List[2]) // 2
y = (List[0] + List[1] - List[2]) // 2
print(f'{x} {y} {List[3] - x - y}')


answer = []
set = input('').split()
set = list(map(int, set))
maxi = max(set)
max_index = set.index(maxi)
set.remove(maxi)
for i in set:
	answer.append(maxi - i)
print(str(answer[0]) + ' ' + str(answer[1]) + ' ' + str(answer[2]))


sums = list(map(int, input().split()))
max_val = max(sums)
sums.remove(max_val)
values = [max_val - val for val in sums]
values = list(map(str, values))
print(' '.join(values))


(x1, x2, x3, x4) = map(int, input().split())
lista = [x1, x2, x3, x4]
lista = sorted(lista, reverse=True)
for i in range(len(lista)):
	print(max(lista) - lista[i + 1], max(lista) - lista[i + 2], max(lista) - lista[i + 3])
	break


a = list(map(int, input().split()))
y = max(a)
a.remove(y)
s = y - a[0]
t = y - a[1]
u = y - a[2]
print(s, t, u)


l = list(map(int, input().split()))
a = sorted(l)
m = []
for i in range(len(a) - 1):
	m.append(a[len(a) - 1] - a[i])
for i in m:
	print(i, end=' ')


angka = [int(i) for i in input().split(' ')]
max_angka = max(angka)
result = [str(abs(i - max_angka)) for i in angka if i < max_angka]
print(' '.join(result))


(q, w, e, r) = map(int, input().split())
qwer = [q, w, e, r]
maxqwer = max(qwer)
if maxqwer == q:
	a = maxqwer - w
	b = maxqwer - e
	c = maxqwer - r
	print(a, b, c)
elif maxqwer == w:
	a = maxqwer - q
	b = maxqwer - e
	c = maxqwer - r
	print(a, b, c)
elif maxqwer == e:
	a = maxqwer - w
	b = maxqwer - q
	c = maxqwer - r
	print(a, b, c)
elif maxqwer == r:
	a = maxqwer - w
	b = maxqwer - e
	c = maxqwer - q
	print(a, b, c)


n = list(map(int, input().split()))[:]
sumx3 = 0
for i in n:
	sumx3 += i
total = sumx3 // 3
a = 0
b = 0
c = 0
for i in n:
	if a == 0:
		a = total - i
	elif b == 0:
		b = total - i
	elif c == 0:
		c = total - i
print(a, b, c)


l = list(map(int, input().split()))
largest = max(l)
li = []
s = ''
for i in l:
	if i != largest:
		s = s + str(largest - i) + ' '
print(s)


a = list(map(int, input().split()))[:4]
m = max(a)
a.sort()
a.pop()
for i in list(a):
	print(m - i, end=' ')


N = list(map(int, input().split()))
maxx = max(N)
N.remove(maxx)
for i in range(len(N)):
	print(maxx - N[i], end=' ')


import sys
numbers = [int(i) for i in sys.stdin.readline().split()]
numbers.sort()
abc = numbers[-1]
del numbers[-1]
print('%d %d %d' % (abc - numbers[0], abc - numbers[1], abc - numbers[2]))


list_ints = [int(x) for x in input().split()]
all_sum = 0
for n in list_ints:
	all_sum += n
all_sum //= 3
has_not_skipped = True
output_str = ''
for n in list_ints:
	if has_not_skipped and n == all_sum:
		continue
	output_str += str(all_sum - n) + ' '
print(output_str)


a = input().split()
a = [int(a[0]), int(a[1]), int(a[2]), int(a[3])]
t = max(a)
a.remove(t)
x = int(t) - int(a[0])
y = int(t) - int(a[1])
z = int(t) - int(a[2])
print(x, y, z)


(x, y, z, s) = sorted(list(map(int, input().split())))
b = (x - y + z) // 2
a = x - b
c = s - a - b
print(a, b, c)


import math
x = input().split()
s = 0
for ele in x:
	s += int(ele)
s //= 3
y = [int(ele) for ele in x]
z = [s - ele for ele in y]
for ele in z:
	if ele != 0:
		print(ele, end=' ')


def foo(a):
	allsum = max(a)
	twosum = min(a)
	a.remove(allsum)
	a.remove(twosum)
	c = allsum - twosum
	one = a[0] - c
	two = a[1] - c
	print(one, two, c)
ar = [int(x) for x in input().split()]
foo(ar)


l = list(map(int, input().split()))
(a, b, c, d) = (l[0], l[1], l[2], l[3])
e = max(a, b, c, d)
r = []
for i in l:
	if e - i == 0:
		continue
	else:
		r.append(e - i)
r = sorted(r)
for i in r:
	print(i, end=' ')


(x1, x2, x3, x4) = map(int, input().split())
if x1 > x2 and x1 > x3 and (x1 > x4):
	a = x1 - x2
	b = x1 - x3
	c = x1 - x4
elif x2 > x1 and x2 > x3 and (x2 > x4):
	a = x2 - x1
	b = x2 - x3
	c = x2 - x4
elif x3 > x1 and x3 > x2 and (x3 > x4):
	a = x3 - x1
	b = x3 - x2
	c = x3 - x4
else:
	a = x4 - x1
	b = x4 - x2
	c = x4 - x3
print(a, b, c)


try:
	l = list(map(int, input().split()))
	l.sort()
	k = l[3]
	a = l[3] - l[0]
	b = l[3] - l[1]
	c = l[3] - l[2]
	s = [a, b, c]
	for i in s:
		print(i, end=' ')
except:
	pass


a = [int(s) for s in input().split()]
n = 0
for i in range(1, len(a)):
	if a[i] > a[n]:
		n = i
for elem in a:
	if a[n] - elem != 0:
		print(a[n] - elem, end=' ')


lst = list(map(int, input().split()))
lst.sort()
(a, b, c, d) = (lst[0], lst[1], lst[2], lst[3])
print(str(d - c) + ' ' + str(d - b) + ' ' + str(d - a))


inp = input
li = list
iinp = lambda : int(inp())
ent = lambda : map(int, inp().split())
lient = lambda : li(ent())
nums = lient()
nums.sort()
(d, e, f, g) = nums
a = (d - f + e) // 2
c = e - a
b = f - c
print('%i %i %i' % (a, b, c))


def main():
	four_numbers = sorted(list(map(int, input().split())))
	a = four_numbers[0] + four_numbers[1] - four_numbers[3]
	b = four_numbers[0] - a
	c = four_numbers[1] - a
	print('{} {} {}'.format(a, b, c))
main()


x = input()
x1 = int(x.split()[0])
x2 = int(x.split()[1])
x3 = int(x.split()[2])
x4 = int(x.split()[3])
l = [x1, x2, x3, x4]
l.sort()
print(l[3] - l[0], l[3] - l[1], l[3] - l[2])


nums = list(map(int, input().split()))
maxi = max(nums)
nums.remove(maxi)
for i in range(3):
	print(maxi - nums[i], end=' ')


(a, b, c, d) = map(int, input().split())
list = []
list.append(a)
list.append(b)
list.append(c)
list.append(d)
list.sort()
x = list[-1] - list[0]
y = list[-1] - list[1]
z = list[-1] - list[2]
print(x, y, z)


(a, b, c, d) = map(int, input().split())
s = (a + b + c + d) // 3
if s == a:
	print(s - d, s - b, s - c)
if s == b:
	print(s - d, s - a, s - c)
if s == c:
	print(s - d, s - b, s - a)
if s == d:
	print(s - a, s - b, s - c)


n = sorted(list(map(int, input().split())))
print(str(n[-1] - n[-2]) + ' ' + str(n[-1] - n[-3]) + ' ' + str(n[-1] - n[-4]))


s = [int(x) for x in input().split()]
a = max(s)
s.remove(a)
print(a - s[0], a - s[1], a - s[2])


n = input().split(' ')
n[0] = int(n[0])
n[1] = int(n[1])
n[2] = int(n[2])
n[3] = int(n[3])
max_n = max(n)
str_n = ''
for i in n:
	if i != max_n:
		a = max_n - i
		str_n += str(a) + ' '
print(str_n)


import os
import sys
if 'DEBUG' in os.environ:
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
x = list(map(int, input().split()))
x.sort()
for i in range(3):
	print(x[-1] - x[i], end=' ')
print()


n = str(input())
p = n.split()
lst = list()
for i in p:
	i = int(i)
	lst.append(i)
lst.sort()
a = lst[3] - lst[0]
b = lst[3] - lst[1]
c = lst[3] - lst[2]
print(a, b, c)


(a, b, c, d) = map(int, input().split())
x = max(a, b, c, d) - min(a, b, c, d)
if a > min(a, b, c, d) and a < max(a, b, c, d):
	y = max(a, b, c, d) - a
	z = max(a, b, c, d) - x - y
	print(x, y, z)
elif b > min(a, b, c, d) and b < max(a, b, c, d):
	y = max(a, b, c, d) - b
	z = max(a, b, c, d) - x - y
	print(x, y, z)
elif c > min(a, b, c, d) and c < max(a, b, c, d):
	y = max(a, b, c, d) - c
	z = max(a, b, c, d) - x - y
	print(x, y, z)
elif d > min(a, b, c, d) and d < max(a, b, c, d):
	y = max(a, b, c, d) - d
	z = max(a, b, c, d) - x - y
	print(x, y, z)
else:
	x = y = z = max(a, b, c, d) / 3
	print(int(x), int(y), int(z))


no_list = list(map(int, input().split(' ')))
for i in no_list:
	t = i
	l = []
	for x in no_list:
		if x != t:
			a = t - x
			l.append(a)
	for y in l:
		if sum(l) != 0 and sum(l) == t:
			print(*l, sep=' ')
			break


(a, b, c, d) = input().split()
result = []
result.append(int(a))
result.append(int(b))
result.append(int(c))
result.append(int(d))
x = max(result)
result.remove(x)
for i in result:
	i = x - i
	print(i, end=' ')


(x, y, z, t) = sorted(list(map(int, input().split())))
a = x - t + y
b = t - y
c = t - x
print(a, b, c)


l = sorted(list(map(int, input().split())))
(a, b, c, d) = l
print(d - a, d - b, d - c)


l = [int(e) for e in input().split()]
l.sort()
w = l[0]
x = l[1]
y = l[2]
z = l[3]
(a, b, c) = (0, 0, 0)
a = (w + x - y) // 2
b = (w + y - x) // 2
c = (x + y - w) // 2
print(a, b, c)


import sys

def get_array():
	return list(map(int, sys.stdin.readline().split()))

def get_ints():
	return list(map(int, sys.stdin.readline().split()))

def input():
	return sys.stdin.readline().strip()

def main():
	p = get_array()
	p.sort()
	(a, b, c, d) = (p[0], p[1], p[2], p[3])
	z = d - a
	y = d - b
	x = d - c
	print(x, y, z)

def __starting_point():
	main()
__starting_point()


(x1, x2, x3, x4) = input().split(' ')
x1 = int(x1)
x2 = int(x2)
x3 = int(x3)
x4 = int(x4)
numb = [x1, x2, x3, x4]
abc = numb[numb.index(sum(numb) / 3)]
other = []
for i in range(0, 4):
	if i != numb.index(sum(numb) / 3):
		other.append(numb[i])
print(abc - other[0], abc - other[1], abc - other[2])


(a, b, c, d) = map(int, input().split(' '))
temp = 0
if a < b:
	temp = a
	a = b
	b = temp
if a < c:
	temp = a
	a = c
	c = temp
if a < d:
	temp = a
	a = d
	d = temp
if b < c:
	temp = b
	b = c
	c = temp
if b < d:
	temp = b
	b = d
	d = temp
if c < d:
	temp = c
	c = d
	d = temp
print(a - b, a - c, a - d)


from sys import stdin, stdout
from math import *
from heapq import *
from collections import *

def test(x1, x2, x3, sm):
	c = x2 + x3 - sm
	if c > 0:
		a = x2 - c
		b = x3 - c
		if a > 0 and b > 0:
			if x1 == b + a:
				return (True, a, b, c)
	return (False, 0, 0, 0)

def main():
	x = [int(x) for x in stdin.readline().split()]
	sm = max(x)
	x.sort()
	x = x[:3]
	permutations = [[0, 1, 2], [0, 2, 1], [1, 0, 2], [1, 2, 0], [2, 0, 1], [2, 1, 0]]
	for permu in permutations:
		(x1, x2, x3) = (x[permu[0]], x[permu[1]], x[permu[2]])
		(d, a, b, c) = test(x1, x2, x3, sm)
		if d == True:
			stdout.write('%d %d %d' % (a, b, c))
			return 0
	return 0
main()


s = input().split()
s = [int(i) for i in s]
x1 = max(s)
s.remove(max(s))
x2 = s[0]
x3 = s[1]
x4 = s[2]
a = x1 - x2
b = x1 - x3
c = x1 - x4
print(a, b, c)


L = list(map(int, input().split()))
x = sum(L) // 3
print(*[x - i for i in L if x - i != 0], sep=' ')


(x1, x2, x3, x4) = map(int, input().split())
m = max(x1, x2, x3, x4)
a = b = c = 0
if m == x4:
	a = x4 - x1
	b = x4 - x2
	c = x4 - x3
elif m == x1:
	a = x1 - x4
	b = x1 - x2
	c = x1 - x3
elif m == x2:
	a = x2 - x4
	b = x2 - x1
	c = x2 - x3
elif m == x3:
	a = x3 - x4
	b = x3 - x2
	c = x3 - x1
print(a, b, c)


from typing import Tuple

def solve(a: int, b: int, c: int, d: int) -> Tuple[int, int, int]:
	return (d - a, d - b, d - c)
(a, b, c, d) = sorted(map(int, input().split()))
print(*solve(a, b, c, d))


(x, y, z, w) = map(int, input().split())
f = x + y + z + w
m = f // 3
zcnt = 0
if m - x == 0:
	zcnt += 1
else:
	print(m - x, end=' ')
if m - y == 0:
	zcnt += 1
else:
	print(m - y, end=' ')
if m - z == 0:
	zcnt += 1
else:
	print(m - z, end=' ')
if m - w == 0:
	zcnt += 1
else:
	print(m - w, end=' ')
for i in range(zcnt - 1):
	print(0, end=' ')
print('')


(x1, x2, x3, x4) = map(int, input().split())
arr = [x1, x2, x3, x4]
X = max(arr)
arr.remove(X)
arr = [X - a for a in arr]
for a in arr:
	print(a)


lst = list(map(int, input().split()))
abc = max(lst)
lst.remove(abc)
(a, b, c) = list(map(lambda x: abc - x, lst))
print(a, b, c)


import os

def _f(x1, x2, x3, x4):
	x_arr = [x1, x2, x3, x4]
	x_arr.sort(reverse=True)
	c = x_arr[0] - x_arr[1]
	a = x_arr[2] - c
	b = x_arr[3] - c
	return (a, b, c)

def f(x1, x2, x3, x4):
	(a, b, c) = _f(x1, x2, x3, x4)
	return f'{a} {b} {c}'
if os.environ.get('DEBUG', False):
	print(f'{f(3, 6, 5, 4)} = 2 1 3')
	print(f'{f(40, 40, 40, 60)} = 20 20 20')
	print(f'{f(201, 101, 101, 200)} = 1 100 100')
else:
	(x1, x2, x3, x4) = list(map(int, input().split()))
	print(f(x1, x2, x3, x4))


l = list(map(int, input().split()))
d = max(l)
for i in range(len(l)):
	l[i] = d - l[i]
l.remove(0)
for i in l:
	print(i, end=' ')


L = list(map(int, input().split()))
M = max(L)
L.remove(M)
print(M - L[0], M - L[1], M - L[2])


(p, q, r, s) = input().split()
p = int(p)
q = int(q)
r = int(r)
s = int(s)
lst = sorted([p, q, r, s])
print(int(lst[-1]) - int(lst[0]), int(lst[-1]) - int(lst[1]), int(lst[-1]) - int(lst[2]))


(x1, x2, x3, x4) = [int(i) for i in input().split()]
m = max(x1, x2, x3, x4)

def f(a, b, c, m):
	(x, y, z) = (m - a, m - b, m - c)
	print(x, y, z)
if x1 == m:
	f(x2, x3, x4, x1)
elif x2 == m:
	f(x1, x3, x4, x2)
elif x3 == m:
	f(x1, x2, x4, x3)
else:
	f(x1, x2, x3, x4)


l = list(map(int, input().split()))
l.sort()
a = []
for i in range(len(l) - 1):
	a.append(l[-1] - l[i])
print(*a)


x = list(map(int, input().split()))
for i in (0, 1, 2, 3):
	abc = x[i]
	bc = x[(i + 1) % 4]
	ac = x[(i + 2) % 4]
	ab = x[(i + 3) % 4]
	a = abc - bc
	b = abc - ac
	c = abc - ab
	if a + b + c == abc and a + b == ab and (a + c == ac) and (b + c == bc):
		print(a, b, c)
		break


a = [int(q) for q in input().split()]
a.sort()
print(f'{a[3] - a[0]} {a[3] - a[1]} {a[3] - a[2]}')


def line():
	return map(int, input().split())
x = sorted(line())
print(' '.join(map(str, (x[-1] - q for q in x[:-1]))))


a = input()
p = a.split()
for i in range(len(p)):
	p[i] = int(p[i])
n = max(p)
p.remove(n)
print(n - p[0], n - p[1], n - p[2])


import sys
import math
import os
import itertools
import string
import heapq
import _collections
from collections import Counter
from collections import defaultdict
from functools import lru_cache
import bisect
import re
import queue

class Scanner:

	@staticmethod
	def int():
		return int(sys.stdin.readline().rstrip())

	@staticmethod
	def string():
		return sys.stdin.readline().rstrip()

	@staticmethod
	def map_int():
		return [int(x) for x in Scanner.string().split()]

	@staticmethod
	def string_list(n):
		return [input() for i in range(n)]

	@staticmethod
	def int_list_list(n):
		return [Scanner.map_int() for i in range(n)]

	@staticmethod
	def int_cols_list(n):
		return [int(input()) for i in range(n)]

class Math:

	@staticmethod
	def gcd(a, b):
		if b == 0:
			return a
		return Math.gcd(b, a % b)

	@staticmethod
	def lcm(a, b):
		return a * b // Math.gcd(a, b)

	@staticmethod
	def round_up(a, b):
		return -(-a // b)

	@staticmethod
	def is_prime(n):
		if n < 2:
			return False
		if n == 2:
			return True
		if n % 2 == 0:
			return False
		d = int(n ** 0.5) + 1
		for i in range(3, d + 1, 2):
			if n % i == 0:
				return False
		return True

class PriorityQueue:

	def __init__(self, l=[]):
		self.q = l
		heapq.heapify(self.q)
		return

	def push(self, n):
		heapq.heappush(self.q, n)
		return

	def pop(self):
		return heapq.heappop(self.q)
MOD = int(1000000000.0) + 7
INF = int(1000000000000000.0)

def main():
	X = Scanner.map_int()
	X.sort()
	print(X[3] - X[0], X[3] - X[1], X[3] - X[2])
main()


l = list(map(int, input().split()))
a = max(l)
l.remove(a)
li = []
for i in l:
	b = a - i
	li.append(b)
for j in li:
	print(j, end=' ')


l = [int(x) for x in input().split()]
l.sort()
n = [str(l[-1] - l[0]), str(l[-1] - l[1]), str(l[-1] - l[2])]
print(' '.join(n))


a = list(map(int, input().split()))
x = max(a)
b = list()
a.remove(x)
a.reverse()
for i in a:
	s = x - i
	b.append(s)
print(*b)


a = [int(k) for k in input().split(' ')]
m = max(a)
a.remove(m)
for t in a:
	print(m - t, end=' ')


vals = [int(x) for x in input().split()]
mm = vals[0]
index = 0
ans = []
for i in range(1, 4):
	if mm < vals[i]:
		mm = vals[i]
		index = i
for i in range(4):
	if i == index:
		continue
	ans += [mm - vals[i]]
print(ans[0], ans[1], ans[2])


n = list(map(int, input().split()))
q = max(n)
n.remove(q)
for i in range(3):
	n[i] = q - n[i]
print(*n)


(p, q, r, s) = map(int, input().split())
if (p + q + s) / 2 == r:
	(p, q, r, s) = (p, q, s, r)
elif (p + s + r) / 2 == q:
	(p, q, r, s) = (p, s, r, q)
elif (s + q + r) / 2 == p:
	(p, q, r, s) = (s, q, r, p)
print((p + q - r) // 2, (p - q + r) // 2, (-p + q + r) // 2)


k = [*map(int, input().split())]
z = sorted(k)
p = z[3] - z[0]
m = z[3] - z[1]
o = z[3] - z[2]
print('{} {} {}'.format(p, m, o))


numbers = [int(x) for x in input().split()]
restored_nums = []
sum_of_all = max(numbers)
for num in numbers:
	if num != sum_of_all:
		restored_nums.append(int(sum_of_all - num))
print(*restored_nums)


a = sorted(map(int, input().split()))
b = a[0]
del a[0]
suma = a.pop()
otv = []
otv.append(suma - b)
for elem in a:
	otv.append(suma - elem)
print(*otv)


L = list(map(int, input().split()))
L.sort()
A = [str(L[3] - i) for i in L[:3]]
print(' '.join(A))


def input_ints():
	return [int(x) for x in input().split()]
xs = input_ints()
m = max(xs)
xs.remove(m)
(a, b, c) = xs
a_ = a + b - m
b_ = a + c - m
c_ = b + c - m
print(a_, b_, c_)


ar = list(map(int, input().split(' ')))
answer = []
for i in ar:
	if max(ar) - i > 0:
		answer.append(max(ar) - i)
print(' '.join(list(map(str, answer))))


b = list(map(int, input().strip().split()))
b.sort()
(r, s, t) = (b[3] - b[2], b[3] - b[1], b[3] - b[0])
print(r, s, t)


lis = list(map(int, input().split()))
for i in range(3):
	print(max(lis) - min(lis), end=' ')
	lis.remove(min(lis))


(x1, x2, x3, x4) = map(int, input().split())
s = [x1, x2, x3, x4]
s.sort()
for i in range(3):
	print(s[-1] - s[i], end=' ')


def main():
	numbers = [int(x) for x in input().split()]
	highest_number = max(numbers)
	numbers.remove(highest_number)
	a = highest_number - numbers[0]
	b = highest_number - numbers[1]
	c = highest_number - numbers[2]
	print(str(a) + ' ' + str(b) + ' ' + str(c))
main()


import time
a = 0
b = 0
c = 0
arr = list(map(int, input().split()))[:4]
start_time = time.time()
arr = sorted(arr)
a = arr[-1] - arr[2]
b = arr[-1] - arr[1]
c = arr[-1] - arr[0]
end_time = time.time()
print(f'{a} {b} {c}')


s = input()
s = s.split()
d = []
for x in s:
	d.append(int(x))
m = max(d)
res = []
for x in d:
	if x != m:
		res.append(str(m - x))
print(' '.join(res))


x = list(map(int, input().split()))
m = max(x)
k = 0
for i in x:
	if m == i:
		if k > 0:
			print(m - i, end=' ')
		k += 1
	else:
		print(m - i, end=' ')


arr = list(map(int, input().split()))[:4]
arr.sort(reverse=False)
x1 = arr[0]
x2 = arr[1]
x3 = arr[2]
x4 = arr[3]
a = x4 - x3
b = x1 - a
c = x3 - b
print(a, b, c)


x = input('')
list = x.split()
a = int(list[0])
b = int(list[1])
c = int(list[2])
d = int(list[3])
y = max(a, b, c, d)
p = y - a
q = y - b
r = y - c
s = y - d
if p != 0:
	print(p, end=' ')
if q != 0:
	print(q, end=' ')
if r != 0:
	print(r, end=' ')
if s != 0:
	print(s, end=' ')


L = [int(i) for i in input().split()]
g = 0
for i in L:
	if i > g:
		g = i
for i in L:
	if i < g:
		print(g - i, end=' ')


a = list(map(int, input().split()))
maximum = max(a)
a.remove(maximum)
for i in range(len(a)):
	print(maximum - a[i], end=' ')


from itertools import product

def input_numbers():
	array = input()
	array_list = list(map(int, array.split(' ')))
	return array_list

def find_three_numbers(target_array, max_num):
	temp_arr = target_array
	temp_arr.remove(max_num)
	tuple_arr = temp_arr
	(a, b, c) = tuple_arr
	(x, y, z) = (abs(max_num - a), abs(max_num - b), abs(max_num - c))
	return (x, y, z)

def main():
	input_ = input_numbers()
	(fir, sec, thr) = find_three_numbers(input_, max(input_))
	print(fir, sec, thr)
main()


numbers = list(map(int, input().strip().split()))
numbers.sort()
print(*[numbers[-1] - x for x in numbers[:-1]])


nums = sorted(map(int, input().split()), reverse=True)
a_b_c = nums[0]
a_b = nums[1]
a_c = nums[2]
b_c = nums[3]
c = a_b_c - a_b
a = a_c - c
b = b_c - c
print(a, b, c)


import sys

def getli():
	return list(map(int, sys.stdin.readline().strip().split()))
A = getli()
Max = max(A)
A.pop(A.index(Max))
a = (A[0] + (A[1] - A[2])) // 2
print(a, A[0] - a, A[1] - a)


L = input()
L = [int(item) for item in L.split(' ')]

def permute(seq):
	if not seq:
		yield seq
	for index in range(len(seq)):
		rest = seq[:index] + seq[index + 1:]
		for item in permute(rest):
			yield (item + seq[index:index + 1])
pred = max(L)
L = sorted(L)[:-1]
for item in permute(L):
	res = (item[0] - item[2] + item[1]) / 2
	if item[0] + item[1] - res == pred:
		print(int(res), int(item[0] - res), int(item[1] - res))
		break


x = input().split(' ')
aux = []
for i in x:
	aux.append(int(i))
aux.sort(reverse=True)

def test(array, i, j, k):
	c = array[0] - array[i]
	a = array[j] - c
	b = array[k] - c
	if a + b + c == array[0]:
		print(str(a) + ' ' + str(b) + ' ' + str(c))
test(aux, 1, 2, 3)


import math
k = list(map(int, input().split()))
j = max(k)
k.remove(j)
for i in k:
	print(abs(i - j), end=' ')


import itertools
nums = sorted([int(i) for i in input().split()], reverse=True)
for (i, n) in enumerate(nums):
	sa = nums[0:i] + nums[i + 1:]
	perms = itertools.permutations(sa)
	for p in perms:
		pi = list(p)
		a = n - pi[2]
		b = n - pi[1]
		c = n - pi[0]
		if n - pi[2] + (n - pi[1]) + (n - pi[0]) == n:
			print(a, b, c)
			break


a = list(map(int, input().strip().split()))
x = max(a)
b = ''
for i in a:
	if i == x:
		continue
	else:
		b += str(x - i) + ' '
print(b.rstrip())


nums = sorted(list((int(x) for x in input().split())))
print('{} {} {}'.format(nums[-1] - nums[0], nums[-1] - nums[1], nums[-1] - nums[2]))


from sys import stdin

def main():
	numbers = [int(x) for x in stdin.readline().split()]
	numbers.sort()
	a = str(numbers[3] - numbers[0])
	b = str(numbers[3] - numbers[2])
	c = str(numbers[3] - numbers[1])
	ans = a + ' ' + b + ' ' + c
	print(ans)
main()


numbers = [int(i) for i in input('').strip().split(' ')]
abcsum = max(numbers)
del numbers[numbers.index(abcsum)]
a_b = min(numbers)
a = abcsum - a_b
b = a_b - a
del numbers[numbers.index(a_b)]
b = numbers[0] - a
c = abcsum - a - b
print(a, b, c)


from sys import stdin
test = list(map(int, stdin.readline().split()))
test.sort()
print(test[3] - test[0], test[3] - test[1], test[3] - test[2])


n = [int(i) for i in input().split()]
for i in n:
	if not i == max(n):
		print(str(max(n) - i), end=' ')


num = []
(x, y, z, w) = map(int, input().rstrip().split())
num.append(x)
num.append(y)
num.append(z)
num.append(w)
num.sort()
a = num[0] + num[1] - num[3]
b = num[1] + num[2] - num[3]
c = num[0] + num[2] - num[3]
print(a, b, c)


(a, b, c, d) = sorted([int(p) for p in input().split()])
print(abs(d - c), abs(d - b), abs(d - a))


(x1, x2, x3, x4) = [int(x) for x in input().split()]
x = max(x1, x2, x3, x4)
if x - x1 != 0:
	print(x - x1)
if x - x2 != 0:
	print(x - x2)
if x - x3 != 0:
	print(x - x3)
if x - x4 != 0:
	print(x - x4)


num = list(map(int, input().strip().split()))
biggest = max(num)
abc = []
for i in range(4):
	if num[i] == biggest:
		continue
	abc.append(biggest - num[i])
print(abc[0], abc[1], abc[2])


x = input().split()
maior = 0
pos_maior = -1
for i in range(0, len(x), 1):
	x[i] = int(x[i])
	if x[i] > maior:
		maior = x[i]
		pos_maior = i
del x[pos_maior]
a = int(x[1]) - maior + int(x[0])
b = int(x[2]) - maior + int(x[0])
c = maior - int(x[0])
res = [a, b, c]
print(a, b, c)


x = input().split()
max = int(x[0])
if int(x[1]) > max:
	a = max
	max = int(x[1])
else:
	a = int(x[1])
if int(x[2]) > max:
	b = max
	max = int(x[2])
else:
	b = int(x[2])
if int(x[3]) > max:
	c = max
	max = int(x[3])
else:
	c = int(x[3])
print(a + b - max, a + c - max, b + c - max)


x = [int(i) for i in input().split()]
i = x.index(max(x))
j = max(x)
x.pop(i)
print(j - x[0], '', end='')
print(j - x[1], '', end='')
print(j - x[2], '', end='')


(q, w, e, r) = map(int, input().split())
l = []
l.append(q)
l.append(w)
l.append(e)
l.append(r)
l.sort()
a = l[-1] - l[0]
b = l[-1] - l[1]
c = l[-1] - l[2]
print(a, end=' ')
print(b, end=' ')
print(c, end='')


def restore_the_three(x, y, z, k):
	l = [x, y, z, k]
	three_sum = max(l)
	l.pop(l.index(three_sum))
	a = three_sum - l[0]
	c = l[1] - a
	b = l[0] - c
	print(a, b, c)
(a, b, c, d) = tuple(map(int, input().strip(' ').split(' ')))
restore_the_three(a, b, c, d)


n = [int(i) for i in input().split()]
m = max(n)
for k in range(4):
	n[k] = m - n[k]
n.remove(0)
print(*n, sep=' ')


l = list(map(int, input().strip().split()))[:4]
l.sort()
k = l[-1]
for i in range(3):
	print(k - l[i], end=' ')


n = [int(x) for x in input().split()]
maxi = n[0]
for i in range(len(n)):
	if maxi < n[i]:
		maxi = n[i]
for i in range(len(n)):
	if maxi - n[i] != 0:
		print(maxi - n[i], end=' ')
print()


a = [int(s) for s in input().split()]
a = sorted(a)
print(a[3] - a[0], a[3] - a[1], a[3] - a[2])


x = list(map(int, input().split()))
mx = max(x)
for y in x:
	temp = mx - y
	if temp:
		print(temp, end=' ')
print()


def main():
	num = input().split(' ')
	for i in range(0, len(num)):
		for j in range(0, len(num) - (i + int(1))):
			y = num[j + 1]
			if int(num[j]) > int(num[j + 1]):
				num[j + 1] = num[j]
				num[j] = y
	a = int(num[3]) - int(num[0])
	b = int(num[3]) - int(num[1])
	c = int(num[3]) - int(num[2])
	ans = []
	ans.append(str(a))
	ans.append(str(b))
	ans.append(str(c))
	print(' '.join(ans))

def test():
	if 1000000000 > 666666667:
		print('Yes')
	else:
		print('NO')
main()


x = list(map(int, input().split()))
maxx = max(x)
x.sort()
print(maxx - x[0], maxx - x[1], maxx - x[2])


arr = list(map(int, input().strip().split()))
x = max(arr)
for i in arr:
	if x - i == 0:
		pass
	else:
		print(x - i, end=' ')


(y1, y2, y3, y4) = map(int, input().split())
data = sorted([y1, y2, y3, y4])
x3 = data[-1] - data[-2]
x2 = data[-3] - x3
x1 = data[-1] - x2 - x3
print(x1, x2, x3)


a = [int(x) for x in input().split()]
b = max(a)
for i in range(len(a)):
	if b - a[i] == 0:
		pass
	else:
		print(b - a[i], end=' ')


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def input():
	return sys.stdin.readline().rstrip('\r\n')
l = list([int(x) for x in input().split()])
m = max(l)
for i in l:
	if i != m:
		print(m - i, end=' ')


import math as mt
import sys, string, bisect
input = sys.stdin.readline
from collections import deque
L = lambda : list(map(int, input().split()))
Ls = lambda : list(input().split())
M = lambda : map(int, input().split())
I = lambda : int(input())
l = L()
d = max(l)
l.remove(d)
print(*[d - l[i] for i in range(3)])


x = list(map(int, input().split()))
m = max(x)
res = [str(m - n) for n in x if n != m]
print(' '.join(res))


def restoring_numbers():
	array = list(map(int, input().split()))
	array.sort()
	maxim = max(array)
	ac = array[0]
	ab = array[1]
	bc = array[2]
	b = maxim - ac
	c = maxim - ab
	a = maxim - bc
	return (a, b, c)
x = restoring_numbers()
print(x[0], x[1], x[2])


a = [int(x) for x in input().split()]
s = max(a)
b = filter(lambda x: x != 0, map(lambda x: s - x, a))
print(*b)


number_go = list(map(int, input().split()))
x = 0
if sum(number_go) % 3 == 0:
	number_go.sort()
	print(number_go[1] + number_go[0] - number_go[3], number_go[1] + number_go[2] - number_go[3], number_go[0] + number_go[2] - number_go[3])
else:
	print('Cannot find !')


isDebug = False
x = [int(x) for x in input().split()]
x = sorted(x)
print(f'x={x}') if isDebug else ''
ab = x[0]
ac = x[1]
bc = x[2]
abc = x[3]
a = abc - bc
b = ab - a
c = ac - a
print(f'{a} {b} {c}')


user = str(input())
index = user.find(' ')
first = int(user[:index])
nums = []
nums.append(first)
abc = first
i = 1
index = 0
flag = True
while flag:
	index = user.find(' ', index + 1)
	nxtindex = user.find(' ', index + 1)
	if nxtindex == -1:
		nums.append(int(user[index + 1:]))
		flag = False
	else:
		nums.append(int(user[index + 1:nxtindex]))
	if abc < nums[i]:
		abc = nums[i]
	i += 1
truenums = []
for j in range(len(nums)):
	if nums[j] - abc != 0:
		truenums.append(abc - nums[j])
print(str(truenums[0]) + ' ' + str(truenums[1]) + ' ' + str(truenums[2]))


x = list(map(int, input().split()))
n = max(x)
x.pop(x.index(n))
for i in range(3):
	print(n - x[i], end=' ')


(a, b, c, d) = map(int, input().split())
p = a
p = max(a, b, c, d)
l = [a, b, c, d]
for i in l:
	if p - i != 0:
		print(p - i, end=' ')


from math import gcd
v = list(map(int, input().split()))
maior = max(v)
v.remove(maior)
b = (v[0] - v[1] + v[2]) // 2
c = v[2] - b
a = v[0] - b
print(a, b, c)


(x1, x2, x3, x4) = map(int, input().split())
abc = 0
for i in [x1, x2, x3, x4]:
	if i > abc:
		abc = i
non = []
for i in [x1, x2, x3, x4]:
	if i != abc:
		non.append(i)
s = ''
for i in non:
	s += str(abc - i) + ' '
print(s[:-1])


lis = list(map(int, input().split()))
res = max(lis)
f = []
for i in range(len(lis)):
	if lis[i] != res:
		f.append(res - lis[i])
for i in f:
	print(i, end=' ')


inputs = input().split()
listN = list(map(int, inputs))
listN.sort()
listN.reverse()
(x_1, x_2, x_3, x_4) = listN
c = x_1 - x_2
a = x_3 - c
b = x_4 - c
print(a, b, c)


lst = list(map(int, input().split()))
lst = sorted(lst, reverse=True)
b = lst[0] - lst[1]
a = lst[2] - b
c = lst[3] - b
print(a, b, c)


x = [int(n) for n in input().split()]
for i in x:
	if i != max(x):
		print(max(x) - i)


a = list(map(int, input().split()))
y = max(a)
z = a.index(y)
r = []
for i in range(len(a)):
	if i != z:
		r.append(y - a[i])
print(' '.join(map(str, r)))


h = [int(i) for i in input().split()]
max = h[0]
k = []
for i in range(4):
	if h[i] >= max:
		max = h[i]
for i in range(4):
	if max - h[i] != 0:
		k.append(max - h[i])
k = ' '.join(map(str, k))
print(k)


li = list(map(int, input().split()))
a = max(li) - min(li)
li.remove(max(li))
li.remove(min(li))
b = li[0] - a
c = li[1] - a
print(a, b, c)


arr = list(map(int, input().strip().split(' ')))
arr.sort()
arr.reverse()
ma = arr[0]
for i in range(1, len(arr)):
	print(ma - arr[i], end=' ')


(a, b, c, d) = map(int, input().split())
sum_ = (a + b + c + d) // 3
for el in range(4):
	if [a, b, c, d][el] == sum_:
		E = []
		for i in range(4):
			if i != el:
				E.append([a, b, c, d][i])
		print(sum_ - E[0])
		print(sum_ - E[1])
		print(sum_ - E[2])


import sys
input = sys.stdin.readline
I = lambda : list(map(int, input().split()))
(a, b, c, d) = sorted(I())
print(d - a, d - b, d - c)


x = list(map(int, input().split()))
x.sort()
m = x[len(x) - 1]
x.pop()
z = []
for i in x:
	z.append(m - i)
print(' '.join(map(str, z)))


q = [int(x) for x in input().split()]
q.sort()
tot = q[-1]
print(tot - q[0], tot - q[1], tot - q[2])


lst = [int(x) for x in input().split()]
sum_3 = 0
max = 0
min = lst[0]
for x in lst:
	if max <= x:
		if x >= sum_3:
			max = sum_3
			sum_3 = x
		else:
			max = x
	if x >= sum_3:
		sum_3 = x
	if min > x:
		min = x
a = sum_3 - max
b = min - a
c = max - b
print(a, b, c)


c = [int(i) for i in input().split()]
m = max(c)
c.remove(m)
for i in c:
	print(str(m - i), end=' ')


(k, l, m, n) = map(int, input().split())
t = max(k, l, m, n)
if t - k > 0:
	print(t - k, end=' ')
if t - l > 0:
	print(t - l, end=' ')
if t - m > 0:
	print(t - m, end=' ')
if t - n > 0:
	print(t - n, end=' ')


def main():
	nums = list(map(int, input().split()))
	nums.sort()
	print(nums[-1] - nums[0], nums[-1] - nums[1], nums[-1] - nums[2])
main()


def find(l):
	l.sort()
	(a, b, c) = (l[0], l[1], l[2])
	s = ''
	s = s + str((a + b - c) // 2) + ' '
	s = s + str((b + c - a) // 2) + ' '
	s = s + str((c + a - b) // 2) + ' '
	return s
l = list(map(int, input().strip().split()))
print(find(l))


d = input().split()
io = []
for i in d:
	io.append(int(i))
io.sort()
a = io[-1] - io[-2]
c = io[-3] - a
b = io[-1] - a - c
print(a, b, c)


def main():
	nums = list(map(int, input().strip().split()))
	sm = max(nums)
	print(*[sm - n for n in nums if n != sm])
main()


numbers = list(map(int, input().split()))
sum = 0
answer = ''
for i in range(len(numbers)):
	if sum < numbers[i]:
		sum = numbers[i]
numbers.remove(sum)
for i in range(len(numbers)):
	answer += str(sum - numbers[i]) + ' '
print(answer)


list1 = list(map(int, input().split(' ')))
list1.sort()
(a, b, c, d) = list1
print(d - a, d - b, d - c)


(a, b, c, sm) = sorted(map(int, input().split()))
a1 = sm - a
b1 = sm - b
c1 = sm - c
print(a1, b1, c1)


x = sorted(map(int, input().split()))
d = x[-1]
print(d - x[2], d - x[1], d - x[0])


n = list(map(int, input().split()))
k = sorted(n)
l = []
for i in range(len(n) - 1):
	h = k[len(n) - 1] - k[i]
	l.append(h)
l = list(map(str, l))
s = ' '.join(l)
print(s)


a = sorted(list(map(int, input().split())))
print(' '.join((str(a[3] - i) for i in a[:3])))


k = list(map(int, input().split()))
k.sort()
(a, b, c, d) = map(int, k)
e = d - c
f = d - b
g = d - a
print(e, f, g)


l = list(map(int, input().split()))
l.sort()
res = []
res.append((l[1] - l[0] + l[2]) // 2)
res.append(l[2] - res[0])
res.append(l[0] - res[1])
print(res[0], res[1], res[2])


nums = list(map(int, input().split()))
max_el = float('-inf')
idx = -1
for (i, num) in enumerate(nums):
	if num > max_el:
		max_el = num
		idx = i
res = []
for (i, num) in enumerate(nums):
	if i != idx:
		res.append(max_el - num)
print(*res)


l = list(map(int, input().split(' ')))
i = l.index(max(l))
for k in range(3):
	print(max(l) - l[(i + k + 1) % 4], end=' ')


(x1, x2, x3, x4) = map(int, input().split())
f = [x1, x2, x3, x4]
f = sorted(f)
a = (f[0] - (f[2] - f[1])) // 2
b = f[0] - a
c = f[1] - a
print(a, b, c)