#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
using namespace std;
int main(){
  int n;
  while(1){
    scanf("%d",&n);
    if(n==-1) break;
    double an=2*M_PI;
    double x=0,y=0;
    double k=1;
    for(int i=2;i<n+2;i++){
      an+=asin(1/k);
      x=cos(an)*k;
      y=sin(an)*k;
      k=sqrt(i);
    }
    printf("%.2lf\n%.2lf\n",y,-x);
  }
}