백준 2884번
0 ≤ H ≤ 23, 0 ≤ M ≤ 59
inputStr = input()
time = [int(x) for x in inputStr.split(' ')]
h = time[0]
m = time[1]
if (time[0] == 0):
if (time[1] < 45):
h = 23
m = 60 - abs(time[1] - 45)
else:
m = 45 - time[1]
else:
if (time[1] < 45):
h = time[0] - 1
m = 60 - abs(time[1] - 45)
else:
m = 45 - time[1]
print(h, m)
inputStr = input()
time = [int(x) for x in inputStr.split(' ')]
h = time[0]
m = time[1]
if (time[0] == 0):
if (time[1] < 45):
h = 23
m = 60 - abs(time[1] - 45)
else:
m = time[1] - 45
else:
if (time[1] < 45):
h = time[0] - 1
m = 60 - abs(time[1] - 45)
else:
m = time[1] - 45
print(h, m)