H, M = map(int, input().split())
if M >= 45:
    print(H, M - 45)
else:
    if H == 0:
        H = 24
    print(H - 1, M + 15)

e2709fad701ee6109b0e43f811b7abf26941eb5b
<mask token>

<mask token>
if M >= 45:
    print(H, M - 45)
else:
    if H == 0:
        H = 24
    print(H - 1, M + 15)

H, M = map(int, input().split())
if M >= 45:
    print(H, M - 45)
else:
    if H == 0:
        H = 24
    print(H - 1, M + 15)
