import std.stdio;
import std.ascii;
import std.range;
import std.array;
import std.functional;
import std.algorithm;
import std.conv;
import std.container;
import std.math;
import std.numeric;
import std.string;
import std.c.string;
import std.random;
import std.regex;
import std.typecons;

struct Point {
    double x, y;
    Point opBinary(alias op)(in Point p) {
        if (op == "+") return Point(x + p.x, y + p.y);
        if (op == "-") return Point(x - p.x, y - p.y);
    }
    Point opBinary(alias op)(double k) {
        if (op == "*") return Point(x * k, y * k);
    }
}
double dot(in Point a, in Point b) {
    return a.x * b.x + a.y * b.y;
}
double cross(in Point a, in Point b) {
    return a.x * b.y - a.y * b.x;
}
double norm(in Point p) {
    return sqrt(p.x * p.x + p.y * p.y);
}

const EPS = 1e-8;

bool EQ(double a, double b) {
    return abs(a - b) < EPS;
}

double D;
Point P, V;

bool input() {
    scanf("%lf\n", &D);
    if (D == 0) return false;
    double x, y;
    scanf("%lf %lf", &x, &y);
    P = Point(x, y);
    scanf("%lf %lf", &x, &y);
    V = Point(x, y);
    return true;
}

void solve() {
    if (EQ(P.dot(V), -P.norm * V.norm)) {
        double ans = norm(P);
        if (ans >= D) {
            writeln("impossible");
        } else {
            writefln("%.8f", ans);
        }
    } else if (EQ(P.dot(V), P.norm * V.norm)) {
        double ans = 2.0 - norm(P);
        if (ans >= D) {
            writeln("impossible");
        } else {
            writefln("%.8f", ans);
        }
    } else {
        writeln("impossible");
    }
}

void main() {
    while (input) solve;
}