#include<iostream>
#include<cmath>

using namespace std;

int main(){
  int i, n;
  double x, y, radian, Cos_theta, _theta, theta;
  char c;

  while(1){
    cin >> n;
    if(n == -1) break;

    x=0;
    y=0;
    radian=0;
    theta=0;

    for(i=0; i<n; ++i){
      x += cos(radian);
      y += sin(radian);
      radian = theta + M_PI/2;

      Cos_theta = (i+1)/(sqrt(i+1) * sqrt(i+2));
      _theta = acos(Cos_theta);
      theta += _theta;
    }

    cout.setf(ios::fixed, ios::floatfield);
    cout.precision(2);
    cout << x << endl;
    cout << y << endl;

  }

  return 0;
}