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

int main()
{	
	int n;

	cin >> n;

	while (n >= 0) {
		double t = 0;

		for (int i = 1; i < n; i++)
			t += atan( 1 / sqrt(i) );

		cout << fixed << setprecision(2)
			 << sqrt(n) * cos(t) << endl
			<< sqrt(n) * sin(t) << endl;

		cin >> n;
	}

	return 0;
}
