#include <iostream>
#include <cstdio>
#include <vector>
#include <list>
#include <algorithm>
#include <cmath>
#include <stack>
#include <map>
#include <numeric>
#include <sstream>
#include <queue>
#include <iomanip>
using namespace std;

#define REP(i,n) for(int (i)=0; (i)<(n); (i)++)
#define FOR(i,a,b) for(int (i)=(a); (i)<(b); (i)++)
#define PUSH(n,v) for(int i=0; i<(n); i++) {int j; cin >> j; v.push_back(j);}
#define ALL(v) v.begin(), v.end()
#define print(s) cout << (s) << endl

typedef pair<double,double> P;
const double PI = acos(-1);

P pos[1000];

int main() {
    int n;
    pos[0] = make_pair(1,0);
    FOR(i,1,1000) {
        P last = pos[i-1];
        double arg = atan(last.second / last.first);
        if (arg < 0) arg += PI;
        if (last.second < 0) arg += PI;
        pos[i] = make_pair(last.first - sin(arg), last.second + cos(arg));
    }
    
    while (cin >> n, n+1) {
        printf("%.3f\n%.3f\n", pos[n-1].first, pos[n-1].second);
    }
    return 0;
}