Under construction

Still being built. Things may change

Clock

Interview

Time limit1sMemory limit1024 MB

Summary
Given a clock time h and m, find the first moment the hour hand lands on the minute hand's mark, then print that clock time and the elapsed time.
Level

Easy2 of 10

Topics
Math, Implementation
Solved
No attempts yet

Problem

A standard analog clock shows exactly hh hours and mm minutes. The hour hand points to an integer from 1 to 12, and the minute hand points to an integer from 0 to 59. Both hands move at constant speeds. Mark the exact spot where the minute hand points. At the first moment after that when the hour hand lands exactly on the mark, what do the hands show? Write a program named clock that answers this question.

Input

The first line of standard input contains two integers hh and mm, separated by a space.

Output

On the first line of standard output, print the hour and minute shown on the clock as two integers separated by a space. On the second line, print the time elapsed from the starting moment until the hour hand lands exactly on the mark, as two integers (hours and minutes) separated by a space.

Constraints

0<h≤120 < h ≤ 12 and 0≤m<600 ≤ m < 60.

Examples1

  1. Example 1

    Input
    3 25
    
    Expected output
    5 0
    1 35