#include <iostream>
#include <stdio.h>
#include <math.h>
#include <iomanip>

using namespace std;


int main(void)
{
     int n;
    while(cin>>n){
        if(n==-1)break;
        double x,y;
        x=1.0;
        y=0.0;
        for(int i=0; i<n; i++){
            double temp_x=x;
            double temp_y=y;
            y+=sin((M_PI_2-atan2(temp_y, temp_x)));
            x-=cos((M_PI_2-atan2(temp_y, temp_x)));
        }
        cout<<x<<endl<<y<<endl;
    }
    
}