Do you remember a kind cartoon "Beauty and the Beast"? No, no, there was no firing from machine guns or radiation mutants time-travels!

There was a beauty named Belle. Once she had violated the Beast's order and visited the West Wing. After that she was banished from the castle... 

Everybody was upset. The beautiful Belle was upset, so was the Beast, so was Lumiere the candlestick. But the worst thing was that Cogsworth was upset. Cogsworth is not a human, but is the mantel clock, which was often used as an alarm clock.

Due to Cogsworth's frustration all the inhabitants of the castle were in trouble: now they could not determine when it was time to drink morning tea, and when it was time for an evening stroll. 

Fortunately, deep in the basement are lying digital clock showing the time in the format HH:MM. Now the residents of the castle face a difficult task. They should turn Cogsworth's hour and minute mustache hands in such a way, that Cogsworth began to show the correct time. Moreover they need to find turn angles in degrees for each mustache hands. The initial time showed by Cogsworth is 12:00.

You can only rotate the hands forward, that is, as is shown in the picture: 

<image>

As since there are many ways too select such angles because of full rotations, choose the smallest angles in the right (non-negative) direction.

Note that Cogsworth's hour and minute mustache hands move evenly and continuously. Hands are moving independently, so when turning one hand the other hand remains standing still.

Input

The only line of input contains current time according to the digital clock, formatted as HH:MM (00 ≤ HH ≤ 23, 00 ≤ MM ≤ 59). The mantel clock initially shows 12:00.

Pretests contain times of the beginning of some morning TV programs of the Channel One Russia.

Output

Print two numbers x and y — the angles of turning the hour and minute hands, respectively (0 ≤ x, y < 360). The absolute or relative error in the answer should not exceed 10 - 9.

Examples

Input

12:00


Output

0 0

Input

04:30


Output

135 180

Input

08:17


Output

248.5 102

Note

A note to the second example: the hour hand will be positioned exactly in the middle, between 4 and 5.

Source: codeforces | Difficulty: EASY
Tags: Geometry

Mathematics


Solutions:
def main():
	inlist = input().split(':')
	(hh, mm) = (int(inlist[0]), int(inlist[1]))
	deg_per_h = 360 / 12
	deg_per_m = 360 / 60
	print('{} {}'.format((hh + mm / 60) * deg_per_h % 360, mm * deg_per_m % 360))
main()


s = input()
a = s.split(':')
a = [int(a[0]), int(a[1])]
if a[0] >= 12:
	a[0] -= 12
m = a[1] * 6
h = a[0] * 30 + a[1] / 2
if h % 1 == 0:
	h = int(h)
print(h, m)


clock = input()
(hours, minutes) = clock.split(':')
hours = int(hours)
minutes = int(minutes)
if hours > 12:
	hours = hours - 12
if hours == 12:
	hours_angle = minutes / 60 * 30
else:
	hours_angle = hours * 30 + minutes / 60 * 30
if minutes == 0:
	minutes_angle = 0
else:
	minutes_angle = minutes / 60 * 360
print(hours_angle, ' ', minutes_angle)


x = input()
a = int(x[0:2])
b = int(x[3:])
if a > 12:
	a -= 12
if a == 12:
	a = 0
lol = a * 30 + 0.5 * b
yo = b * 6
print(lol, yo)


(h, m) = map(int, input().split(':'))
print(h % 12 * 30 + m / 2, m * 6)


(h, m) = input().split(':')
(h, m) = (int(h), int(m))
mhTurn = m / 60 * 360
hhTurn = h % 12 / 12 * 360 + m / 60 * (360 / 12)
print(hhTurn, mhTurn)


s = input().strip()
(a, b) = s.split(':')
(a, b) = (int(a), int(b))
a = (a * 30 + b * 0.5) % 360
b = b * 6
print(a, b)


from sys import stdin, stdout
time_ = stdin.readline()
time_ = time_.lstrip()
time_ = time_.split(':')
time_ = [int(x) for x in time_]
if time_[0] == 12 and time_[-1] == 0:
	print(0, 0)
	exit(0)
