include Math
while gets
    x,rad=1.0,0.0
    s=$_.to_i
    break if s==-1
    (s-1).times do
        r=sqrt(x**2+1)
        rad+=asin(1/r)
        x=r
    end
    printf("%.2f\n%.2f\n",x*cos(rad),x*sin(rad))
end