#include <complex>
#include <vector>
#include <algorithm>
using namespace std;

const double EPS = 1e-7;
typedef complex<double> P; /* _ */
typedef vector<P> G; /* ½p` */
struct L { P p, q; L(P p, P q) : p(p), q(q) {} }; /* üª */

// àÏEOÏEpx
double dot(P a, P b) { return real(conj(a)*b); }
double cross(P a, P b) { return imag(conj(a)*b); }
double angle(P a, P b) { return arg(b-a); }

// complexÉå¬ÖWªKvÈê
namespace std{
	bool operator < (const P &a, const P &b){ return make_pair(real(a),imag(a)) < make_pair(real(b),imag(b)); }
}

// ¼ülÆ¼ümªð··é©ð»è·éið·µÈ¢êÍ½sj
bool intersLL(L l, L m) {
  return abs(cross(l.q-l.p, m.q-m.p)) > EPS || // non-parallel
         abs(cross(l.q-l.p, m.p-l.p)) < EPS;   // same line
}

// ¼ülÆüªsªð··é©ð»è·é
bool intersLS(L l, L s) {
  return abs(cross(l.q-l.p, s.p-l.p)*cross(l.q-l.p, s.q-l.p)) < EPS;
}

// üªaÆüªbªð··é©ð»è·é
bool intersSS(L a, L b){
	if(abs(imag((a.q-a.p)/(b.q-b.p)))<EPS) return false;
	return cross(a.q-a.p, b.p-a.p)*cross(a.q-a.p, b.q-a.p) < 0 &&
    	   cross(b.q-b.p, a.p-b.p)*cross(b.q-b.p, a.q-b.p) < 0;
}

// _pª¼ülãÉ¶Ý·é©ð»è
bool intersLP(L l, P p){
	return abs(imag((p-l.p)/(l.q-l.p)))<EPS;
}

// _pªüªlãÉ¶Ý·é©ð»è·éi¸x¤j
bool intersSP(L l, P p){
	//return abs( abs(l.p-p)+abs(l.q-p)-abs(l.q-l.p) ) < EPS; // ¸xðCÉµÈ¢Èç±êH
	if(intersLP(l, p)){
		if((real(l.p)-real(p))*(real(l.q)-real(p))<=0){
		if((imag(l.p)-imag(p))*(imag(l.q)-imag(p))<=0){
			return true;
		}}
	}
	return false;
}

// ¼üaÆ¼übÌð_ðvZ·éDæÉð·»èªK{D
// ð·»èiintersLL or intersLS or intersSSj
P crossPointLL(L a, L b){
	double A = cross(a.q-a.p, b.q-b.p);
	double B = cross(a.q-a.p, a.q-b.p);
	return b.p + B/A * (b.q-b.p);
}

// ¼üaÆ¼übª¯êÌàÌ©ð»è·é
bool sameLine(L a, L b){
	return intersLP(a,b.p)&&intersLP(a,b.q);
}

// ¼ülÆ_pÌ£ðßé
double distLP(L l, P p){
	return abs(cross(l.q-l.p,p-l.p))/abs(l.q-l.p);
}

// ¼ülÆ¼ümÌ£ðßéiÀsÌj
double distLL(L l, L m) {
	return sameLine(l, m) ? 0.0 : distLP(l, m.p);
}

// ¼ülÆüªsÌ£ðßé
double distLS(L l, L s) {
	if(intersLS(l, s)) return 0.0;
	return min(distLP(l, s.p), distLP(l, s.q));
}

// üªsÆ_pÌ£ðßé
double distSP(L s, P p){
	if(dot(s.q-s.p,p-s.p)<-EPS) return abs(p-s.p);
	if(dot(s.p-s.q,p-s.q)<-EPS) return abs(p-s.q);
	return abs(cross(s.q-s.p,p-s.p))/abs(s.q-s.p);
}

// üªsÆüªtÌ£ðßé
double distSS(L s, L t) {
  if (intersSS(s, t)) return 0;
  return min(min(distSP(s, t.p), distSP(s, t.q)),
             min(distSP(t, s.p), distSP(t, s.q)));
}

// üªaÆüªbªI[o[bvµÄ¢é©ð»è·é
bool overlapSS(L a, L b){
	if(intersSP(a,b.p)&&intersLP(a,b.q)) return true;
	if(intersSP(a,b.q)&&intersLP(a,b.p)) return true;
	if(intersSP(b,a.p)&&intersLP(b,a.q)) return true;
	if(intersSP(b,a.q)&&intersLP(b,a.p)) return true;
	return false;
}

// üªÌWresÅüªlÆdÈéüªð}[WµCresðXV·é
void mergeLine(vector<L> &res, L l){
	int n = res.size();
	vector<L>::iterator it = res.begin();
	while(it!=res.end()){
		if(overlapSS((*it), l)){
			P dir(l.q-l.p);
			double m = 0.0, M = 1.0;
			m = min(m, real((it->p-l.p)/dir));
			M = max(M, real((it->p-l.p)/dir));
			m = min(m, real((it->q-l.p)/dir));
			M = max(M, real((it->q-l.p)/dir));
			l = L(l.p+m*dir,l.p+M*dir);
			it = res.erase(it);
		} else {
			it++;
		}
	}
	res.push_back(l);
}

// ¼üÌWresÅd¡·é¼üðíµCresðXV·é
// px\[gðÀ·êÎ¬»}êéª¸s·éEEE
void deleteSameLine(vector<L> &res){
	int n = res.size();
	for(int i=0; i<n; i++){
		if(imag(res[i].p) > imag(res[i].q)){
			P temp = res[i].p;
			res[i].p = res[i].q;
			res[i].q = temp;
		}
	}
	//sort(res.begin(), res.end(), LessAngle);
	for(int i=0; i<n; i++){
		vector<L>::iterator it = res.begin() + i + 1;
		while(it<res.end()){
			if( sameLine(res[i], (*it)) ){ /* ±±ðÏ¦êÎpªø­ */
				it = res.erase(it);
				n--;
			} else {
				it++;
			}
		}
	}
}

#include <iostream>
#include <cstdio>
int main(){
	double D;
	while(cin>>D){
		if(D==0) break;
		double px, py, vx, vy;
		cin>>px>>py>>vx>>vy;
		P mikoto = P(px, py);
		P vec = P(vx, vy);
		P aim = P(0.0, 0.0);
		L line = L(mikoto, mikoto+vec);
		if(intersLP(line, aim)){
			double dist = abs(mikoto-aim);
			double ans;
			if(dot(mikoto,vec)<0+EPS){
				ans = dist;
			} else {
				ans = 2.0 - dist;
			}
			if(D>ans){
				printf("%.8f\n", ans);
			} else {
				cout<<"impossible"<<endl;
			}
		} else {
			cout<<"impossible"<<endl;
		}
	}
	return 0;
}

Measured memory_bytes: 0