#include<iostream>
#include<cmath>
#include<cstdio>

using namespace std;

int main(){
  int n;
  while(1){
    cin >> n;
    if(n==-1) break;
    double x=0, y=0, r=0, t=0;
    for(int i=0; i<n; ++i){
      x += cos(r);
      y += sin(r);
      r = t + M_PI/2;
      t += acos((i+1)/(sqrt(i+1)*sqrt(i+2)));
    }
    printf("%0.2f\n%0.2f\n", x, y);
  }
  return 0;
}