#include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;

int main(){

  int n;
  double d, oblique, deg, x, y;

  while(cin >> n){
    if(n < 0) break;
    d = 1.0;
    deg = 0.0;

    for(int i=1; i<n; i++){
      oblique = sqrt(i + 1.0);
      deg += acos((d * d + oblique * oblique - 1.0) / (2.0 * d * oblique));
      d = oblique;
    }
    
    x = d * cos(deg);
    y = d * sqrt(1.0 - cos(deg) * cos(deg));
    printf("%.3lf\n%.3lf\n", x, y);
    
  }
  
  return 0;

}