#include <iostream>
#include <algorithm>
#include <cmath>
#include <complex>
#include <vector>
using namespace std;
typedef long long lli;
typedef complex<lli> P;
typedef complex<double> Pd;

const lli INF = 1LL<<60LL;
const int MAXN = 12;
const double inf = 1e20;
const double eps = 1e-9;

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

int N;
lli W, H, R, Vx, Vy;
P Bs[MAXN];
vector<P> ps;
vector<int> indexs;

struct C {
  Pd o;
  double r;
};

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

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

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

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

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

vector<Pd> getCrossP(Pd s1, Pd s2, C c) {
  vector<Pd> v;
  Pd p = project(s1, s2, c.o);
  if(isIntersect(s1, s2, c) == 0) return v;
  if(isIntersect(s1, s2, c) == 1) {
    v.push_back(p);
  } else {
    double h = abs(p-c.o);
    double d = sqrt(c.r*c.r - h*h);
    Pd base = s2 - s1;
    v.push_back(p + d*base/abs(base));
    v.push_back(p - d*base/abs(base));
  }
  return v;
}

double getDist(P p) {
  Pd pd(p.real(), p.imag());
  Pd s1 = Pd(Bs[0].real(), Bs[0].imag());
  Pd s2 = s1 + Pd(Vx, Vy);
  Pd n1 = s1;
  Pd n2 = n1 + Pd(-Vy, Vx);
  vector<Pd> v = getCrossP(s1, s2, (C){pd, 2*R});
  double res = inf;
  if(v.size() == 2) {
    for(int i = 0; i < v.size(); ++i) {
      if(cross(n2 - n1, v[i] - n1) > 0.0) continue;
      res = min(res, abs(v[i] - n1));
    }
  }
  return res;
}

int main() {
  while(cin >> N && N) {
    cin >> W >> H >> R >> Vx >> Vy;
    W = W - 2*R;
    H = H - 2*R;
    for(int i = 0; i < N; ++i) {
      cin >> Bs[i].real() >> Bs[i].imag();
      Bs[i].real() -= R;
      Bs[i].imag() -= R;
    }
    ps.clear();
    indexs.clear();
    vector<P> ptmp;
    vector<int> itmp;
    for(int i = 1; i < N; ++i) {
      lli dx1 = Bs[i].real();
      lli dx2 = W - dx1;
      for(lli x = Bs[i].real(); labs(x) < 13000LL; ) {
        ptmp.push_back(P(x, Bs[i].imag()));
        itmp.push_back(i);
        x += 2 * dx2;
        ptmp.push_back(P(x, Bs[i].imag()));
        itmp.push_back(i);
        x += 2 * dx1;
      }
      for(lli x = Bs[i].real(); labs(x) < 13000LL; ) {
        ptmp.push_back(P(x, Bs[i].imag()));
        itmp.push_back(i);
        x -= 2 * dx1;
        ptmp.push_back(P(x, Bs[i].imag()));
        itmp.push_back(i);
        x -= 2 * dx2;
      }
    }
    Pd s1 = Pd(Bs[0].real(), Bs[0].imag());
    Pd s2 = s1 + Pd(Vx, Vy);
    for(int i = 0; i < ptmp.size(); ++i) {
      lli dy1 = ptmp[i].imag();
      lli dy2 = H - dy1;
      for(lli y = ptmp[i].imag(); labs(y) < 13000LL; ) {
        do {
          Pd p(ptmp[i].real(), y);
          if(getDistanceLP(s1, s2, p) > 3*R) break;
          ps.push_back(P(ptmp[i].real(), y));
          indexs.push_back(itmp[i]);
        } while(0);
        y += 2 * dy2;

        do {
          Pd p(ptmp[i].real(), y);
          if(getDistanceLP(s1, s2, p) > 3*R) break;
          ps.push_back(P(ptmp[i].real(), y));
          indexs.push_back(itmp[i]);
        } while(0);
        y += 2 * dy1;
      }
      for(lli y = ptmp[i].imag(); labs(y) < 13000LL; ) {
        do {
          Pd p(ptmp[i].real(), y);
          if(getDistanceLP(s1, s2, p) > 3*R) break;
          ps.push_back(P(ptmp[i].real(), y));
          indexs.push_back(itmp[i]);
        } while(0);
        y -= 2 * dy1;
        do {
          Pd p(ptmp[i].real(), y);
          if(getDistanceLP(s1, s2, p) > 3*R) break;
          ps.push_back(P(ptmp[i].real(), y));
          indexs.push_back(itmp[i]);
        } while(0);
        y -= 2 * dy2;
      }
    }

    double mini = inf;
    int res = -1;
    for(int i = 0; i < ps.size(); ++i) {
      double dist = getDist(ps[i]);
      if(dist < mini) {
        mini = dist;
        res = indexs[i]+1;
      }
    }
    if(mini >= 10000) res = -1;
    cout << res << endl;
  }
  return 0;
}

Measured memory_bytes: 1540