#include <iostream>
#include <cmath>
#include <iomanip>

using namespace std;

const double PI = 3.14159;

int main()
{
	int n;
	while (true) {
		cin >> n;
		if (n==-1) break;
		
		double deg = 0.0;
		for (int i=2; i<=n; i++) deg += atan2(1.0, sqrt(static_cast<double>(i-1)));
		
		double x = sqrt(static_cast<double>(n)) * cos(deg);
		double y = sqrt(static_cast<double>(n)) * sin(deg);
		
		cout << fixed << setprecision(3) << x << endl << y << endl;
	}
	
	return 0;
}