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

int main(void){
	int n;
	double x, y;
	double shahen;
	double theta;

	while(1){
		scanf("%d", &n);
		if(n == -1) break;

		x = 1;
		y = 1;
		shahen = sqrt(x*x + y*y);
		x = shahen;
		theta = M_PI/4.0;
		for(int i=0; i<n-2; i++){
			shahen = sqrt(x*x + y*y);
			theta += atan(y/x);
			x = shahen;
		}
		x = shahen * cos(theta);
		y = shahen * sin(theta);

		printf("%f\n%f\n", x, y);
	}

	return 0;
}