#include <iostream>
#include <algorithm>
#include <cmath>
#include <complex>
#include <vector>
#include <cstdio>
using namespace std;
typedef complex<double> P;
const double pi = acos(-1);

int main() {
  int N;
  while(cin >> N && N != -1) {
    P pos(1.0, 0.0);
    double rad = pi;
    for(int i = 2; i <= N; ++i) {
      rad = rad + 1.5*pi;
      pos += P(cos(rad), sin(rad));
      rad = arg(pos) + pi;
    }
    printf("%.10f\n", pos.real());
    printf("%.10f\n", pos.imag());
  }
  return 0;
}