#include <iostream>
#include <cmath>

using namespace std;

double x[1004];
double y[1004];

#define PI 3.14159265358979323

int main(void){
  double px, py;
  double arg;

  px = 1;
  py = 0;
  for(int i=0;i<1003;i++){
	arg = atan(py / px);
	if(px < 0) arg += PI;
	arg += PI/2;
	px += cos(arg);
	py += sin(arg);
	x[i] = px;
	y[i] = py;
  }
  int n;
  while(cin >> n){
	if(n == -1) break;
	cout << x[n-2] << endl;
	cout << y[n-2] << endl;
  }
}