#include <bits/stdc++.h>
#define rep(i,a,n) for(int i=a;i<n;i++)
#define repb(i,a,b) for(int i=a;i>=b;i--)
#define all(a) a.begin(),a.end()
#define o(a) cout<<a<<endl
#define int long long
#define fi first
#define se second
using namespace std;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;

signed main(){
	int n;
	while(1){
		cin>>n;
		if(n==-1) break;
		double a[1010]={};
		double c=0;
		a[0]=1;
		rep(i,1,n){
			a[i]=sqrt(1+a[i-1]*a[i-1]);
			c+=asin(1.0/a[i]);
		}
		double y=a[n-1]*sin(c);
		double x=a[n-1]*cos(c);
		printf("%.10lf\n%.10lf\n", x,y);
	}

}