#define _USE_MATH_DEFINES
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <cfloat>
#include <ctime>
#include <cassert>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <numeric>
#include <list>
#include <iomanip>

using namespace std;

int main(){
	double args[1001]; args[0] = 0;
	for (int i = 0; i < 1000; i++){
		args[i+1] = args[i] + atan(1.0/sqrt((double)i+1));
	}

	int n;
	while(cin>>n,~n){
		double l = sqrt((double)n);
		printf("%lf\n%lf\n",l * cos(args[n-1]),l * sin(args[n-1]));
	}

    return 0;
}