a = int(input())
b = int(input())
c = int(input())
x = max(a, b, c)
y = min(a, b, c)
if x != a and y != a:
z = a
elif x != b and y != b:
z = b
else:
z = c
print(x, z, y)
a = int(input())
b = int(input())
c = int(input())
x = max(a, b, c)
y = min(a, b, c)
if x != a and y != a:
z = a
elif x != b and y != b:
z = b
else:
z = c
print(x, z, y)