// AOJ 1053: Accelerated Railgun
// 2017.10.31 bal4u@cc

#include <stdio.h>
#include <math.h>

#define EPS 1e-7

int main()
{
	double d, px, py, vx, vy, ans;
	double dp, dv, x;

	while (scanf("%lf", &d) && d > 0) {
		scanf("%lf%lf%lf%lf", &px, &py, &vx, &vy);
		ans = d + 1;
		dp = sqrt(px*px + py*py);
		dv = sqrt(vx*vx + vy*vy);
		x = px*vx + py*vy;
		x = x/(dp*dv);
		if (fabs(x+1) <= EPS) ans = dp;
		else if (fabs(1-x) <= EPS) ans = 2-dp;

		if (fabs(ans-d) <= EPS || ans <= d) printf("%.8lf\n", ans);
		else puts("impossible");
	}
	return 0;
}