M=int(eval(input()))

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

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

-M = int(eval(input())) -print((48 - M)) +print((48 - int(eval(input()))))