#include <iostream>
#define _USE_MATH_DEFINES
#include <math.h>

using namespace std;

void solve()
{
	int n;
	while(cin >> n, n != -1)
	{
		double x = 0;
		double y = 0;
		double angle = 0;
		while(n--)
		{
			x += cos(angle);
			y += sin(angle);	
			angle = M_PI / 2 + atan2(y, x);
		}
		cout << x << endl;
		cout << y << endl;
	}
}

int main()
{
	solve();
	return(0);
}