#include <bits/stdc++.h>
using namespace std;

typedef complex<double> P;


const double eps = 1e-10;
const double inf = 1e10;

bool equals(double a, double b) {
  return abs(a-b) < eps;
}

bool equals(P a, P b) {
  return equals(a.real(), b.real()) && equals(a.imag(), b.imag());
}

struct C {
  P p;
  double r;
  C() {}
  C(P p, double r) : p(p), r(r) {}
};

double dot(P a, P b) {
  return a.real()*b.real() + a.imag()*b.imag();
}

double cross(P a, P b) {
  return a.real()*b.imag() - a.imag()*b.real();
}

P project(P s1, P s2, P p) {
  P base = s2 - s1;
  double t = dot(p - s1, base)/norm(base);
  return s1 + base*t;
}

P reflect(P s1, P s2, P p) { return p + (project(s1, s2, p) - p)*2.0; }

int ccw(P p, P a, P b) {
  a -= p;
  b -= p;
  if(cross(a,b) > eps) return 1;
  if(cross(a,b) < -eps) return -1;
  if(dot(a,b) < -eps) return 2;
  if(norm(b)-norm(a) > eps) return -2;
  return 0;
}

bool isIntersect(P a1, P a2, P b1, P b2) {
  return ( ccw(a1,a2,b1) * ccw(a1,a2,b2) <= 0 &&
           ccw(b1,b2,a1) * ccw(b1,b2,a2) <= 0 );
}

P getCrossP(P a1, P a2, P b1, P b2) {
  P a = a2 - a1;
  P b = b2 - b1;
  return a1 + a * cross(b, b1 - a1)/cross(b, a);
}

double getDistanceLP(P s1, P s2, P p) {
  return abs(cross(s2 - s1, p - s1)/abs(s2 - s1));
}

int isIntersect(P s1, P s2, C c) {
  double d = getDistanceLP(s1, s2, c.p);
  if(equals(d, c.r)) return 1;
  else if(d < c.r) return 2;
  else return 0;
}

vector<P> getCrossPLC(P s1, P s2, C c) {
  vector<P> v;
  P p = project(s1, s2, c.p);
  int ii = isIntersect(s1, s2, c);
  if(ii == 1) {
    v.push_back(p);
  } else if(ii == 2) {
    double h = abs(p - c.p);
    double d = sqrt(c.r*c.r - h*h);
    P base = s2 - s1;
    v.push_back(p - d*base/abs(base));
    v.push_back(p + d*base/abs(base));
  }
  return v;
}

//-------------------------------------------------------

const double MAXD = 10000.0;

double getT(P p, P v, P s1, P s2) {
  if(equals(cross(v,s2-s1), 0.0)) return inf;
  P q = getCrossP(p, p+v, s1, s2);
  if(equals(p, q)) return inf;
  if(dot(v, q-p) < -eps) return inf;
  return abs(q-p);
}

double getT(P s1, P s2, P cp, double cr) {
  vector<P> ps = getCrossPLC(s1, s2, C(cp, cr));
  if(ps.empty()) return inf;
  if(ps.size() == 1) return inf;
  double res = inf;
  for(int i = 0; i < ps.size(); ++i) {
    if(ccw(s1, s2, ps[i]) != 0) continue;
    res = min(res, abs(ps[i]-s1));
  }
  return res;
}

int main() {
  int n;
  double w, h, r;
  P v;
  vector<P> ball;
  while(cin >> n && n) {
    cin >> w >> h >> r >> v.real() >> v.imag();
    w -= 2*r;
    h -= 2*r;
    v /= abs(v);
    ball.resize(n);
    for(int i = 0; i < n; ++i) {
      cin >> ball[i].real() >> ball[i].imag();
      ball[i].real() -= r;
      ball[i].imag() -= r;
    }
    r *= 2;

    int ans = -1;
    for(double dist = 0; dist+eps < MAXD; ) {
      vector<double> ts;
      ts.push_back(getT(ball[0], v, P(0,0), P(w,0)));
      ts.push_back(getT(ball[0], v, P(w,0), P(w,h)));
      ts.push_back(getT(ball[0], v, P(w,h), P(0,h)));
      ts.push_back(getT(ball[0], v, P(0,h), P(0,0)));
      double minT = *min_element(ts.begin(), ts.end());
      double D = min(MAXD - dist, minT);
      P prev = ball[0];
      ball[0] += v*D;
      dist += D;
      if(equals(ts[0], D)) v.imag() *= -1;
      if(equals(ts[1], D)) v.real() *= -1;
      if(equals(ts[2], D)) v.imag() *= -1;
      if(equals(ts[3], D)) v.real() *= -1;
      ts.clear();
      ts.push_back(inf);
      for(int i = 1; i < n; ++i) {
        ts.push_back(getT(prev, ball[0], ball[i], r));
      }
      minT = *min_element(ts.begin(), ts.end());
      if(minT != inf) {
        for(int i = 1; i < n; ++i) {
          if(ts[i] == minT) {
            ans = i+1;
            dist = inf;
            break;
          }
        }
      }
    }
    cout << ans << endl;
  }
  return 0;
}

Measured memory_bytes: 1272