As I was cleaning up the warehouse, I found an old document that describes how to get to the treasures of my ancestors. The following was written in this ancient document.


1. First, stand 1m east of the well on the outskirts of the town and turn straight toward the well.
2. Turn clockwise 90 degrees, go straight for 1m, and turn straight toward the well.
3. Turn clockwise 90 degrees, go straight for 1m, and turn straight toward the well.
Four.                   〃
Five.                   〃
6::


From the second line onward, exactly the same thing was written. You wanted to find the treasure, but found it awkward. Unlike in the past, the building is in the way, and you can't see the well even if you go straight in the direction of the well, or you can't go straight even if you try to go straight for 1m. In addition, this ancient document has nearly 1000 lines, and it takes a considerable amount of time and physical strength to work according to the ancient document. Fortunately, however, you can take advantage of your computer.

Enter the number of lines n written in the old document and create a program that outputs the location of the treasure. However, n is a positive integer between 2 and 1,000.



input

Given multiple datasets. For each dataset, one integer n, which represents the number of lines in the old document, is given on each line.

The input ends with -1. The number of datasets does not exceed 50.

output

Assuming that there is a treasure at the position x (m) to the east and y (m) to the north from the well on the outskirts of the town, output each data set in the following format.


x
y


The output is a real number and may contain an error of 0.01 or less.

Example

Input

3
6
-1


Output

0.29
1.71
-2.31
0.80

Difficulty: UNKNOWN_DIFFICULTY

Starter code:

Solutions:
import math
MAX = 1005
(r, d) = ([0.0] * MAX, [0.0] * MAX)
r[1] = 1.0
for i in range(2, MAX):
	d[i] = d[i - 1] + math.atan(1 / r[i - 1])
	r[i] = math.sqrt(r[i - 1] ** 2 + 1)
while True:
	i = int(input())
	if i < 0:
		break
	print(r[i] * math.cos(d[i]), r[i] * math.sin(d[i]), sep='\n')


while True:
	n = int(input())
	if n == -1:
		break
	(x, y) = (1, 0)
	for i in range(1, n):
		l = (x ** 2 + y ** 2) ** (-0.5)
		(x, y) = (x - l * y, y + l * x)
	print(x)
	print(y)


import sys
for e in sys.stdin:
	n = int(e)
	if n < 0:
		break
	z = 1
	for _ in range(n - 1):
		d = z * 1j
		d /= abs(d)
		z += d
	print(f'{z.real}\n{z.imag}')


import sys
for e in sys.stdin:
	(z, n) = (1, int(e))
	if n < 0:
		break
	for _ in [0] * ~-n:
		d = z * 1j
		z += d / abs(d)
	print(z.real)
	print(z.imag)


from math import atan2, radians, sqrt, sin, cos
import sys
t = 0
result = []
for i in range(1, 1000):
	t += atan2(1, sqrt(i))
	result.append((cos(t) * sqrt(i + 1), sin(t) * sqrt(i + 1)))
for n in map(int, sys.stdin):
	if n == -1:
		break
	print(result[n - 2][0])
	print(result[n - 2][1])


import math
from decimal import Decimal, ROUND_HALF_UP

def run(n):
	if len(pos) >= n:
		return pos[n - 1]
	else:
		run(n - 1)
	(x, y) = pos[-1]
	d = math.degrees(math.atan(y / x))
	xi = x + math.cos(math.radians(d + [90, 270][x < 0]))
	yi = y + math.sin(math.radians(d + [90, 270][x < 0]))
	pos.append([xi, yi])
pos = [[1.0, 0.0], [1.0, 1.0]]
while 1:
	n = int(input())
	if n == -1:
		break
	run(n)
	print(Decimal(pos[n - 1][0]).quantize(Decimal('0.01'), rounding=ROUND_HALF_UP))
	print(Decimal(pos[n - 1][1]).quantize(Decimal('0.01'), rounding=ROUND_HALF_UP))


import sys
from math import atan, atan2, degrees, pi, cos, sin
Memo = []

def init_memo(n):
	global Memo
	Memo.append((0, 0))
	Memo.append((1, 0))
	for i in range(n):
		x = Memo[-1][0]
		y = Memo[-1][1]
		rad = atan2(-y, -x)
		rad -= pi / 2
		x += cos(rad)
		y += sin(rad)
		Memo.append((x, y))

def solve(n):
	global Memo
	return Memo[n]

def main(args):
	init_memo(1000)
	while True:
		n = int(input())
		if n == -1:
			break
		result = solve(n)
		print('{:.2f}'.format(result[0]))
		print('{:.2f}'.format(result[1]))
main(sys.argv[1:])


import math
n = 1001
x = [1 for i in range(n)]
y = [0 for i in range(n)]
ang = 0
for i in range(2, n):
	ang += math.asin(1 / math.sqrt(i - 1))
	x[i] = x[i - 1] + math.cos(ang)
	y[i] = y[i - 1] + math.sin(ang)
while True:
	n = int(input())
	if n == -1:
		break
	print(x[n])
	print(y[n])


import sys, math, os
PYDEV = os.environ.get('PYDEV')
if PYDEV == 'True':
	sys.stdin = open('sample-input.txt', 'rt')
positions = {0: [0, 0], 1: [1, 1]}
direction = 135 * math.pi / 180
(x, y) = (1, 1)
for step in range(2, 1001):
	x += math.cos(direction)
	y += math.sin(direction)
	positions[step] = [x, y]
	direction = math.atan2(x, -y)
while True:
	n = int(input())
	if n == -1:
		break
	print('%.2f' % positions[n - 1][0])
	print('%.2f' % positions[n - 1][1])


