#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
using namespace std;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
using ll = long long;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;

using ld = long double;
using Point =  complex<ld>;
const ld eps = 1e-12;
const ld pi = acos(-1.0);

bool eq(ld a, ld b) {
	return (abs(a - b) < eps);
}

bool cmp(Point x,Point y){
	if(eq(x.real(),y.real()))return x.imag()<y.imag();
	return x.real()<y.real();
}

bool eqq(Point x,Point y){
	return eq(x.real(),y.real())&&eq(x.imag(),y.imag());
}
//内積
ld dot(Point a, Point b) {
	return real(conj(a)*b);
}
//外積
ld cross(Point a, Point b) {
	return imag(conj(a)*b);
}


//線分
//直線にするなら十分通い２点を端点とすればよい
class Line {
public:
	Point a, b;
};
//円
class Circle {
public:
	Point p;
	ld r;
};
//3点の位置関係
int ccw(Point a, Point b, Point c) {
	b -= a; c -= a;
	if (cross(b, c) > eps)return 1;//a,b,cが反時計回り
	if (cross(b, c) < -eps)return -1;//a,b,cが時計回り
	if (dot(b, c) < 0)return 2;//c,a,bの順に一直線
	if (norm(b) < norm(c))return -2;//a,b,cの順に一直線
	return 0;//a,c,bの順に一直線
}
//2直線の交差判定
bool isis_ll(Line l, Line m) {
	return !eq(cross(l.b - l.a, m.b - m.a), 0);
}
//直線と線分の交差判定
bool isis_ls(Line l, Line s) {
	return (cross(l.b - l.a, s.a - l.a)*cross(l.b - l.a, s.b - l.a) < eps);
}
//点が直線上に存在するか
bool isis_lp(Line l, Point p) {
	return (abs(cross(l.b - p, l.a - p)) < eps);
}
//点が線分上に存在するか
bool isis_sp(Line s, Point p) {
	return (abs(s.a - p) + abs(s.b - p) - abs(s.b - s.a) < eps);
}
//線分と線分の交差判定
bool isis_ss(Line s, Line t) {
	if (isis_sp(s, t.a) || isis_sp(s, t.b) || isis_sp(t, s.a) || isis_sp(t, s.b))return true;
	return(cross(s.b - s.a, t.a - s.a)*cross(s.b - s.a, t.b - s.a) < -eps && cross(t.b - t.a, s.a - t.a)*cross(t.b - t.a, s.b - t.a) < -eps);
}
//点から直線への垂線の足
Point proj(Line l, Point p) {
	ld t = dot(p - l.a, l.a - l.b) / norm(l.a - l.b);
	return l.a + t * (l.a - l.b);
}

Point cont(Line l, Point p){
	return (ld)2.0*proj(l,p) - p;
}
//直線と直線の交点
//平行な２直線に対しては使うな！！！！
Point is_ll(Line s, Line t) {
	Point sv = s.b - s.a; Point tv = t.b - t.a;
	return s.a + sv * cross(tv, t.a - s.a) / cross(tv, sv);
}
//直線と点の距離
ld dist_lp(Line l, Point p) {
	return abs(p - proj(l, p));
}
//直線と直線の距離
ld dist_ll(Line l, Line m) {
	return isis_ll(l, m) ? 0 : dist_lp(l, m.a);
}
//線分と直線の距離
ld dist_ls(Line l, Line s) {
	return isis_ls(l, s) ? 0 : min(dist_lp(l, s.a), dist_lp(l, s.b));
}
//線分と点の距離
ld dist_sp(Line s, Point p) {
	Point r = proj(s, p);
	return isis_sp(s, r) ? abs(p - r) : min(abs(p - s.a), abs(p - s.b));
}
//線分と線分の距離
ld dist_ss(Line s, Line t) {
	if (isis_ss(s, t))return 0;
	return min({ dist_sp(s,t.a),dist_sp(s,t.b),dist_sp(t,s.a),dist_sp(t,s.b) });
}

void solve(int n){
    ld w,h,r,vx,vy;
    cin>>w>>h>>r>>vx>>vy;
    Point v = Point(vx,vy);
    Point p;
    int x,y;
    cin>>x>>y;
    p=Point(x,y);
    --n;
    Point q[n];
    rep(i,n){
        cin>>x>>y;
        q[i] = Point(x,y);
    }
    ld dsum = 0;
    while(1){
        ld nxt=inf;
        Point cr;
        if(v.real()>eps){
            Point cx = is_ll({p,p+v},{Point(w-r,0),Point(w-r,h)});
            if(nxt>abs(cx-p)){
                nxt = abs(cx-p);
                cr = cx;
            }
        }
        if(v.real()<-eps){
            Point cx = is_ll({p,p+v},{Point(r,0),Point(r,h)});
            if(nxt>abs(cx-p)){
                nxt = abs(cx-p);
                cr = cx;
            }
        }
        if(v.imag()>eps){
            Point cx = is_ll({p,p+v},{Point(0,h-r),Point(w,h-r)});
            if(nxt>abs(cx-p)){
                nxt = abs(cx-p);
                cr = cx;
            }
        }
        if(v.imag()<-eps){
            Point cx = is_ll({p,p+v},{Point(0,r),Point(w,r)});
            if(nxt>abs(cx-p)){
                nxt = abs(cx-p);
                cr = cx;
            }
        }
        int ans = -1;
        ld t = inf;

        rep(i,n){
            if(dot(cr-p,q[i]-p)<-eps)continue;
            ld dist = dist_lp({p,cr},q[i]);
            if(dist<2*r+eps){
                Point pr = proj({p,cr},q[i]);
                Point nx = pr - (pr-p)/abs(pr-p)*sqrt(4*r*r-dist*dist);
                if(abs(abs(nx-p)+abs(cr-nx)-abs(cr-p))>eps)continue;
                if(t>abs(nx-p)){
                    ans = i+2;
                    t = abs(nx-p);
                }
            }
        }
        if(ans!=-1&&dsum + t <10000+eps){
            cout<<ans<<endl;
            return;
        }
        else {
            dsum += abs(cr-p);
            if(dsum>10000)break;
            ld nvx = v.real(), nvy=v.imag();
            if(abs(cr.real()-r)<eps||abs(cr.real()-w+r)<eps)nvx*=-1.0;
            if(abs(cr.imag()-r)<eps||abs(cr.imag()-h+r)<eps)nvy*=-1.0;
            v = Point(nvx,nvy);
            p = cr;
        }
    }
    cout<<-1<<endl;
}
int main(){
    int n;
    while(cin>>n,n!=0)solve(n);
    return 0;
}


Measured memory_bytes: 3116