### constant

DELTA = 1.0e-9

### main

loop do
  d = gets.to_f
  break if d == 0.0

  px, py, vx, vy = gets.split.map(&:to_f)

  dp = Math.sqrt(px * px + py * py)
  dv = Math.sqrt(vx * vx + vy * vy)
  prd = px * vx + py * vy
  cospv = prd / (dp * dv)

  if (cospv + 1.0).abs < DELTA
    puts "%.8f" % dp
  elsif (cospv - 1.0).abs < DELTA
    puts "%.8f" % (2.0 - dp)
  else
    puts 'impossible'
  end
end