#include<iostream>
#include<cmath>
#include<cstdio>
using namespace std;
int main(){
	int n;
	while(cin>>n){
		if(n==-1) break;
		double angle=0.0;
		for(int i=2; i<=n; i++){
			angle += atan(1.0/sqrt(i-1.0));
		}
		printf("%.2f\n",sqrt(n)*cos(angle));
		printf("%.2f\n",sqrt(n)*sin(angle));
	}
	return 0;
}