#include<iostream>
#include<iomanip>
#include<cmath>
using namespace std;
double x,y,t;
int main()
{
    int n;
    while(cin>>n,n>0)
    {
        x=y=1;
        t=0;
        for(int i=1;i<n;i++)t+=atan2(1,sqrt(i));
        cout<<fixed<<setprecision(9)<<sqrt(n)*cos(t)<<endl<<sqrt(n)*sin(t)<<endl;
    }
}
