Problem: As I was cleaning up the warehouse, I found an old document that describes how to get to the treasures of my ancestors. The following was written in this ancient document.


1. First, stand 1m east of the well on the outskirts of the town and turn straight toward the well.
2. Turn clockwise 90 degrees, go straight for 1m, and turn straight toward the well.
3. Turn clockwise 90 degrees, go straight for 1m, and turn straight toward the well.
Four.                   〃
Five.                   〃
6::


From the second line onward, exactly the same thing was written. You wanted to find the treasure, but found it awkward. Unlike in the past, the building is in the way, and you can't see the well even if you go straight in the direction of the well, or you can't go straight even if you try to go straight for 1m. In addition, this ancient document has nearly 1000 lines, and it takes a considerable amount of time and physical strength to work according to the ancient document. Fortunately, however, you can take advantage of your computer.

Enter the number of lines n written in the old document and create a program that outputs the location of the treasure. However, n is a positive integer between 2 and 1,000.



input

Given multiple datasets. For each dataset, one integer n, which represents the number of lines in the old document, is given on each line.

The input ends with -1. The number of datasets does not exceed 50.

output

Assuming that there is a treasure at the position x (m) to the east and y (m) to the north from the well on the outskirts of the town, output each data set in the following format.


x
y


The output is a real number and may contain an error of 0.01 or less.

Example

Input

3
6
-1


Output

0.29
1.71
-2.31
0.80

Solution (in CPP):

Solution:
#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;
}