from datetime import datetime, timedelta
def TtoM(tm: str):
st = datetime.strptime(stime, "%H:%M")
tm = datetime.strptime(tm, "%H:%M")
return (tm - st).total_seconds()
def MtoT(m: int):
st = datetime.strptime(stime, "%H:%M")
tm = st + timedelta(minutes=m)
return tm.strftime("%H:%M")
stime = input() # 输入就餐原因
k = int(input()) # 输入就餐间隔
s = input().split() # 抽样学生
n = 1500
nj = ["高三", "高一", "高二"]
d = [0] * 15
cw = [0] * 100
w = [0] * n
t = [0] * 3
ans = 0
t[0] = TtoM(stime)
for i in range(3):
if i > 0:
__________
for j in range(5):
d[i * 5 + j] = t[i] + j
for i in range(15):
print(MtoT(int(d[i])))
for j in range(n):
if j % 15 == 0:
i = j // 15
cw[i] = i * 10
w[j] = cw[i] - (__________) * 60
ans += w[j]
aver = ans // n // 60
i = 0
while i < 3:
if __________:
j = i * 500 + int(s[1]) - 1
break
i += 1
print(s[0], s[1], "进入食堂的同学大约", w[j] // 60, "分钟打到饭菜")