import sys
readline = sys.stdin.readline
write = sys.stdout.write
L = 1000
D = [(0, 0), (1, 0)]
x = 1
y = 0
for i in range(L - 1):
	d = (x ** 2 + y ** 2) ** 0.5
	(x, y) = (x - y / d, y + x / d)
	D.append((x, y))

def solve():
	N = int(readline())
	if N == -1:
		return False
	(x, y) = D[N]
	write('%.16f\n%.16f\n' % (x, y))
	return True
while solve():
	...


import sys
import os
import math
for s in sys.stdin:
	n = int(s)
	if n == -1:
		break
	v = [1, 0]
	for i in range(n - 1):
		w = [-v[1], v[0]]
		l = math.sqrt(w[0] ** 2 + w[1] ** 2)
		normalized = [w[0] / l, w[1] / l]
		vx = v[0] + normalized[0]
		vy = v[1] + normalized[1]
		v = [vx, vy]
	print(v[0])
	print(v[1])


import math

def f(p):
	k = math.atan2(p[1], p[0])
	return k + math.radians(180)
while True:
	n = int(input())
	if n == -1:
		break
	else:
		x = 1
		y = 0
		kakudo = 180
		n -= 1
		while n > 0:
			kakudo = f((x, y))
			kakudo -= math.radians(90)
			x += math.cos(kakudo)
			y += math.sin(kakudo)
			n -= 1
		print(x)
		print(y)


import sys
for e in sys.stdin:
	n = int(e)
	if n < 0:
		break
	z = 1
	for _ in range(n - 1):
		d = z * 1j
		d /= abs(d)
		z += d
	print(z.real)
	print(z.imag)


import sys
for e in sys.stdin:
	if '-1\n' == e:
		break
	z = 1
	for _ in [0] * ~-int(e):
		d = z * 1j
		z += d / abs(d)
	print(z.real)
	print(z.imag)


def calc(k, ax, ay):
	bx = ax - ay / k ** 0.5
	by = ay + ax / k ** 0.5
	return (bx, by)
while True:
	n = int(input())
	if n == -1:
		break
	(ax, ay) = (1, 0)
	for i in range(n - 1):
		(ax, ay) = calc(i + 1, ax, ay)
	print(round(ax, 3))
	print(round(ay, 3))


import sys
import math
while 1:
	n = int(input())
	if n == -1:
		sys.exit()
	x = 1.0
	y = 0.0
	r = 180.0
	for i in range(n - 1):
		r -= 90.0
		if r < 180.0:
			r += 360.0
		y += math.sin(r / 180.0 * math.acos(-1))
		x += math.cos(r / 180.0 * math.acos(-1))
		r = math.atan2(y, x) * 180.0 / math.acos(-1) - 180.0
		if r < 180.0:
			r += 360.0
	print(x)
	print(y)


import sys
for e in sys.stdin:
	(z, n) = (1, int(e))
	if n < 0:
		break
	for _ in range(n - 1):
		d = z * 1j
		z += d / abs(d)
	print(z.real)
	print(z.imag)


import sys
f = sys.stdin
while True:
	n = int(f.readline())
	if n == -1:
		break
	location = 1 + 0j
	for i in range(1, n):
		location += location * 1j / abs(location)
	print('{:.2f}'.format(location.real))
	print('{:.2f}'.format(location.imag))


from math import pi, cos, sin, atan2
while 1:
	n = int(input())
	if n == -1:
		break
	n -= 1
	ang = 0.0
	x = 1.0
	y = 0.0
	for i in range(n):
		ang += pi / 2
		x += cos(ang)
		y += sin(ang)
		ang = atan2(y, x)
	print('{:.2f}'.format(x))
	print('{:.2f}'.format(y))


for e in iter(input, '-1'):
	z = 1
	for _ in [0] * ~-int(e):
		d = z * 1j
		z += d / abs(d)
	print(f'{z.real}\n{z.imag}')


import math
while True:
	n = int(input())
	if n == -1:
		break
	(x, y) = (1, 0)
	for _ in range(n - 1):
		angle = math.atan2(y, x) + math.pi / 2
		x += math.cos(angle)
		y += math.sin(angle)
	print(x, y)


import math
while True:
	n = int(input())
	if n == -1:
		break
	x = 1
	y = 0
	for i in range(n - 1):
		a = y / math.sqrt(x ** 2 + y ** 2)
		b = x / math.sqrt(x ** 2 + y ** 2)
		x = x - a
		y = y + b
	print('{:.2f}'.format(x))
	print('{:.2f}'.format(y))


for e in iter(input, '-1'):
	z = 1
	for _ in [0] * ~-int(e):
		d = z * 1j
		z += d / abs(d)
	print(z.real)
	print(z.imag)


L = []
L.append((0, 0))
L.append((1, 0))
x = 1
y = 0
for _ in range(1000):
	dy = x / (x ** 2 + y ** 2) ** 0.5
	dx = -y / (x ** 2 + y ** 2) ** 0.5
	x += dx
	y += dy
	L.append((x, y))
while True:
	k = int(input())
	if k < 0:
		break
	print('{:.2f}'.format(L[k][0]))
	print('{:.2f}'.format(L[k][1]))


while True:
	n = int(input())
	if not n + 1:
		break
	p = 1 + 0j
	for _ in range(n - 1):
		d = p * 1j
		d /= abs(d)
		p += d
	print('{:.2f}\n{:.2f}'.format(p.real, p.imag))


import math
k = 1.0 / math.sqrt(2.0)
while True:
	n = int(input())
	if n == -1:
		break
	nx = 1.0
	ny = 0.0
	for i in range(n - 1):
		dx = -ny
		dy = nx
		d = 1.0 / math.sqrt(dx ** 2 + dy ** 2)
		nx = nx + d * dx
		ny = ny + d * dy
	print(nx)
	print(ny)