a = int(eval(input()))

print((48 - a))
m = int(eval(input()))

print((48-m))
a = int(eval(input()))
print((48 - a))

m = int(eval(input()))
print((48 - m))

-a = int(eval(input())) -print((48 - a)) +m = int(eval(input())) +print((48 - m))