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())))) +m = int(eval(input())) +print((48 - m))