#include <cstdio>
#include <cstring>
#include <cmath>
#include <utility>
#include <algorithm>
#define EPS 1e-10
using namespace std;

double add(double a,double b){
	if(fabs(a+b)<EPS*(fabs(a)+fabs(b)))return 0.0;
	return a+b;
}

class P{
public:
	double x,y;
	P(){}
	P(double xx,double yy){
		x=xx;
		y=yy;
	}
	P operator+(P p){
		return P(add(x,p.x),add(y,p.y));
	}
	P operator-(P p){
		return P(add(x,-p.x),add(y,-p.y));
	}
	P operator*(double d){
		return P(x*d,y*d);
	}
	P operator/(double d){
		return P(x/d,y/d);
	}
};

class Segment{
public:
	P p1,p2;
	Segment(){}
	Segment(P pp1,P pp2){
		p1=pp1;
		p2=pp2;
	}
};

class Circle{
public:
	P c;
	double r;
	Circle(){}
	Circle(P cc, double rr){
		c=cc;
		r=rr;
	}

};
typedef Segment Line;
typedef P Vector;
double norm(Vector p){
	return p.x*p.x+p.y*p.y;
}

double abs(Vector p){
	return sqrt(norm(p));
}

double dot(Vector a,Vector b){
	return add(a.x*b.x,a.y*b.y);
}

double cross(Vector a,Vector b){
	return add(a.x*b.y,-a.y*b.x);
}

P project(Segment s,P p){
	Vector base=s.p2-s.p1;
	double r=dot(p-s.p1,base)/norm(base);
	return s.p1+base*r;
}

P getCrossPoint(Circle c,Line l){
	Vector pr=project(l,c.c);
	Vector e=(l.p2-l.p1)/abs(l.p2-l.p1);
	double base=sqrt(c.r*c.r-norm(pr-c.c));
	return pr+e*base;
}

double getDistanceLP(Line l,P p){
	return abs(cross(l.p2-l.p1,p-l.p1)/abs(l.p2-l.p1));
}

double getDistanceSP(Segment s,P p){
	if(dot(s.p2-s.p1,p-s.p1)<0.0)return abs(p-s.p1);
	if(dot(s.p1-s.p2,p-s.p2)<0.0)return abs(p-s.p2);
	return getDistanceLP(s,p);
}

P p;
Vector v;


int main(void){
	Circle R=Circle(P(0.0,0.0),1.0);
	while(1){
		double d;
		scanf("%lf",&d);
		if(d<EPS)break;
		scanf("%lf %lf %lf %lf",&p.x,&p.y,&v.x,&v.y);
		double V=abs(v);
		double dist=0.0;
		while(dist<=d){
			P p2=p+v*20000.0;
			if(fabs(getDistanceSP(Segment(p,p2),P(0.0,0.0)))<EPS){
				dist+=abs(p);
				break;
			}
			P next=getCrossPoint(R,Line(p,p2));
			double a=atan2(next.y,next.x);
			double b=atan2(v.y,v.x);
			double nextdir=M_PI+a-(b-a);
			v.x=V*cos(nextdir);
			v.y=V*sin(nextdir);
			double bd=abs(next-p);
			dist+=bd;
			p=next;
		}
		if(dist>d)printf("impossible\n");
		else printf("%.9f\n",dist);
	}
	return 0;
}