#include <bits/stdc++.h>

using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)

int main() {
	while (true) {
		int n;
		cin >> n;
		if (n == -1) break;
		
		double angle = 0.0, x = 1.0, y = 0.0;
		n--;
		while (n--) {
			double base = hypot(x, y);
			double l = hypot(base, 1.0);
			angle += atan2(1.0 , base);
			x = l * cos(angle);
			y = l * sin(angle);
		}
		printf("%lf\n%lf\n", x, y);
	}
	return 0;
}