main(){
	float D,px,py,vx,vy,a,l;
	for(;scanf("%f",&D),D;){
		scanf("%f%f%f%f",&px,&py,&vx,&vy);
		a=hypot(px,py);
		l=px*vx+py*vy<0?a:2-a;
		printf(fabs(px*vy-py*vx)||D<l?"impossible\n":"%f\n",l);
	}
	exit(0);
}