#include <bits/stdc++.h>
using namespace std;
 
using ld = long double;
 
constexpr ld eps = 1e-8;
constexpr ld INF = 1e18;
 
 
int main() {
    int n;
    while(cin >> n, n) {
        ld w, h, r, vx, vy;
        cin >> w >> h >> r >> vx >> vy;
        ld now_x, now_y;
        cin >> now_x >> now_y;
        n = n - 1;
        vector<ld> x(n), y(n);
        for(int i = 0; i < n; ++i) {
            cin >> x[i] >> y[i];
        }
 
        int res = -1;
        ld total = 0;
        while(res == -1 && total < 10000) {
            ld tx = INF, ty = INF;
            if(vy != 0) {
                if(vy > 0) {
                    ty = (h - now_y - r) / vy;
                } else {
                    ty = (now_y - r) / -vy;
                }
            }
            if(vx != 0) {
                if(vx > 0) {
                    tx = (w - now_x - r) / vx;
                } else {
                    tx = (now_x - r) / -vx;
                }
            }
             
            ld t = min(ty, tx);
            ld a = vx * vx + vy * vy;
            for(int i = 0; i < n; ++i) {
                ld b = 2 * ((now_x - x[i]) * vx + (now_y - y[i]) * vy);
                ld c = pow(now_x - x[i], 2) + pow(now_y - y[i], 2) - 4 * r * r;
                ld D = b * b - 4 * a * c;
                if(D < 0) {
                    continue;
                }
                ld tt = (-b - sqrt(D)) / (2 * a);
                if(tt < 0) {
                    tt = (-b + sqrt(D)) / (2 * a);
                }
                if(tt >= 0 && tt < t) {
                    res = i + 2;
                    t = tt;
                }
            }
            now_x += vx * t;
            now_y += vy * t;
            total += hypot(vx, vy) * t;
            if(abs(ty - tx) < eps) {
                vy = -vy;
                vx = -vx;
            } else if(ty > tx) {
                vx = -vx;
            } else {
                vy = -vy;
            }
        }
        if(total > 10000 + eps) {
            res = -1;
        }
        cout << res << endl;
    }
}