minutes_degree = time_[-1] * 6
if time_[0] == 12:
	time_[0] = 0
if time_[0] > 12:
	time_[0] -= 12
hours_degree = round((time_[0] + time_[-1] / 60) * 30, 1)
print(hours_degree, minutes_degree)


def main():
	(x, y) = map(int, input().split(':'))
	x = x % 12 + 1 * (y / 60)
	print(x * 30, y * 360 / 60)
main()


from sys import stdin, stdout
from bisect import bisect_left as bl
from bisect import bisect_right as br
from heapq import *
input = stdin.readline
prin = stdout.write
from random import sample
from collections import Counter, deque
from math import sqrt, ceil, log2, gcd
mod = 10 ** 9 + 7

class DisjSet:

	def __init__(self, n):
		self.rank = [1] * n
		self.parent = [i for i in range(n)]

	def find(self, x):
		if self.parent[x] != x:
			self.parent[x] = self.find(self.parent[x])
		return self.parent[x]

	def union(self, x, y):
		xset = self.find(x)
		yset = self.find(y)
		if xset == yset:
			return
		if self.rank[xset] < self.rank[yset]:
			self.parent[xset] = yset
		elif self.rank[xset] > self.rank[yset]:
			self.parent[yset] = xset
		else:
			self.parent[yset] = xset
			self.rank[xset] = self.rank[xset] + 1

def f(arr, i, j, d, dist):
	if i == j:
		return
	nn = max(arr[i:j])
	for tl in range(i, j):
		if arr[tl] == nn:
			dist[tl] = d
			f(arr, i, tl, d + 1, dist)
			f(arr, tl + 1, j, d + 1, dist)

def ps(n):
	cp = 0
	lk = 0
	arr = [1, n]
	countprev = 0
	while n % 2 == 0:
		n = n // 2
		arr.append(n)
		arr.append(2 ** (lk + 1))
		lk += 1
	for ps in range(3, ceil(sqrt(n)) + 1, 2):
		lk = 0
		while n % ps == 0:
			n = n // ps
			arr.append(n)
			arr.append(ps ** (lk + 1))
			lk += 1
	if n != 1:
		lk += 1
		arr.append(n)
		return arr
	return arr

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def factorials(n, r):
	slr = n
	dpr = r
	qlr = 1
	qs = 1
	mod = 10 ** 9 + 7
	for ip in range(n - r + 1, n + 1):
		qlr = qlr * ip % mod
	for ij in range(1, r + 1):
		qs = qs * ij % mod
	ans = qlr * modInverse(qs) % mod
	return ans

def modInverse(b):
	qr = 10 ** 9 + 7
	return pow(b, qr - 2, qr)
from types import GeneratorType

