#include<cstdio>
#include<cmath>
#define PI 3.14159
using namespace std;
int main(void){
    int n;
    while(1){
        scanf("%d",&n);
        if(n==-1)break;
        double t=0.0;
        for(int i=1;i<n;i++){
            t+=acos(sqrt(i)/sqrt(i+1));
            if(t>=2.0*PI)t-=2.0*PI;
        }
        printf("%.2lf\n%.2lf\n",cos(t)*sqrt(n),sin(t)*sqrt(n));
    }
        return 0;
}