#define _USE_MATH_DEFINES
#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
#include <cstdio>
using namespace std;


double ShahenArray[1003];

double Shahen(int n){
	if (n == 2){
		ShahenArray[n] = sqrt(1 * 1 + 1 * 1);
		return ShahenArray[2];
	}
	ShahenArray[n] = sqrt(pow(Shahen(n - 1), 2.0) + 1 * 1);
	// pow使わずShahen(n-1) * Shahen(n-1) にするととんでもなく遅い.
	return ShahenArray[n];
}

double Kakudo(int n, double rad){
	double ans=0;
	if (n == 2){
		rad = atan2(1.0 , 1.0);
		return rad;
	}
	else{
		rad = atan2(1.0, ShahenArray[n-1]);
		return rad + Kakudo(n - 1, rad);
	}
}

double toKakudo(double rad){
	return rad * 180.0 / M_PI;
}

int main(){
	int n;
	double x=1, y=1;

	Shahen(1000);

	while (cin >> n, n != -1){
		x = 0;
		y = 0;
		double shahen = ShahenArray[n];
		double kakudo = Kakudo(n, 0);
		x = shahen * cos(kakudo);
		y = shahen * sin(kakudo);
		printf("%.7f\n", x);
		printf("%.7f\n", y);
	}
	 
	// cout << Shahen(n) << " " << toKakudo(Kakudo(n,0)) << endl;

	return 0;
}