#include<iostream>
#include<cmath>
#include<iomanip>
using namespace std;

double calc_rad( double a, double b, double c )
{
    double cos = ( b * b - a * a - c * c ) / ( -2 * a * c );        //余弦でcosを算出
    return acos(cos);                                               //ラジアンを算出
}

int main()
{
    int n;
    double pi = acos(-1);

    while( cin >> n )
    {
        if( n == -1 )
            break;

        double x = 1, y = 1, rad = pi / 4;
        double a = 1, b = 1, c = sqrt(2);

        n -= 2;

        while( n-- )
        {
            a = c;
            c = sqrt( a * a + b * b );

            rad = rad + calc_rad( a, b, c );
            x = c * cos(rad);
            y = c * sin(rad);
        }
        cout << fixed << setprecision(5) << x << endl << y << endl;
    }
    return 0;
}

