#include <cmath>
#include <vector>
#include <iostream>

#define PI 3.14159265358979323846264338327950288L

using namespace std;

int main()
{
	int n;

	vector<long double> x(1001), y(1001);

	x[1] = 1.0; y[1] = 0.0;

	for (int i = 2; i <= 1000; i++)
	{
		long double theta = PI / 2.0L + atan2l(y[i - 1], x[i - 1]);

		x[i] = x[i - 1] + cos(theta);
		y[i] = y[i - 1] + sin(theta);
	}

	while (true)
	{
		cin >> n;

		if (n == -1) { break; }

		cout << x[n] << endl << y[n] << endl;
	}

	return 0;
}