#include <cmath>
#include <iostream>
const int N=1001;
int main(){
	double A[N]={0},a=0,b;
	for(int i=1;i<N;i++){
		A[i]=a;
		a+=atan2(1,sqrt(i));
	}
	int n;
	while(std::cin>>n,n+1){
		b=sqrt(n);
		std::cout<<b*cos(A[n])<<"\n"<<b*sin(A[n])<<"\n";
	}
}