#include <iostream>
#include <cstring>
#include <math.h>
#include <iomanip>

using namespace std;

const double PI = 3.1415926;

int main(void) {
	int i,n;
	double len,p,angle;
	double pointX[1001],pointY[1001];

	memset(pointX, 0, sizeof(pointX));
	memset(pointY, 0, sizeof(pointY));

	pointX[2] = pointY[2] = 1.0;
	len = 2;
	angle = PI / 4;
	for (i = 3; i < 1001; i++) {
		p = sqrt(len);
		angle += atan(1 / p);
		len += 1;
		p = sqrt(len);
		pointX[i] = p * cos(angle);
		pointY[i] = p * sin(angle);
	}

	while (1) {
		cin >> n;
		if (n == -1) {
			break;
		}
	
		cout << fixed << setprecision(2)<< pointX[n] << endl << fixed<<setprecision(2)<< pointY[n] << endl;
	}
	

	return 0;
}


