#include<cstdio>
#include<algorithm>
#include<vector>
#include<cmath>
using namespace std;
int main(){
    int n;
    while(scanf("%d",&n),~n){
        double x=0.0,y=0.0,r=0.0;
        for(int i=0;i<n;i++){
            x+=cos(r);
            y+=sin(r);
            r=atan2(y,x)+M_PI/2;
        }
        printf("%f\n%f\n",x,y);
    }
    return 0;
}