#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <algorithm>

struct Point {
	double x, y;
	Point(double x = 0, double y = 0) :x(x), y(y) {};
};

struct Circle {
	double x, y, r;
	Circle(double x = 0, double y = 0, double r = 0) : x(x), y(y), r(r) {};
};

typedef Point Vector;

Vector operator + (Vector A, Vector B) { return Vector(A.x + B.x, A.y + B.y); }
Vector operator - (Vector A, Vector B) { return Vector(A.x - B.x, A.y - B.y); }
Vector operator * (Vector A, double m) { return Vector(A.x * m, A.y * m); }
Vector operator / (Vector A, double m) { return Vector(A.x / m, A.y / m); }

bool operator < (const Point& a, const Point& b) {
	return a.x < b.x || (a.x == b.x && a.y < b.y);
}

const double eps = 1e-9;
int dcmp(double x) {
	if (fabs(x) < eps)
		return 0;
	else
		return x < 0 ? -1 : 1;
}
double Dot(Vector A, Vector B) {
	return A.x*B.x + A.y*B.y;
}
double Length(Vector A) {
	return sqrt(Dot(A, A));
}
double Cross(Vector A, Vector B) {
	return A.x*B.y - A.y*B.x;
}
double distanceToLine(Point P, Point A, Point B) {
	Vector v1 = B - A, v2 = P - A;
	return fabs(Cross(v1, v2)) / Length(v1);
}

bool onLine(Point P, Point A, Vector v) {
	Point B = Point(A.x + v.x*1.0, A.y + v.y*1.0);
	return !dcmp(distanceToLine(P, A, B));
}

bool isSameSign(double a, double b) {
	if (a > 0 && b > 0)
		return 1;
	if (a < 0 && b < 0)
		return 1;
	if (a == 0 && b == 0)
		return 1;
	return 0;
}

bool vectorSameDirection(Vector a, Vector b) {
	return Dot(a, b) > 0;
}

double distanceToOrigin(Point a, Vector v, Circle c) {
	if (vectorSameDirection(v, Vector(c.x - a.x, c.y - a.y)))
		return Length(Vector(c.x - a.x, c.y - a.y));
	else {
		return 2 * c.r - Length(Vector(c.x - a.x, c.y - a.y));
	}
}

int main() {
	//freopen("in.txt", "r", stdin);
	double d;
	while (~scanf("%lf", &d) && d) {
		Vector p, v;
		scanf("%lf%lf%lf%lf", &p.x, &p.y, &v.x, &v.y);
		if (dcmp(Cross(p,v)) == 0 && 
			(dcmp(distanceToOrigin(Point(p.x,p.y), v, Circle(0.0,0.0,1.0)) - d)) <= 0)
			printf("%lf\n", distanceToOrigin(Point(p.x, p.y), v, Circle(0.0, 0.0, 1.0)));
		else
			printf("impossible\n");
	}
	return 0;
}
