def getInteriorRadian(n)
  return Math.asin(Math.sqrt(n) / n)
end

def solve(n)
  result = Array.new
  s = Math.sqrt(n)
  result << s * Math.cos(@radian[n - 2])
  result << s * Math.sin(@radian[n - 2])
  return result
end

@radian = [getInteriorRadian(2)]
(3..1000).each{|n|
  @radian << getInteriorRadian(n) + @radian[n - 3]
}

loop do
  break if (n = $stdin.gets.to_i) == -1
  result = solve(n)
  p result[0], result[1]
end