#include <iostream>
#include <stdio.h>
#include <math.h>
using namespace std;

int main() {
    double k,i,n;
	while(cin >> n) {
		if (n==-1) break;
		k=0;
		for (i=2;i<=n;i++) k+=asin(1/sqrt(i));
		cout << cos(k)*sqrt(n) << endl;
		cout << sin(k)*sqrt(n) << endl;
	}
	return 0;
}