A=[[]]*1001

x=1.0

y=0.0

for i in range(1,1001):

    A[i]=[x,y]

    tmp=i**.5

    x,y=x-y/tmp,y+x/tmp

 

while 1:

    n = eval(input())

    if n==-1:break

    print(A[n][0])

    print(A[n][1])
N=1001

A=[[]]*N

x=1.0

y=0.0

for i in range(1,N):

    A[i]=[x,y]

    tmp=i**.5

    x,y=x-y/tmp,y+x/tmp

 

while 1:

    n = eval(input())

    if n==-1:break

    a,b=A[n]

    print(a,b)
A = [[]] * 1001
x = 1.0
y = 0.0
for i in range(1, 1001):
    A[i] = [x, y]
    tmp = i**0.5
    x, y = x - y / tmp, y + x / tmp
while 1:
    n = eval(input())
    if n == -1:
        break
    print(A[n][0])
    print(A[n][1])

N = 1001
A = [[]] * N
x = 1.0
y = 0.0
for i in range(1, N):
    A[i] = [x, y]
    tmp = i**0.5
    x, y = x - y / tmp, y + x / tmp
while 1:
    n = eval(input())
    if n == -1:
        break
    a, b = A[n]
    print(a, b)

-A = [[]] * 1001 +N = 1001 +A = [[]] * N -for i in range(1, 1001): +for i in range(1, N): -    print(A[n][0]) -    print(A[n][1]) +    a, b = A[n] +    print(a, b)