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

int main(){

    double D,px,py,vx,vy,L;
    while(cin>>D,D!=0){
        cin>>px>>py>>vx>>vy;
        if(abs(atan2(py,px)-atan2(vy,vx))<1e-6||abs(abs(atan2(py,px)-atan2(vy,vx))-atan2(0,-1))<1e-6){
            if(px*vx<0||py*vy<0){
                L=hypot(px,py);
            }else{
                L=2-hypot(px,py);
            }
            if(D-L>1e-3){
                cout.precision(8);
                cout<<fixed<<L<<endl;
            }else{
                cout<<"impossible"<<endl;
            }
        }else{
            cout<<"impossible"<<endl;
        }
    }
    return 0;
}