### constant

DELTA = 1.0e-6

### global variables

### subroutines
# distance d between ax+by+c=0 and (x0,y0)
# -> d = |ax0+by0+c|/(a^2+b^2)
# x=vx*t+px,y=vy*t+py
# vy*x=vx*vy*t+vy*px,vx*y=vx*vy*t+vx*py
# vy*x-vx*y=vy*px-vx*py -> vy*x-vx*y+(vx*py-vy*px)=0
# d0 = |vx*py-vy*px|/(vx^2+vy^2)

### main

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

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

  l = 0.0

  loop do
    #p [vx, vy, px, py, l]

    ab2 = vx * vx + vy * vy
    c = vx * py - vy * px
    d0 = c.abs / ab2
    if d0 < DELTA
      l += Math.sqrt(px * px + py * py)
      break
    end

    t = (Math.sqrt(ab2 - c * c) - vx * px - vy * py) / ab2
    qx = vx * t + px
    qy = vy * t + py

    thq = Math.atan2(qy, qx)
    thv = Math.atan2(vy, vx)
    th = Math::PI - 2 * (thv - thq)
    ct = Math.cos(th)
    st = Math.sin(th)
    vx0 = ct * vx - st * vy
    vy0 = st * vx + ct * vy

    l += Math.sqrt((qx - px) ** 2 + (qy - py) ** 2)

    vx = vx0
    vy = vy0
    px = qx
    py = qy

    break if l > d
  end
  #p l

  puts (l > d ? 'impossible' : "%.8f" % l)
end