def iterative(f, stack=[]):

	def wrapped_func(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		to = f(*args, **kwargs)
		while True:
			if type(to) is GeneratorType:
				stack.append(to)
				to = next(to)
				continue
			stack.pop()
			if not stack:
				break
			to = stack[-1].send(to)
		return to
	return wrapped_func

def power(arr):
	listrep = arr
	subsets = []
	for i in range(2 ** len(listrep)):
		subset = []
		for k in range(len(listrep)):
			if i & 1 << k:
				subset.append(listrep[k])
		subsets.append(subset)
	return subsets

def dis(xa, ya, xb, yb):
	return sqrt((xa - xb) ** 2 + (ya - yb) ** 2)

def ii():
	return int(input())

def ilist():
	return [int(x) for x in input().strip().split()]

def outstrlist(array: list) -> str:
	array = [str(x) for x in array]
	return ' '.join(array)

def islist():
	return list(map(str, input().split().rstrip()))

def outfast(arr: list) -> str:
	ss = ''
	for ip in arr:
		ss += str(ip) + ' '
	return prin(ss)

def pda(n):
	list = []
	for i in range(1, int(sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				list.append(i)
			else:
				list.append(int(n / i))
				list.append(i)
	return list
t = 1
for jj in range(t):
	a = input()
	x = int(a[:2])
	y = int(a[3:])
	ap = x % 12
	print((ap + y / 60) / 12 * 360, 6 * y)


inp = input().split(':')
hh = int(inp[0])
mm = int(inp[1])
if hh >= 12:
	hh = hh - 12
degreesHH = hh * 30 + mm * 0.5
if degreesHH % 1 == 0:
	degreesHH = int(degreesHH)
degreesHH = str(degreesHH)
degreesMM = str(mm * 6)
print(degreesHH + ' ' + degreesMM)


(h, m) = list(map(int, input().split(':')))
print((60 * h + m) % 720 / 2, m * 6)


t = input()
hour = int(t[:2])
minute = int(t[3:])
hour %= 12
y = minute * 6.0
if (hour == 0 or hour == 12) and minute == 0:
	x = 0
else:
	x = hour * 30.0 + minute * 0.5
print('{:5f} {:5f}'.format(x, y))


t = [int(x) for x in input().split(':')]
t[0] %= 12
r1 = 30 * (t[0] + t[1] / 60)
r2 = t[1] * 6
print(r1, r2, sep=' ')


s = input()
h = int(s[:2]) % 12
m = int(s[3:])
h += m / 60
print(h * 5 * 6, m * 6)


s = input()
h = int(s[0]) * 10 + int(s[1])
m = int(s[3]) * 10 + int(s[4])
ang1 = (h % 12 + m / 60) * 30
ang2 = m * 6
print(ang1, ang2)


def readln():
	return tuple(map(int, input().split()))
(hh, mm) = tuple(map(int, input().split(':')))
print(30 * (hh % 12) + 0.5 * mm, 6 * mm)


s = input()
hr = s[:2]
mn = s[3:]
if int(hr) >= 12:
	hr = int(hr) - 12
ans1 = int(hr) * 30 + int(mn) * 0.5
ans2 = int(mn) * 6
print(ans1, end=' ')
print(ans2)


i = input()
sarr = i.split(':')
t = int(sarr[0])
l = int(sarr[1])
if t >= 12:
	t -= 12
ang2 = 6 * l
tempAng = 30 * (l / 60)
ang1 = 30 * t + tempAng
if ang1 == int(ang1):
	ang1 = int(ang1)
print(str(ang1) + ' ' + str(int(ang2)))


time = input()
time = time.split(':')
hour = int(time[0])
minute = int(time[1])
hour_angle = 30 * hour + minute * 0.5
minute_angle = 6 * minute
if hour_angle >= 360:
	hour_angle = hour_angle - 360
print(hour_angle, minute_angle, sep=' ')


(h, m) = map(int, input().split(':'))
if h >= 12:
	h -= 12
h = (h * 60 + m) / 60
hl = h * (360 // 12)
ml = m * (360 // 60)
print(hl, ml)


str = input()
hour = int(str[0:2])
min = int(str[3:])
dmin = min / 60 * 360
hour = hour + min / 60
dhour = hour / 12 * 360
if dhour >= 360:
	dhour -= 360
print(dhour, dmin)


import sys
from array import array

def input():
	return sys.stdin.buffer.readline().decode('utf-8')
(h, m) = map(int, input().split(':'))
h %= 12
print((h * 60 + m) / 2, m * 6)


input_string = str(input())
time_list = input_string.split(':')
hour = int(time_list[0]) % 12
minutes = int(time_list[1]) % 60
hour_degree = 30 * hour + minutes / 2
minute_degree = minutes * 6
print(str('{0:g}'.format(hour_degree)) + ' ' + str(minute_degree))


s = input()
h = int(s[:2])
m = int(s[3:])
if h >= 12:
	h = h % 12
m1 = 6 * m
h1 = 30 * h + 1 / 12 * m1
print(h1, m1)


(hours, mins) = input().split(':')
hours = int(hours)
mins = int(mins)
if hours >= 12:
	hours -= 12
hour_rotation = hours / 12 * 360 + mins / 60 * 360 / 12
min_rotation = mins / 60 * 360
print(hour_rotation)
print(min_rotation)


import sys
import string
from collections import Counter, defaultdict
from math import fsum, sqrt, gcd, ceil, factorial
from operator import *
from itertools import accumulate
inf = float('inf')
flush = lambda : sys.stdout.flush
comb = lambda x, y: factorial(x) // factorial(y) // factorial(x - y)
ip = lambda : input()
ii = lambda : int(input())
r = lambda : map(int, input().split())
rr = lambda : list(r())
(a, b) = map(int, ip().split(':'))
print(a % 12 * 30 + b / 2, b * 6)


s = input()
if s[0] == '0':
	h = int(s[1])
else:
	h = int(s[:2])
if s[3] == '0':
	m = int(s[4])
else:
	m = int(s[3:])
a = (h * 30 + 6 * (5 * m / 60)) % 360
if str(a)[-1] == '0':
	a = int(a)
b = 6 * m
print(a, b)


(hours, minutes) = map(int, input().split(':'))
pos_hour = (hours * 30 + minutes / 2) % 360
pos_minutes = minutes * 6
print(pos_hour, pos_minutes)


(HH, MM) = map(int, input().split(':'))
print(30 * (HH % 12) + MM / 2, 6 * MM)


for _ in range(1):
	s = input()
	h = int(s[0]) * 10 + int(s[1])
	if h >= 12:
		h -= 12
	m = int(s[3]) * 10 + int(s[4])
	y = m * 6
	x = 30 * h + m / 2.0
	print(x, y, end=' ')


time = input()
h = int(time[0]) * 10 + int(time[1])
m = int(time[3]) * 10 + int(time[4])
h = h % 12
angle1 = h * 30 + m // 2
if m % 2 == 1:
	angle1 += 0.5
angle2 = m * 6
print(angle1, angle2)


import math
import sys
hm = str(input())
h = 12 - int(hm[0] + hm[1]) % 12
m = int(hm[3] + hm[4])
print(360 - (30 * h - m / 2), end=' ')
print(m * 6 % 360)


(hh, mm) = map(int, input().split(':'))
print(hh % 12 * 30 + mm / 2, mm * 6)


s = input()
if s[0] == '0':
	h = int(s[1])
else:
	h = int(s[0:2])
if s[3] == '0':
	m = int(s[4])
else:
	m = int(s[3:5])
if h > 12:
	h = h - 12
if h == 12:
	h = 0
hangle = (h + m / 60) * 30
mangle = m * 6
print(hangle, mangle)


s = input()
h = int(s[0] + s[1])
if h >= 12:
	h -= 12
m = int(s[3] + s[4])
hh = 30 * h + m * 0.5
mm = 6 * m
print(hh, mm)


(a, b) = map(int, input().split(':'))
(m, n) = (12, 0)
minute = (b - n) % 60 * 6
hour = ((a - m) % 12 + b / 60) * 30
print(hour, minute)


(H, M) = [int(x) for x in input().split(':')]
H = H % 12
hAngle = 360 / 12
hmAngle = hAngle / 60
mAngle = 360 / 60
print(H * hAngle + M * hmAngle, end=' ')
print(M * mAngle)


(a, b) = map(int, input().split(':'))
print(30 * (a % 12) + b / 2, 6 * b)


s = input().strip()
(hour, minute) = map(int, s.split(':'))
if hour > 12:
	hour -= 12
hAngle = 0.5 * (hour * 60 + minute)
mAngle = 6 * minute
if hAngle >= 360:
	hAngle = hAngle - 360
if mAngle >= 360:
	mAngle = mAngle - 360
print(hAngle, mAngle)


time = input()
if int(time[0] + time[1]) >= 12:
	newtime = str(int(time[0] + time[1]) - 12).zfill(2) + time[2:]
else:
	newtime = time
hour = int(newtime[0] + newtime[1])
min = int(newtime[3] + newtime[4])
hourhand = 360 * (hour / 12) + min / 60 * 30
minhand = 360 * (min / 60)
print(hourhand, minhand)


s = input()
h = int(s[:2])
m = int(s[3:])
print(h % 12 * 30 + m / 2, m * 6)


import sys

def ans(x):
	minutes = x[1] * 6.0
	hours = x[0] % 12 * 30
	extra = x[1] * 0.5
	hours += extra
	check1 = check(hours)
	check2 = check(minutes)
	if check1:
		hours = int(hours)
	if check2:
		minutes = int(minutes)
	return [hours, minutes]

def check(x):
	out = str(x)
	k = out.strip().split('.')
	k = k[1]
	for i in range(len(k)):
		if k[i] is not '0':
			return False
	return True
x = list(map(int, input().strip().split(':')))
out = ans(x)
print(out[0], end=' ')
print(out[1])


(x, y) = map(int, input().split(':'))
x %= 12
print(x / 12 * 360 + y / 60 * 30, y / 60 * 360)


(H, M) = map(int, input().replace(':', ' ').split())
print(30 * (H % 12) + M / 2, 6 * M)


a = input()
h = int(a[:2])
m = int(a[3:])
if h > 12:
	h -= 12
if (h == 12 or h == 0) and m == 0:
	print(0, 0)
elif h == 12 or h == 0:
	print(m / 60 * 30, m * 6)
else:
	print((h + m / 60) * 30, m * 6)


import re
import itertools
from collections import Counter

class Task:
	time = ''
	answer = ''

	def getData(self):
		self.time = input()

	def solve(self):
		(hours, minutes) = [int(x) for x in self.time.split(':')]
		hoursAngle = (30 * hours + minutes / 2) % 360
		minutesAngle = 6 * minutes % 360
		self.answer = str(hoursAngle) + ' ' + str(minutesAngle)

	def printAnswer(self):
		print(self.answer)
task = Task()
task.getData()
task.solve()
task.printAnswer()


(h, m) = list(map(int, input().split(':')))
print((h * 30 + m / 2) % 360, m * 6)


a = input()
b = a.split(':')
depression = int(b[0]) % 12 * 30 + 0.5 * int(b[1])
depression2 = 6 * int(b[1])
print(depression, depression2)


import sys
import math
import itertools
import collections

def getdict(n):
	d = {}
	if type(n) is list or type(n) is str:
		for i in n:
			if i in d:
				d[i] += 1
			else:
				d[i] = 1
	else:
		for i in range(n):
			t = ii()
			if t in d:
				d[t] += 1
			else:
				d[t] = 1
	return d

def cdiv(n, k):
	return n // k + (n % k != 0)

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return list(map(int, input().split()))

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def wr(arr):
	return ' '.join(map(str, arr))

def revn(n):
	return int(str(n)[::-1])

def prime(n):
	if n == 2:
		return True
	if n % 2 == 0 or n <= 1:
		return False
	sqr = int(math.sqrt(n)) + 1
	for d in range(3, sqr, 2):
		if n % d == 0:
			return False
	return True
(h, m) = map(int, input().split(':'))
print(h % 12 * 30 + m / 2, m * 6)


l = [int(x) for x in input().split(':')]
a = l[0]
b = l[1]
p = []
if a == 12:
	p.append(b / 60 * 30)
elif a < 12:
	p.append(a * 30 + b / 60 * 30)
else:
	p.append((a - 12) * 30 + b / 60 * 30)
if b == 0:
	p.append(0)
else:
	p.append(b * 6)
for h in p:
	print(h, end=' ')


import sys
import os
from io import IOBase, BytesIO
import math
mod = 10 ** 9 + 7
pie = 3.1415926536

def modinv(n, p):
	return pow(n, p - 2, p)

def ncr(n, r, p):
	t = fact[n] * (ifact[r] * ifact[n - r] % p) % p
	return t

def ain():
	return list(map(int, sin().split()))

def sin():
	return input().strip()

def GCD(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def read2DIntArray(row, col):
	arr = []
	for i in range(0, row):
		temp = list(map(int, sin().split()))
		arr.append(temp)
	return arr

def read2DCharArray(row, col):
	arr = []
	for i in range(0, row):
		temp = str(sin())
		arr.append(temp)
	return arr

def smallestNumber(n):
	lst = list(str(n))
	lst.sort()
	tmp = ''
	for (i, n) in enumerate(lst):
		if n != '0':
			tmp = lst.pop(i)
			break
	return str(tmp) + ''.join(lst)

def main():
	s = sin()
	(hh, mm) = map(int, s.split(':'))
	if hh > 12:
		hh = hh - 12
	m = mm * 6
	h = hh * 30 + mm / 60 * 30
	if hh == 12:
		h = abs(h - 360)
	print(str(h) + ' ' + str(m))
py2 = round(0.5)
if py2:
	from future_builtins import ascii, filter, hex, map, oct, zip
	range = xrange
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.getvalue())
			(self.truncate(0), self.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		if py2:
			self.write = self.buffer.write
			self.read = self.buffer.read
			self.readline = self.buffer.readline
		else:
			self.write = lambda s: self.buffer.write(s.encode('ascii'))
			self.read = lambda : self.buffer.read().decode('ascii')
			self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def input():
	return sys.stdin.readline().rstrip('\r\n')
main()


(n, m) = map(int, input().split(':'))
n %= 12
b = m / 60 * 360
a = n / 12 * 360 + b / 12
print(a, b)


(a, b) = map(int, input().split(':'))
(x, y) = (12, 0)
m = (b - y) % 60 * 6
h = ((a - x) % 12 + b / 60) * 30
print(h, m)


s = input()
h = int(s[:2])
m = int(s[3:])
d1 = 30 * (h + m / 60)
d2 = 6 * m
if d1 >= 360:
	d1 -= 360
if d2 >= 360:
	d2 -= 360
print(str(d1) + ' ' + str(d2))


time = str(input())
if len(time) == 5:
	hour = int(time[0] + time[1])
	minu = int(time[3] + time[4])
else:
	hour = int(time[0])
	minu = int(time[2] + time[3])
if hour > 12:
	hour -= 12
if minu == 0:
	minu_a = 0
else:
	minu_a = minu * 6
hour_a = hour * 30
hour_a += minu * 0.5
if hour_a >= 360:
	hour_a -= 360
print(hour_a, minu_a)


import math as mt
import sys, string, bisect
input = sys.stdin.readline
from collections import deque, defaultdict
L = lambda : list(map(int, input().split()))
Ls = lambda : list(input().split())
M = lambda : map(int, input().split())
I = lambda : int(input())

def dist(x, y, c, d):
	return mt.sqrt((x - c) ** 2 + (y - d) ** 2)

def circle(x1, y1, x2, y2, r1, r2):
	distSq = ((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)) ** 0.5
	if distSq + r2 <= r1:
		return True
	else:
		return False
(h, m) = map(int, input().split(':'))
h %= 12
b = m * 6
a = h * 30 + m / 2
print(a, b)


(h, minutes) = [int(element) for element in input().split(':')]
answer_minutes = minutes / 60 * 360 % 360
answer_hours = (h / 12 * 360 + 360 / 12 * minutes / 60) % 360
print(answer_hours, answer_minutes)


(h, m) = map(int, input().split(':'))
h_deg = 360 / 12 * (m / 60)
print((h * 360 / 12 + h_deg) % 360, m * 360 / 60 % 360)


(h, m) = map(int, input().split(':'))
if h >= 12:
	h -= 12
print(h * 30 + 30 * m / 60, m * 6)


ti = input()
ti = ti.split(':')
hr = int(ti[0])
mi = int(ti[1])
turn_hour = 0
turn_min = mi * 6
turn_hour = hr % 12 * 30 + mi * 0.5
print(turn_hour, turn_min)


time = input()
hours = int(time[0]) * 10 + int(time[1])
minutes = int(time[3]) * 10 + int(time[4])
hours = hours % 12
angle1 = hours * 30 + minutes // 2
if minutes % 2 == 1:
	angle1 += 0.5
angle2 = minutes * 6
print(angle1, angle2)


s = input()
hr = int(s[0:2])
min = int(s[3:])
if hr >= 12:
	hr -= 12
print((hr * 60 + min) / 2, int(min * 6))


(h, m) = map(int, input().split(':'))
if h >= 12:
	hd = (60 * (h - 12) + m) * 0.5
else:
	hd = (60 * h + m) * 0.5
md = 6 * m
print(str(hd) + ' ' + str(md))


import sys
import math
import bisect

def solve(s):
	h = int(s[0:2])
	h %= 12
	m = int(s[3:])
	h = (h * 60 + m) * 360 / (60 * 12)
	m = m * 360 / 60
	return (h, m)

def main():
	ans = solve(input())
	print('%.10f %.10f' % (ans[0], ans[1]))
main()


(h, m) = map(int, input().split(':'))
h %= 12
print(0.5 * (60 * h + m), 6 * m)


time = input()
hh = int(time[:2])
mm = int(time[3:])
if hh >= 12:
	r = int(hh) - 12
else:
	r = int(hh)
print(r * 30 + int(mm) / 2, mm * 6)


(h, m) = map(int, input().split(':'))
if h >= 12:
	h -= 12
print(float(30 * h + m / 2), m * 6)


a = input()
b = int(a[:2])
c = int(a[3:])
d = c / 60
e = (b + d) * 30 % 360
f = c * 6 % 360
print(e, f)


(hour, minute) = map(int, input().split(':'))
hour = hour % 12
if hour != 12:
	hourDegree = hour / 12 * 360
else:
	hourDegree = 0
if minute != 0:
	minuteDegree = minute / 60 * 360
else:
	minuteDegree = 0
interval = minute / 60 * 30
hourDegree += interval
if int(hourDegree) == hourDegree:
	hourDegree = int(hourDegree)
if int(minuteDegree) == minuteDegree:
	minuteDegree = int(minuteDegree)
print(hourDegree, minuteDegree)


(hh, mm) = map(int, input().split(':'))
a = hh % 12 * 30 + mm * 0.5
b = mm * 6
print(a, b)


x = input()
min = int(x[3:])
hour = int(x[:2])
if hour >= 12:
	hour -= 12
m = min / 2
k = int(min / 2)
if m == k:
	hour = hour * 30 + k
else:
	hour = hour * 30 + m
print(hour, ' ', min * 6)


(h, m) = (int(i) for i in input().split(':'))
nh = h * 30 + 30 * m / 60
nm = 6 * m
print(nh % 360, nm)


(h, m) = map(int, input().split(':'))
if h == 12 or h == 0:
	h = 0
h = h + m / 60
h = h * 360 / 12
m = m * 360 / 60
if h > 360:
	h -= 360
print(h, m)


(h, m) = map(float, input().split(':'))
if h > 12:
	h -= 12
rh = h * 30
rh += m / 2
rm = m * 6
rh %= 360
rm %= 360
if int(rh) == rh:
	rh = int(rh)
if int(rm) == rm:
	rm = int(rm)
print(rh, rm)


takes = str(input())
clocks = takes.split(':')
h = int(clocks[0])
if h > 12:
	h = h - 12
m = int(clocks[1])
temp = 30 * h
if h == 12:
	temp = 0
hans = temp + 0.5 * m
mans = 6 * m
print(hans, mans)


(H, M) = map(int, input().split(':'))
cur = (H * 60 + M) % (12 * 60)
ang1 = cur % (12 * 60) / (12 * 60) * 360
ang2 = cur % 60 / 60 * 360
print(ang1, end=' ')
print(ang2)


(a, b) = map(int, input().split(':'))
print(30 * (a - 12 * (a > 11) + b / 60), 6 * b)


(h, m) = map(str, input().split(':'))
(h, m) = (int(h), int(m))
h %= 12
x = h * 30 + 30 * (m / 60)
y = 360 * (m / 60)
print(x, y)


a = list(map(int, input().split(':')))
print(a[0] % 12 * 30 + a[1] / 2, a[1] * 6)