#include <bits/stdc++.h>

using namespace std;

#define int long long
#define all(v) (v).begin(), (v).end()
#define resz(v, ...) (v).clear(), (v).resize(__VA_ARGS__)
#define reps(i, m, n) for(int i = (int)(m); i < (int)(n); i++)
#define rep(i, n) reps(i, 0, n)

template<class T1, class T2> void chmin(T1 &a, T2 b){if(a>b)a=b;}
template<class T1, class T2> void chmax(T1 &a, T2 b){if(a<b)a=b;}

typedef pair<int, int> Pi;
typedef tuple<int, int, int> Ti;
typedef vector<int> vint;

const int inf = 1LL << 55;
const int mod = 1e9 + 7;

#define EPS (1e-10)
#define eq(a, b) (fabs((a)-(b)) < EPS)
#define lt(a, b) ((a) - (b) < -EPS)
#define le(a, b) (eq(a, b) || lt(a, b))

struct Point {
  double x, y;
  Point(double x = 0.0, double y = 0.0):x(x), y(y){}

  Point operator + (Point p) { return Point(x + p.x, y + p.y); }
  Point operator - (Point p) { return Point(x - p.x, y - p.y); }
  Point operator * (double a) { return Point(x * a, y * a); }
  Point operator / (double a) { return Point(x / a, y / a); }

  double abs() { return sqrt(norm()); }
  double norm() { return x*x + y*y; }

  bool operator < (const Point& p) const {
    return x != p.x ? x < p.x : y < p.y;
  }
  bool operator == (const Point& p) const {
    return fabs(x - p.x) < EPS && fabs(y - p.y) < EPS;
  }
};
typedef Point Vector;

double norm(Vector v) { return v.x*v.x + v.y*v.y; }
double abs(Vector v) { return sqrt(norm(v)); }
double dot(Vector a, Vector b) { return a.x*b.x + a.y*b.y; }
double cross(Vector a, Vector b) { return a.x*b.y - a.y*b.x; }

#define COUNTER_CLOCKWISE +1
#define CLOCKWISE         -1
#define ONLINE_BACK       +2
#define ONLINE_FRONT      -2
#define ON_SEGMENT        +0
int ccw(Point p0, Point p1, Point p2) {
  Vector a = p1 - p0;
  Vector b = p2 - p0;
  if(cross(a, b) > EPS) return COUNTER_CLOCKWISE;
  if(cross(a, b) < -EPS) return CLOCKWISE;
  if(dot(a, b) < -EPS) return ONLINE_BACK;
  if(a.norm() < b.norm()) return ONLINE_FRONT;
  return ON_SEGMENT;
}
bool intersect(Point p1, Point p2, Point p3, Point p4) {
  return (ccw(p1, p2, p3) * ccw(p1, p2, p4) <= 0 &&
	  ccw(p3, p4, p1) * ccw(p3, p4, p2) <= 0);
}

double getDistance(Point a, Point b) { return abs(a - b); }

struct Segment {
  Point s, t;
  Segment(Point s = Point(), Point t = Point()):s(s), t(t){}
};
typedef Segment Line;

Point project(Segment s, Point p) {
  Vector base = s.t - s.s;
  double r = dot(p - s.s, base) / norm(base);
  return s.s + base * r;
}

bool intersect(Segment s1, Segment s2) {
  return intersect(s1.s, s1.t, s2.s, s2.t);
}

double getDistanceLP(Line l, Point p) {
  return abs(cross(l.t - l.s, p - l.s) / abs(l.t - l.s));
}
double getDistanceSP(Segment s, Point p) {
  if(dot(s.t - s.s, p - s.s) < 0.0) return abs(p - s.s);
  if(dot(s.s - s.t, p - s.t) < 0.0) return abs(p - s.t);
  return getDistanceLP(s, p);
}

Point getCrossPoint(Segment s1, Segment s2) {
  Vector base = s2.t - s2.s;
  double d1 = abs(cross(base, s1.s - s2.s));
  double d2 = abs(cross(base, s1.t - s2.s));
  double t = d1 / (d1 + d2);
  return s1.s + (s1.t - s1.s) * t;
}

struct Circle {
  Point p;
  double r;
  Circle(Point p = Point(), double r = 0.0):p(p), r(r){}
};

bool intersect(Circle c1, Circle c2) {
  double d = getDistance(c1.p, c2.p);
  return le(d, c1.r+c2.r) && !lt(d, fabs(c1.r-c2.r));
}

vector<Point> getCrossPointsCL(Circle c, Line l) {
  vector<Point> res;
  Vector pr = project(l, c.p);
  if(lt(c.r, abs(c.p-pr))) return res;
  Vector e = (l.t-l.s)/abs(l.t-l.s);
  double base = sqrt(c.r*c.r-norm(pr-c.p));
  res.push_back(pr+e*base);
  if(!eq(base, 0)) res.push_back(pr-e*base);
  return res;
}

