Alarm Clock

Interview

Time limit1sMemory limit128 MB

Summary
Given an alarm time in hours and minutes, compute and print the time 45 minutes earlier, wrapping around midnight if needed.
Level

Easy1 of 10

Topics
Math, Implementation
Solved
No attempts yet

Problem

Sanggeun wakes up every morning with an alarm. However, after turning it off, he often sleeps a little longer and ends up late for school.

His friend Changyoung suggested setting the alarm 45 minutes earlier than the original time. This way, even if Sanggeun sleeps a little more after hearing the alarm, he can still wake up on time.

Given the currently set alarm time, determine what time the alarm should be changed to when this method is used.

Input

The first line contains two integers H and M. They mean that the current alarm time is H hours and M minutes.

  • 0 <= H <= 23
  • 0 <= M <= 59

The time is given in 24-hour format. A day starts at 0:0 and the last minute of the day is 23:59. Unnecessary leading zeroes are not used when writing a time.

Output

Print the alarm time after moving it 45 minutes earlier. Output H and M on one line, separated by a space, in the same format as the input.

Examples3

  1. Example 1

    Input
    10 10
    
    Expected output
    9 25
    
  2. Example 2

    Input
    0 30
    
    Expected output
    23 45
    
  3. Example 3

    Input
    23 40
    
    Expected output
    22 55