main(){
	double D,px,py,vx,vy,a;
	for(;scanf("%lf%lf%lf%lf%lf",&D,&px,&py,&vx,&vy),D;){
		if(px*vy-py*vx<1e-9){
			if(a=hypot(px,py),px*vx+py*vy<0&&D>a-1e-4){
				printf("%f\n",a);
			}else if(a=2-hypot(px,py),px*vx+py*vy>0&&D>a-1e-4){
				printf("%f\n",a);
			}else{
				puts("impossible");
			}
		}else{
			puts("impossible");
		}
	}
	exit(0);
}