#include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;
#define rep2(x,from,to) for(int x = (from); x < (to); ++(x))
#define rep(x,to) rep2(x,0,to)
int main() {
	double y[1010], x[1010];
	double sy = 1, sx = 1;
	x[2] = 1.0, y[2] = 1.0;
	rep2(i,3,1001) {
		double len = sqrt(pow(sy,2.0) + pow(sx,2.0));
		double dy = sy - sy/len; double dx = sx - sx/len;
		double by = sy, bx = sx;
		sy = - (dx-bx) + by; sx = dy-by+bx;
		y[i] = sy, x[i] = sx;
	}
	int n;
	while(cin >> n && n != -1) {
		cout << x[n] << endl << y[n] << endl;
	}
	return 0;
}