#include<iostream>
#include<cmath>
using namespace std;
int n; double x[2000][2], p;
int main() {
	x[0][0] = 0.0; x[0][1] = 0.0;
	x[1][0] = 1.0; x[1][1] = 0.0;
	for (int i = 2; i < 1500; i++) {
		p = asin(x[i - 1][1] / sqrt(x[i - 1][0] * x[i - 1][0] + x[i - 1][1] * x[i - 1][1]))*(180 / 3.141592653589793238);
		x[i][0] = x[i - 1][0] + sin((p + 180)*0.01745329251994);
		p = asin(x[i - 1][0] / sqrt(x[i - 1][0] * x[i - 1][0] + x[i - 1][1] * x[i - 1][1]))*(180 / 3.141592653589793238);
		x[i][1] = x[i - 1][1] + sin((p)*0.01745329251994);
	}
	while (true) {
		cin >> n;
		if (n == -1) { break; }
		cout << x[n][0] << endl << x[n][1] << endl;
	}
}