#include <bits/stdc++.h>
#define range(i,a,b) for(int (i)=(a);(i)<(b);(i)++)
#define rep(i,n) range(i,0,n)
using namespace std;


double x[1010],y[1010];

void init(){
	x[0]=y[0]=0.0;
	x[1]=1.0,y[0]=0.0;
	range(i,2,1010){
		double dx=x[i-1]-x[0],dy=y[i-1]-y[0];
		if(dx*(-dx)-dy*dy < 0.0 ) dy*=-1.0,dx*=-1.0;
		swap(dx,dy);
		double d=sqrt(dx*dx+dy*dy);
		y[i]=y[i-1]-dy/d;
		x[i]=x[i-1]+dx/d;
	}
}

int main(void){
	int n;
	init();
	cout.precision(10);
	while(cin >> n){
		if(n==-1) break;
		cout << fixed << x[n] << endl;
		cout << fixed << y[n] << endl;
	}
	return 0;
}