#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <cfloat>
#include <stack>
#include <queue>
#include <vector>
#include <string>
#include <iostream>
#include <set>
#include <map>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;

double DIST;

struct Point{
	double x,y;
};

double dot(Point a,Point b){
	return a.x*b.x + a.y*b.y;
}

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

void func(){

	Point p,v;

	scanf("%lf %lf %lf %lf",&p.x,&p.y,&v.x,&v.y);

	double cos_value = dot(p,v)/(calc_len(p)*calc_len(v));

	double ans;
	if(fabs(cos_value+1.0) < EPS){
		ans = calc_len(p);
	}else if(fabs(cos_value-1.0) < EPS){
		ans = 2.0-calc_len(p);
	}else{
		ans = DBL_MAX;
	}

	if(ans <= DIST){
		printf("%.10lf\n",ans);
	}else{
		printf("impossible\n");
	}
}

int main(){

	while(true){
		scanf("%lf",&DIST);
		if(fabs(DIST) < EPS)break;

		func();
	}

	return 0;
}