N=int(eval(input()))

print((48-N))

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

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

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