#include <iostream>
#include <iomanip>
using namespace std;

double root(double x){
	double e = 0.00000001;
	double a = x;
	double b = 0;
	double c;
	while(a - b > e){
		c = (a + b) / 2;
		if(c * c < x){
			b = c;
		}else{
			a = c;
		}
	}
	return a;
}

void move(double &x, double &y){
	if(y == 0){
		if(x > 0){
			y++;
		}else if(x < 0){
			y--;
		}
	}else{
		double k = -(x / y);
		double c = 1 / root(1 + k * k);
		if(y < 0){
			x += c;
			y += c * k;
		}else{
			x -= c;
			y -= c * k;
		}
	}
}

int main(){
	int n;
	while(cin >> n){
		if(n == -1) break;
		double x = 1.0;
		double y = 0.0;
		for(int i = 1; i < n;i++) move(x,y);
		cout << fixed << setprecision(4) << x << endl;
		cout << y << endl;
	}
	return 0;
}