import std.stdio, std.string, std.conv;
import std.array, std.algorithm, std.range;
import std.math;

void main()
{
    auto a = stdin.byLine().map!(to!int).array().until(-1).array().idup;
    auto m = a.reduce!max()+1;
    auto p = new real[][](m,2);
    p[0][]=0.0;
    auto d = PI_2;
    foreach(i;1..m)
    {
        d-=PI_2;
        auto x=p[i][0]=p[i-1][0]+cos(d);
        auto y=p[i][1]=p[i-1][1]+sin(d);
        d=atan2(-y,-x);
    }
    foreach(v;a)
        writefln("%.2f",p[v][0]),
        writefln("%.2f",p[v][1]);
}