#include <bits/stdc++.h>
using namespace std;

#define for_(i,a,b) for(int i=(a);i<(b);++i)

const double EPS = 1e-9;

typedef struct Point {
	double x, y;
		
	Point operator - (const Point& a) const {
		return Point{x - a.x, y - a.y};
	}
	
	Point operator / (double d) const {
		return Point{x / d, y / d};
	}
	
	bool operator == (const Point& a) const {
		return fabs(x - a.x) < EPS && fabs(y - a.y) < EPS;
	}
} Vector;

double abs(Point a) {
	return sqrt(a.x * a.x + a.y * a.y);
}

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

bool is_parrallel(Vector a, Vector b) {
	return fabs(cross(a, b)) < EPS;
}

Vector unit(Vector a) {
	return a / abs(a);
}

double D, px, py, vx, vy;
Point zero{0, 0}, p, v;

double calc() {
	double a = abs(p), b = 1.0 - a;
	
	Vector uz = unit(p - zero), vp = unit(v);
	
	if (uz == vp) return a + 2. * b;
	return a;
}

int main() {
	while (cin >> D, D > EPS) {
		cin >> px >> py >> vx >> vy;
		
		p = Point{px, py};
		v = Point{vx, vy};
		
		if (is_parrallel(v, p)) {
			double d = calc();
			if (d > D + EPS) cout << "impossible" << endl;
			else cout << setprecision(9) << setiosflags(ios::fixed) << d << endl;
		} else {
			cout << "impossible" << endl;
		}
	}
}