#include <iostream>
#include <cmath>
using namespace std;

const string impossible = "impossible";

double get_dot( double x1, double y1, double x2, double y2 ) {
    return x1 * x2 + y1 * y2;
}

double get_abs( double x, double y ) {
    return sqrt( x * x + y * y );
}

bool check( double a, double b ) {
    return a < b || fabs( a - b ) < 1e-9;
}

int main() {
    double D;
    while ( cin >> D ) {
        if ( D < 1e-9 ) break;
        double px, py, vx, vy;
        cin >> px >> py >> vx >> vy;
        double a = get_dot( -px, -py, vx, vy ) / get_abs( px, py ) / get_abs( vx, vy );
        if ( get_abs( px, py ) > 1.0 ) {
            cout << impossible << endl;
        } else if ( fabs( a - (1.0) ) < 1e-9 ) {
            if ( check( get_abs( px, py ), D ) )
                cout << get_abs( px, py ) << endl;
            else 
                cout << impossible << endl;
        } else if ( fabs( a - (-1.0) ) < 1e-9 ) {
            if ( check( 2.0 - get_abs( px, py ), D ) )
                cout << 2.0 - get_abs( px, py ) << endl;
            else 
                cout << impossible << endl;
        } else {
            cout << impossible << endl;
        }
    }
    return 0;
}