vector<Point> getCrossPointsCS(Circle c, Segment s) {
  vector<Point> res;
  vector<Point> pl = getCrossPointsCL(c, s);
  for(Point p : pl) {
    if(ccw(s.s, s.t, p) == ON_SEGMENT) res.push_back(p);
  }
  return res;
}

typedef vector<Point> Polygon;
#define IN_POLYGON  2
#define ON_POLYGON  1
#define OUT_POLYGON 0
int contains(Polygon g, Point p) {
  int n = g.size();
  bool x = false;
  for(int i = 0; i < n; i++) {
    Point a = g[i] - p, b = g[(i+1) % n] - p;
    if(abs(cross(a, b)) < EPS && dot(a, b) < EPS) return ON_POLYGON;
    if(a.y > b.y) swap(a, b);
    if(a.y < EPS && EPS < b.y && cross(a, b) > EPS) x = !x;
  }
  return (x ? IN_POLYGON : OUT_POLYGON);
}

int n, w, h, r;
Vector iv;
vector<Circle> ball;
Polygon corner;
vector<Segment> table;
bool ans = false;

struct Cross {
  Point p;
  double t;
  int idx;
  Cross(){}
  Cross(Point p, double t, int idx):p(p), t(t), idx(idx){}
  bool operator < (const Cross &crs) const {
    return lt(t, crs.t);
  }
};

void solve(Point p, Vector v, double rem) {
  //cout<<p.x<<" "<<p.y<<" "<<v.x<<" "<<v.y<<" "<<rem<<endl;
  if(le(rem, 0)) return;
  Vector e = v/abs(v);
  Segment traj = Segment(p, p+e*10000);
  vector<Cross> cross;
  rep(i, 4) {
    if(!intersect(traj, table[i])) continue;
    Point c = getCrossPoint(traj, table[i]);
    double dist = getDistance(p, c);
    //double tim = dist/abs(v);
    //if(le(tim, 0)) continue;
    if(le(dist, 0)) continue;
    //cross.emplace_back(c, tim, i);
    cross.emplace_back(c, dist, i);
  }
  assert(!cross.empty());
  sort(all(cross));
  //rep(i, cross.size()) cout<<cross[i].p.x<<" "<<cross[i].p.y<<endl;

  traj = Segment(p, cross[0].p);
  vector< pair<double, int> > colb;
  reps(i, 1, n) {
    double dist = getDistanceSP(traj, ball[i].p);
    if(!le(dist, ball[i].r)) continue;
    auto cp = getCrossPointsCS(ball[i], traj);
    for(auto q : cp) {
      if(contains(corner, q) == OUT_POLYGON) continue;
      double dist_p = getDistance(p, q);
      //colb.emplace_back(dist_p/abs(v), i);
      colb.emplace_back(dist_p, i);
    }
  }
  if(!colb.empty()) {
    sort(all(colb));
    if(le(colb[0].first, rem)) {
      ans = true;
      cout << colb[0].second+1 << endl;
    }
    return;
  }

  Vector nv = v;
  if(cross[0].idx == 0 || cross[0].idx == 2) nv.y = nv.y*(-1);
  if(cross[0].idx == 1 || cross[0].idx == 3) nv.x = nv.x*(-1);
  if((int)cross.size() > 1) {
    assert((int)cross.size() == 2);
    if(cross[1].idx == 0 || cross[1].idx == 2) nv.y = nv.y*(-1);
    if(cross[1].idx == 1 || cross[1].idx == 3) nv.x = nv.x*(-1);
  }
  //cout<<cross[0].p.x<<" "<<cross[0].p.y<<" "<<nv.x<<" "<<nv.y<<" "<<rem-cross[0].t<<endl;
  //exit(0);
  solve(cross[0].p, nv, rem-cross[0].t);
}

signed main()
{
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cout << fixed << setprecision(12);

  while(cin >> n, n) {
    cin >> w >> h >> r >> iv.x >> iv.y;
    resz(ball, n);
    rep(i, n) {
      cin >> ball[i].p.x >> ball[i].p.y;
      ball[i].r = 2*r;
    }
    resz(corner, 4);
    corner[0] = Point(0+r, 0+r); corner[1] = Point(w-r, 0+r);
    corner[2] = Point(w-r, h-r); corner[3] = Point(0+r, h-r);
    resz(table, 4);
    rep(i, 4) table[i] = Segment(corner[i], corner[(i+1)%4]);
    ans = false;
    solve(ball[0].p, iv, 10000);
    if(!ans) cout << -1 << endl;
  }

  return 0;
}

Measured memory_bytes: 3752