#include<bits/stdc++.h>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) range(i,0,b)
#define pb(a) push_back(a)
#define all(a) (a).begin(), (a).end()
#define debug(x) cout << "debug " << x << endl;
using namespace std;

struct Point{ double x, y; };
typedef Point Vector;
        
double dot(Vector a, Vector b){ //????????????a??¨b????????????
    return a.x * b.x + a.y * b.y;
}

double dis(Vector a){
    return sqrt(a.x * a.x + a.y * a.y);
}

int main(){
    vector<Vector> V;
    Point p, ido;
    p.x = 1; p.y = 0;
    ido.x = 1; ido.y = 0;
    V.pb(p);

    double thita;
    rep(i,1005){
        thita = acos(dot(ido, V.back()) / (dis(V.back()))) + M_PI / 2;
        p.x = V.back().x + cos(thita);
        p.y = V.back().y + sin(thita);
        //cout << p.x << p.y << endl;
        V.pb(p);
    }
    
    int n;
    while(cin >> n, n!=-1){
        cout << V[n - 1].x + 0.005 << endl << V[n - 1].y + 0.005 << endl;
    }
}