#A0207. 起床时间

起床时间

Title Description

It's winter vacation, and the excavator has started winter training. 33DAI has classes in the mornings these days.

Given that the class time is hh hour mm minute in the morning, 33DAI takes xx minutes from waking up to arriving at the classroom.

What is the latest time for 33DAI to wake up so as not to be late.

Input format

The first line consists of three integers h,m,xh, m, x

Output format

Output a line consisting of two integers H,MH, M , representing that the latest time for 33DAI to wake up is MM minutes when HH is required to avoid being late.

Please do not output extra leading 00 , such as time '07:05', please output '75'.

8 0 50
7 10
10 30 25
10 5

Example explanation

  • Example 1: The class starts at 08:00 and 33DAI takes 5050 minutes to arrive at school, so the latest wake-up time is 07:10.
  • Example 2: The class time is 10:30, and 33DAI takes 2525 minutes to arrive at school, so the latest wake-up time is 10:05.

Data scale and agreement

For data of 100%100 \% , 8h118 \le h \le 11 , 0m590 \le m \le 59 , 1x1201 \le x \le 120 .

-Subtask 1 (30 points): Ensure xmx \le m . -Subtask 2 (30 points): Ensure x=60x=60 . -Subtask 3 (40 points): No special restrictions.