#include<cstdio>
#include<algorithm>
#include<vector>
#include<string>
#include<iostream>
#include<queue>
#include<map>
#include<set>
#include<complex>
#include<stack>
#include<cmath>
 
using namespace std;
 
#define reps(i,f,n) for(int i=f;i<int(n);i++)
#define rep(i,n) reps(i,0,n)

#define X real()
#define Y imag()
typedef complex<double> P;

int main(){
	
	const int N = 1111;
	P lis[N];
	
	P st = P(1,0);
	for(int i=0;i<N;i++){
		lis[i]=st;
		
		P dir = -st;
		dir *= P(0,-1);
		dir /= abs(dir);
		
		st += dir*P(1,0);
	}
	
	int n;
	while(cin>>n){
		if(n==-1)break;
		printf("%lf\n%lf\n",lis[n-1].X,lis[n-1].Y);
	}
	
}