#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <iostream>
#include <math.h>
#include <complex>
#include <vector>
#include <assert.h>
#include <queue>
#include <string>

#define abs ABS
using namespace std;
typedef long long ll;
typedef complex<double> Point;
static const double EPS = 1e-6;
static const double PI = acos(-1.0);

struct Line : public vector<Point> {
  Line(Point a, Point b) { push_back(a), push_back(b); }
};
struct Circle {
  Point p;
  double r;
  Circle() {;}
  Circle(Point p, double r) : p(p), r(r) {;}
};

inline double ABS(const Point &a) {
  return sqrt(a.real() * a.real() + a.imag() * a.imag());
}

#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, s, n) for (int i = (s); i < (int)(n); i++)
#define FOREQ(i, s, n) for (int i = (s); i <= (int)(n); i++)
#define DEC(i, s) for (int i = (s); i >= 0; i--)

#define SIZE(v) (int)((v).size())
#define MEMSET(v, h) memset((v), h, sizeof(v))
#define FIND(m, w) ((m).find(w) != (m).end())

inline double cross(const Point &a, const Point &b) {
  return imag(conj(a) * b);
}
inline double dot(const Point &a, const Point &b) {
  return real(conj(a) * b);
}
int ccw(Point a, Point b, Point c) {
  b -= a; c -= a;
  if (cross(b, c) > 0) { return 1; }
  if (cross(b, c) < 0) { return -1; }
  if (dot(b, c) < 0) { return 2; }
  if (norm(b) < norm(c)) { return -2; }
  return 0;
}
inline bool intersectLP(const Line &l, const Point &p) {
  return abs(cross(l[1] - p, l[0] - p)) < EPS;
}
inline bool intersectSP(const Line &s, const Point &p) {
  return abs(s[0] - p) + abs(s[1] - p) - abs(s[0] - s[1]) < EPS;
}
inline bool intersectCP(const Circle &c, const Point &p) {
  return abs(c.p - p) - c.r < EPS;
}
inline Point projection(const Line &l, const Point &p) {
  double t = dot(p - l[0], l[0] - l[1]) / norm(l[0] - l[1]);
  return l[0] + t * (l[0] - l[1]);
}
inline double distanceLP(const Line &l, const Point &p) {
  return abs(p - projection(l, p));
}
inline double distanceSP(const Line &s, const Point &p) {
  const Point r = projection(s, p);
  if (intersectSP(s, r)) { return abs(r - p); }
  return min(abs(s[0] - p), abs(s[1] - p));
}
//include inside
inline bool intersectSC(const Line &s, const Circle &c) {
  return distanceSP(s, c.p) <= c.r;
}
Point crosspointSC(const Line &s, const Circle &c) {
  double d = distanceLP(s, c.p);
  Point vect = (s[1] - s[0]);
  vect /= abs(vect);
  if (d <= EPS) {
    return s[0] + vect * (c.r + abs(s[0] - c.p));
  }
  Point center1 = c.p + vect * Point(0, 1) * d;
  Point center2 = c.p - vect * Point(0, 1) * d;
  //cout << d << endl;
  //cout << vect << endl;
  //cout << center1 << " " << center2 << endl;
  if (intersectLP(s, center1)) {
    return center1 - vect * sqrt(c.r*c.r - d*d);
  }
  return center2 - vect * sqrt(c.r*c.r - d*d);
}

Point nvect(Point pp, Point np, Point vect) {
  double a = abs(pp);
  double b = abs(np);
  double c = abs(pp - np);
  double theta = (b * b + c * c - a * a) / (2 * b * c) * 2;
  if (b == 0 || c == 0) {
    theta = PI;
  } else if (ccw(Point(0, 0), np, np) > 0) {
    theta *= -1.0;
  }
  return vect * Point(cos(theta), sin(theta));
}

double d;
double px, py, vx, vy;

int main() {
  while (scanf("%lf", &d), d > EPS) {
    scanf("%lf %lf %lf %lf", &px, &py, &vx, &vy);
    Point pp(px, py);
    Point vect = Point(vx, vy);
    vect *= (1.0 / abs(vect));
    double dist = 0;
    if (intersectLP(Line(pp, pp + vect), Point(0, 0))) {
      if (intersectSP(Line(pp, pp + vect * 10.0), Point(0, 0))) {
        dist = abs(pp);
      } else {
        dist = 1 + (1 - abs(pp));
      }
      if (dist <= d - EPS) {
        printf("%.8lf\n", dist);
        goto next;
      }
    }
    puts("impossible");
next:;
  }
}

Measured memory_bytes: 0