404989: GYM101727 A Time Through the Glass

Memory Limit:512 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

A. Time Through the Glasstime limit per test1 secondmemory limit per test512 megabytesinputstandard inputoutputstandard output

Bomboslav works in a nice and beautiful office. All the office is decorated with stylish designer clocks. Their face is a standard circumference with 60 equidistant marks along it that stand for the minutes. 12 out of these 60 marks are bigger than the others (starting from the topmost, equidistant with a step of five marks), these marks stand for hours. The clocks are stylish because they have to digits written on them at all, as the author supposed everyone is familiar with their location and which mark correspond to which value.

Today, someone place this clock above the Bomboslav's workplace. He checked them several times and noticed, that their behavior is somehow strange. Taking a closer look he realized that he is actually looking in the mirror that reflects the clocks located behind him. This means that the face of the clocks is reflected along the vertical line that passes through the center of the clock face. Now he wants to be able to determine what is the current time, knowing the time in the mirror version of the clocks.

Clocks are made in such a way that both hand movement is discrete, i.e. the hour hand always points at one of 12 large marks, showing the current hour, while the minute hand always points at one of 60 marks, showing the current minute.

Input

The only line of the input contains two integers h and m (0 ≤ h ≤ 11, 0 ≤ m ≤ 59) — the current position of hour hand and the current position of the minute hand in the reflected version of the clocks. h = 0 means that the hour hand points upward, h = 3 stands for the position pointing right, h = 6 — down, and h = 9 — to the left. The same is true for the minute hand and values m = 0, m = 15, m = 30 and m = 45.

Output

Print two integers x and y (0 ≤ x ≤ 11, 0 ≤ y ≤ 59) — the actual time shown on the clocks.

ExamplesInput
2 45
Output
10 15
Input
6 0
Output
6 0
Note

The picture below illustrates the first sample. Left clocks show what Bomboslav sees, while right clocks stand for the original positions of the clock hands. Hour hand is red, while minute hand is blue.

加入题单

上一题 下一题 算法标签: