#include <iostream>
#include <cmath>

using namespace std;

double theta[1001];
double r[1001];

int main() {
    r[0] = 1; theta[0] = 0;
    for (int i = 1; i <= 1000; i++) {
        r[i] = sqrt(r[i-1] * r[i-1] + 1.0);
        theta[i] = theta[i-1] + asin(1.0 / r[i]);
    }

    int n;
    while (cin >> n) {
        if (n == -1) break;
        double x = r[n-1] * cos(theta[n-1]);
        double y = r[n-1] * sin(theta[n-1]);
        cout << x << endl << y << endl;
    }
    return 0;
}