
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <cmath>
#include <cstdio>
#include <iostream>
#include <complex>
using namespace std;

#define REP(i, n)           REPEAT(i, 0, n)
#define REPEAT(i, k, n)     for(int i = (k); i < (k+n); ++i)

#define X real()
#define Y imag()
typedef double D;
typedef complex<D> P;

void solve(int n){
    P p(1,0);
    REP(i,n) p += polar(1.0, arg(p) + M_PI_2);
    printf("%f\n%f\n", p.X, p.Y);
}

int main(){
    int n;
    while(cin >> n, n > 0) solve(n-1);
    return 0;
}