class Q1053
  def dist a,b
    ::Math.sqrt(a*a + b*b)
  end
  def doIt
    d = gets.to_f
    eps = 10**(-12)
    while 0 < d
      ary = gets.split(" ").map{|x| x.to_f}
      ip = ary[0]*ary[2] + ary[1]*ary[3]
      p = dist(ary[0],ary[1])
      v = dist(ary[2],ary[3])
      cosine = ip / (p*v)
      #printf("cos = %.17f\n", cosine)
      #puts p
      if 1 - eps < cosine && cosine < 1 + eps
        if 2 - p <= d
          puts(2 - p)
        else
          puts "impossible"
        end
      elsif -1 - eps < cosine && cosine < -1 + eps
        if p <= d
          puts p
        else
          puts "impossible"
        end
      else
        puts "impossible"
      end
      d = gets.to_f
    end
  end
end

Q1053.new.doIt