#include<iostream>
#include<algorithm>
#include<cmath>
#include<cstdio>
using namespace std;

int main(){
    double ans[1050];
    ans[1] = 0;
    for(int i = 2;i < 1050;i++){
	double tmp = 1 / sqrt(i - 1);
	ans[i] = (ans[i - 1] + tmp) / (1 - ans[i - 1] * tmp);
    }
    int n;
    while(cin >> n, n != -1){
	double s = hypot(ans[n], 1);
	printf("%.9lf\n", sqrt(n) / s);
	printf("%.9lf\n", ans[n] * sqrt(n) / s);
    }
    return 0;
}