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

const double pi = acos(-1);

int main() {
  int n;

  while(cin >> n, n != -1) {
    double x = 1, y = 1, ang =pi*135/180, len = sqrt(2);
    for(int i = 0; i < n-2; i++) {
      x += cos(ang);
      y += sin(ang);

      ang += atan(1/len);
      len = sqrt(len*len+1*1);
    }
    printf("%lf\n%lf\n", x, y);
  }
}