#include<iostream>
#include<cmath>
#include<cstdio>
using namespace std;
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
int main(){
  int n;
  while(cin>>n,n+1){
    double rad=0;
    double dis=1;
    rep(i,n-1){
      rad+=atan(1/dis);
      dis=hypot(dis,1);
    }
    printf("%.10f\n%.10f\n",dis*cos(rad),dis*sin(rad));
  }
}