#include<cstdio>
#include<complex>
#define EPS 1e-10
using namespace std;

typedef complex<double> P;

double dot(P a,P b){return real(conj(a)*b);}

int main(){
  double d;
  double px,py,vx,vy;

  while(scanf("%lf",&d) && d!=0.0){
    scanf("%lf %lf %lf %lf",&px,&py,&vx,&vy);
    P a = P(0-px,0-py),b = P(vx,vy);
    double seta = dot(a,b)/(abs(a)*abs(b));
    double dis = d+1;
    if(abs(seta-1)<EPS)dis = abs(a);
    if(abs(seta+1)<EPS)dis = 2-abs(a);
    if(dis < d + EPS)printf("%.8lf\n",dis);
    else printf("impossible\n");
  }
}