#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <complex>
#include <cstring>
#include <cstdlib>
#include <string>
#include <cmath>
#include <cassert>
#include <queue>
#include <set>
#include <map>
#include <valarray>
#include <bitset>
#include <stack>
#include <iomanip>
#include <fstream>
using namespace std;
 
#define REP(i,n) for(int i=0;i<(int)(n);++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
#define chmax(a,b) (a<b?(a=b,1):0)
#define chmin(a,b) (a>b?(a=b,1):0)
#define valid(y,x,h,w) (0<=y&&y<h&&0<=x&&x<w)
const int INF = 1<<29;
const double EPS = 1e-10;
const double PI = acos(-1);
typedef long long ll;
typedef pair<int,int> pii;
 
double sq(double a, double b) {
  return a*a+b*b;
}
double dot(double x1, double y1, double x2, double y2) {
  return x1*x2+y1*y2;
}
 
double x[20];
double y[20];
 
int main() {
  int n;
  while(cin >> n, n) {
    double w,h,r,vx,vy;
    cin >> w >> h >> r >> vx >> vy;
    REP(i,n) {
      cin >> x[i] >> y[i];
      x[i]-=r;
      y[i]-=r;
    }
    w -= 2*r;
    h -= 2*r;
    double len = 0;
    double cx = x[0];
    double cy = y[0];
    double dd = hypot(vx,vy);
    vx /= dd;
    vy /= dd;
    int ans = -2;
    while(len<10000) {
      double anst = 1e100;
      int ansID;
      for (int i=1; i<n; ++i) {
        double A = sq(vx,vy);
        double B = 2*dot(vx,vy,cx-x[i],cy-y[i]);
        double C = sq(cx-x[i],cy-y[i]) - 4*r*r;
        double D = B*B-4*A*C;
        if (D>=0) {
          double ts[2] = {(-B+sqrt(D))/2/A, (-B-sqrt(D))/2/A};
          REP(j,2) {
            double t = ts[j];
            if (t >= 0 && len+t<=10000) {
              if (chmin(anst, t)) {
                ansID = i;
              }
            }
          }
        }
      }
      if (anst < 1e90) {
        ans = ansID;
        break;
      }
      double nt = INF;
      // top
      if (vy) {
        double t = (h-cy) / vy;
        if (t>EPS) chmin(nt, t);
      }
      // bottom
      if (vy) {
        double t = (-cy) / vy;
        if (t>EPS) chmin(nt, t);
      }
      // right
      if (vx) {
        double t = (w-cx) / vx;
        if (t>EPS) chmin(nt, t);
      }      
      // left
      if (vx) {
        double t = (-cx) / vx;
        if (t>EPS) chmin(nt, t);
      }
      cx += vx*nt;
      cy += vy*nt;
      if (cx < EPS || cx > w-EPS) vx = -vx;
      if (cy < EPS || cy > h-EPS) vy = -vy;
      len += nt;
    }
    cout << ans+1 << endl;
  }
}