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

using namespace std;

int main()
{
	while(1)
	{
		int n;
		cin>>n;
		if(n==-1)break;
		double t=0;
		for(int i=2;i<=n;i++)
		{
			t+=asin(1.0/sqrt((double)i));
		}
		cout<<sqrt((double)n)*cos(t)<<endl<<sqrt((double)n)*sin(t)<<endl;
	}
}