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

int main () {
	int a;
	double x, y,c;
	while(cin >> a) {
		if(a == -1) {
			break;
		}
		c = 0.0;
		for(size_t i = 1; i < a; i++) {
			c += acos ( sqrt ( i ) / sqrt ( i + 1 ) );
		}
		cout << sqrt ( a )*cos ( c ) << endl;
		cout << sqrt ( a )*sin ( c ) << endl;
	}
	//cout << acos ( 1 / sqrt ( 2 ) ) *180/M_PI<< endl;
	//getchar ();
	return 0;
}