#include<stdio.h>
#include<math.h>

int main(void){
  double px,py,vx,vy,D,a,b;

  while(1){
    scanf("%lf",&D);
    if(D==0)break;
    scanf("%lf%lf%lf%lf",&px,&py,&vx,&vy);
    a=px*px+py*py;
    b=sqrt(a);

    if(py*vx==vy*px){
      if((px<0 && vx<0)||(px>0 && vx>0)){
	if(2-b<=D)printf("%.8f\n",2-b);
	else printf("impossible\n");
	}
      else if(vx==0 && vy==0)printf("impossible\n");
      else {
	if(b<=D)printf("%.8f\n",b);
	else printf("impossible\n");
	}
    }
    else printf("impossible\n");

  }
  return 0;
}