#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<cassert>
using namespace std;

typedef long long ll;

typedef unsigned long long ul;
typedef unsigned int ui;
const ll mod = 998244353;
typedef long double ld;
typedef complex<ld> Point;
const ll INF = mod * mod;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
const ld eps = 1e-9;
const ld pi = acos(-1.0);
typedef pair<ld, ld> LDP;
typedef pair<ll, ll> LP;
typedef vector<int> vec;
typedef vector<string> svec;

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

class Line {
public:
	Point a, b;
};
class Circle {
public:
	Point p; ld r;
};

ld dot(Point a, Point b) {
	return real(conj(a)*b);
}
ld cross(Point a, Point b) {
	return imag(conj(a)*b);
}
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);
}
ld dist_lp(Line l, Point p) {
	return abs(p - proj(l, p));
}

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の順に一直線
}

vector<Point> is_lc(Circle c, Line l) {
	vector<Point> res;
	ld d = dist_lp(l, c.p);
	if (d > c.r + eps)return res;
	ld len = (d > c.r) ? 0.0 : sqrt(c.r*c.r - d * d);
	Point nor = (l.a - l.b) / abs(l.a - l.b);
	res.push_back(proj(l, c.p) + len * nor);
	res.push_back(proj(l, c.p) - len * nor);
	return res;
}

vector<Point> is_sc(Circle c, Line s) {
	vector<Point> res, cop; cop = is_lc(c, s);
	int len = cop.size();
	rep(k, len) {
		if (ccw(s.a, cop[k], s.b) == -2) {
			res.push_back(cop[k]);
		}
	}
	return res;
}

int n;

void solve() {
	int w, h; ld r,vx, vy;
	cin >> h >> w >> r >> vx >> vy;
	vector<Point> v(n);
	vector<Circle> c(n);
	rep(i, n) {
		ld a, b; cin >> a >> b;
		v[i] = { a,b };
		c[i] = { v[i],2 * r };
	}
	Point cur = v[0];
	ld dist = 0;
	while (dist<10000) {
		ld x = real(cur), y = imag(cur);
		//cout << x << " " << y << " "<<vx<<" "<<vy<<endl;
		ld t = mod;
		if (vx > 0) {
			ld dif = h - r - x;
			t = min(t, dif / vx);
		}
		else if(vx<0){
			ld dif = x - r;
			t = min(t, dif / -vx);
		}
		if (vy > 0) {
			ld dif = w - r - y;
			t = min(t, dif / vy);
		}
		else if(vy<0){
			ld dif = y - r;
			t = min(t, dif / -vy);
		}
		{
			ld d = sqrt(vx*vx + vy * vy);
			ld dif = 10000 - dist;
			t = min(t, dif / d);
		}
		ld nx = x + t * vx; ld ny = y + t * vy;
		Point np = { nx,ny };
		Line l = { cur,np };
		vector<pair<ld, int>> cc;
		rep1(i, n - 1) {
			vector<Point> cen = is_sc(c[i], l);
			rep(j, cen.size()) {
				ld u;
				if (vx > 0) {
					u = (real(cen[j]) - x) / vx;
				}
				else {
					u = (imag(cen[j]) - y) / vy;
				}
				cc.push_back({ u,i });
			}
		}
		sort(cc.begin(), cc.end());
		if (!cc.empty()) {
			//cout << "ans is ";
			cout << cc[0].second + 1 << endl; return;
		}
		dist += abs(np - cur);
		cur=np;
		if (eq(nx, r)) {
			vx = -vx;
		}
		if (eq(nx, h - r)) {
			vx = -vx;
		}
		if (eq(ny, r)) {
			vy = -vy;
		}
		if (eq(ny, w - r)) {
			vy = -vy;
		}
	}
	//cout << "ans is ";
	cout << -1 << endl;
}

signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	//cout << fixed << setprecision(9);
	//init();
	while (cin >> n, n) {
		solve();
	}
	//solve();
	//stop
	return 0;
}



Measured memory_bytes: 3276