#include <iostream>
#define _USE_MATH_DEFINES
#include <cmath>

using namespace std;
typedef pair<double, double> P;
P point[1001];

void calc()
{
	double theta = M_PI / 4;
	point[2].first = 1.0;
	point[2].second = 1.0;
	for(int i = 2; i < 1000; ++i)
	{
		theta += atan(1 / sqrt((double)i));
		point[i + 1].first = sqrt((double)i + 1) * cos(theta);
		point[i + 1].second = sqrt((double)i + 1) * sin(theta);
	}
}

void solve()
{
	calc();
	int n;
	while(true)
	{
		cin >> n;
		if(n == -1)
		{
			break;
		}
		printf("%.2f\n%.2f\n", point[n].first, point[n].second);
	}
}

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