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

main(){
  double d;
  double px, py, vx, vy, ans, lp, lv, naiseki;

  while(1){
    scanf("%lf", &d);
    if(d==0) break;

    scanf("%lf %lf %lf %lf", &px, &py, &vx, &vy);

    naiseki=px*vx+py*vy;
    lp=sqrt(px*px+py*py);
    lv=sqrt(vx*vx+vy*vy);

    ans=naiseki/(lp*lv);

    if(ans==1) printf("%f\n", lp+1);
    else if(ans==-1) printf("%f\n", lp);
    else printf("impossible\n");
  }
  return 0;
}