#include <iostream>
#include <stdio.h>
#include <math.h>

using namespace std;

double angle(int n);
double X(int n);
double Y(int n);

double angle(int n) {
	if(n == 1)	return 0;
	else		return (angle(n - 1) + atan(1 / sqrt((double)(n - 1))));
}

double X(int n) {
	return (sqrt((double)n) * cos(angle(n)));
}

double Y(int n) {
	return (sqrt((double)n) * sin(angle(n)));
}

int main()
{
	int n;
	while(cin >> n, n != -1) {
		printf("%.2f\n%.2f\n", X(n), Y(n));
	}
	return 0;
}