Under construction

Still being built. Things may change

Cuckoo! Cuckoo!

Time limit1sMemory limit1024 MB

Summary
Given a 12-hour clock time and a count N, find the clock time at which the cuckoo has sounded N times in total.
Level

Easy2 of 10

Topics
Implementation, Simulation
Solved
No attempts yet

Problem

A cuckoo bird pops out of the cuckoo clock and sounds off once at each quarter hour, half hour, and three-quarter hour. At the start of each hour, it sounds off as many times as the hour, from 1 to 12. Given the current time and a target number NN, find the time when the cuckoo has sounded off NN times. Sounds at the starting time count toward the total.

If the count is reached on the hour, report the time at the start of that hour. You may assume the cuckoo finishes sounding off before the minute is up.

Input

The first line contains the current time in the form HH:MM, where 1 ≤\le HH ≤\le 12 and 0 ≤\le MM ≤\le 59, with leading zeros if necessary. The second line contains a single integer NN, where 1 ≤\le NN ≤\le 200.

Output

Print the time when the cuckoo has sounded off NN times, in the same format as the input.

Examples3

  1. Example 1

    Input
    02:36
    1
    
    Expected output
    02:45
    
  2. Example 2

    Input
    12:00
    13
    
    Expected output
    12:15
    
  3. Example 3

    Input
    11:00
    30
    
    Expected output
    01:00