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

struct Point {
	double x, y;
};

Point point[1001];


void treasure() {
	point[2].x = 1.0;
	point[2].y = 1.0;
	double r_p = sqrt(2), r_n;
	double theta;
	for (int i = 3; i < 1001; i++) {
		r_n = sqrt(r_p * r_p + 1);
		theta = acos((r_n * r_n + r_p * r_p - 1) / (2 * r_n * r_p));
		point[i].x = ((cos(-1 * theta) * point[i - 1].x - sin(-1 * theta) * point[i - 1].y) * (r_n / r_p));		//r_n/r_pは比
		point[i].y = ((sin(-1 * theta) * point[i - 1].x + cos(-1 * theta) * point[i - 1].y) * (r_n / r_p));
		r_p = r_n;
	}
	
}

int main() {
	int n;
	treasure();
	while (true) {
		cin >> n;
		if (n == -1) {
			break;
		}
		printf("%.2lf\n%.2lf\n", point[n].y, point[n].x);
	}
	return 0;
}
