# print('Hello')
# a=input()
# a=int(a)
# if a%7==0:
# print("multiple")
# else:
# print("not multiple")
# a=input()
# a=float(a)
# if 50<=a and a<=60:
# print("win")
# else:
# print("lose")
# a, b, c = input().split()
# a=int(a)
# b=int(b)
# c=int(c)
# tot=a-b+c
# if tot%10==0:
# print("대박")
# else:
# print("그럭저럭")
a, b = input().split()
a=int(a)
b=int(b)
print(a,b)
tot=b-30
if tot<0:
tot=int(tot)
tot=60+tot
a=a-1
if a == 0:
a = a + 23
print(a, tot)
else :
print(a, tot)
else :
print(a,tot)
https://www.onlinegdb.com/online_python_compiler



