#include <iostream>
#include <cstdio>
#include <cstring>
#include <sstream>
#include <algorithm>
#include <math.h>
#include <map>
#include <functional>
#include <iomanip>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <typeinfo>
#define PI 3.14159265359
#define INF 99999999
#define rep(i, n) for(int i=0; i<n; i++)
#define REP(n) rep(i, n)
#define pb push_back
#define mp make_pair
typedef long long ll;
using namespace std;
typedef pair<int, int> P;

//				x	,	y
map<int, pair<double, double> > m;
double nowx, nowy;

pair<double, double> calc_next_pos(double x, double y)
{
	pair<double, double> ret;

	double tmp_x = x, tmp_y = y;

	x *= -1.0;
	y *= -1.0;
	double rt = sqrt(x*x + y*y);
	x /= rt;
	y /= rt;

	ret.first = y + tmp_x;
	ret.second = -x + tmp_y;

	return ret;
}

int main()
{
	nowx = nowy = 1.0;

	pair<double, double> next;
	next = calc_next_pos(nowx, nowy);
	m[3] = next;

	int cnt = 4;

	while (cnt < 1001)
	{
		nowx = next.first;
		nowy = next.second;
		next = calc_next_pos(nowx, nowy);
		m[cnt] = next;
		cnt++;
	}

	int n;

	while (cin >> n, n != -1)
	{
		printf("%.2lf\n%.2lf\n", m[n].first, m[n].second);
	}

	return 0;
}