import Control.Applicative
import Text.Printf
main = do
  v <- takeWhile (/= -1) . map (read::String->Int) . lines <$> getContents
  mapM_ (\x->putStrLn $ (printf "%.2f".fst$x)++"\n"++(printf "%.2f".snd$x)) . map (solve . ((+) (-1))) $ v

solve::Int->(Double,Double)
solve n = (map f [0..]) !! n
f 0 = (1.0,0.0)
f n = (x',y')
  where
    (x,y) = solve (n-1)
    cost = x/ sqrt(x^2+y^2)
    sint = y/ sqrt(x^2+y^2)
    cost' = -sint
    sint' = cost
    x' = x + cost'
    y' = y + sint'