#include <iostream>
#include <cmath>

#define REP(i,k,n) for(int i=k;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)

using namespace std;

double memo[1001][2];

void calc()
{
	memo[0][0] = 1;
	memo[0][1] = 0;

	double angle = 0;
	double PI = acos(-1.0);

	REP(i,1,1001)
	{
		double r = sqrt(1.0 + i);
		double cos_ = sqrt((double)i) / r;
		angle += acos(cos_);
		memo[i][0] = r * cos(angle);
		memo[i][1] = r * sin(angle);
	}
}

int main()
{
	int n;
	double x,y;
	calc();
	while(cin >> n,n != -1)
	{
		if(n == 0) 
		{
			cout << fixed;
			cout.precision(2);
			cout << 1.0 << endl;

			cout << fixed;
			cout.precision(2);
			cout << 0.0 << endl;
		}
		else
		{
			cout << fixed;
			cout.precision(2);
			cout << memo[n][0] << endl;

			cout << fixed;
			cout.precision(2);
			cout << memo[n][1] << endl;
		}
	}
	return 0;
}