#include<bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define HUGE_NUM 99999999999999999
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;


enum Type{
	LEFT,
	UNDER,
	RIGHT,
	TOP,
};

struct Point{
	Point(double arg_x,double arg_y){
		x = arg_x;
		y = arg_y;
	}

	Point(){
		x = y = 0.0;
	}

	Point operator + (Point p){ return Point(x+p.x,y+p.y); }
	Point operator - (Point p){ return Point(x-p.x,y-p.y);}
	Point operator * (double a){ return Point(a*x,a*y); }
	Point operator / (double a){ return Point(x/a,y/a); }

	double abs(){ return sqrt(norm()); }
	double norm(){ return x*x + y*y; }

	bool operator<(const Point &p) const{
		return x != p.x? x < p.x: y < p.y;
	}

	bool operator == (const Point &p) const{
		return fabs(x-p.x) < EPS && fabs(y-p.y) < EPS;
	}

	double x,y;
};

struct Line{
public:
	Point p[2];
	Line(Point p1,Point p2){
		p[0] = p1;
		p[1] = p2;
	}
	Line(){

	}
};

typedef Point Vector;

struct Sphere{
	Point center;
	double r;
};

typedef Sphere Circle;


int N;
double W,H,R,first_Vx,first_Vy,LIMIT = 10000;
Sphere info[11];
vector<Line> LINE; //左、下、右、上の辺を持つ
Point left_under,right_under,right_top,left_top;

int func(double x1,double y1,double x2, double y2, double xp, double yp){
	double naiseki,norm1,norm2,gaiseki;
	norm1 = sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1));
	norm2 = sqrt((xp-x1)*(xp-x1)+(yp-y1)*(yp-y1));
	naiseki = (xp-x1)*(x2-x1)+(yp-y1)*(y2-y1);
	gaiseki = (x2-x1)*(yp-y1)-(xp-x1)*(y2-y1);
	if(gaiseki > EPS){
		return 1;
	}else if(gaiseki < -EPS){
		return -1;
	}
	if(naiseki < -EPS){
		return 2;
	}

	if(norm1 < norm2){
		return -2;
	}
	return 0;
}

bool check_Cross(Line a,Line b){

	if(func(a.p[0].x,a.p[0].y,a.p[1].x,a.p[1].y,b.p[0].x,b.p[0].y)*
			func(a.p[0].x,a.p[0].y,a.p[1].x,a.p[1].y,b.p[1].x,b.p[1].y) <= 0 &&
			func(b.p[0].x,b.p[0].y,b.p[1].x,b.p[1].y,a.p[0].x,a.p[0].y)*
			func(b.p[0].x,b.p[0].y,b.p[1].x,b.p[1].y,a.p[1].x,a.p[1].y) <= 0){
		return true;
	}
	return false;
}

double norm(Vector a){
	return a.x*a.x+a.y*a.y;
}

double abs(Vector a){
	return sqrt(norm(a));
}

double abs(Line a){

	return sqrt((a.p[0].x-a.p[1].x)*(a.p[0].x-a.p[1].x)+(a.p[0].y-a.p[1].y)*(a.p[0].y-a.p[1].y));
}

double cross(Vector a,Vector b){
    return a.x*b.y-a.y*b.x;
}

double dot(Vector a,Vector b){
    return a.x*b.x + a.y*b.y;
}

//点と直線の距離
double calc_dist1(Line line,Point point){
    return abs(cross(line.p[1]-line.p[0],point-line.p[0]))/abs(line.p[1]-line.p[0]);
}

double calc_dist(Point A,Point B){

	return sqrt((A.x-B.x)*(A.x-B.x)+(A.y-B.y)*(A.y-B.y));
}

double calc_slope(Line A){

	if(fabs(A.p[0].x-A.p[1].x) < EPS){

		return DBL_MAX;

	}else if(fabs(A.p[0].y-A.p[1].y) < EPS){

		return 0;

	}else{

		return (A.p[0].y-A.p[1].y)/(A.p[0].x-A.p[1].x);
	}
}

Point calc_Cross_Point(double x1,double x2,double x3,double x4,double y1,double y2,double y3,double y4){
	Point ret;
	ret.x = ((x2-x1)*(y3*(x4-x3)+x3*(y3-y4))-(x4-x3)*(y1*(x2-x1)+x1*(y1-y2)))/((y2-y1)*(x4-x3)-(y4-y3)*(x2-x1));
	if(x1 != x2){
		ret.y = ((y2-y1)*ret.x+y1*(x2-x1)+x1*(y1-y2))/(x2-x1);
	}else{
		ret.y = ((y4-y3)*ret.x+y3*(x4-x3)+x3*(y3-y4))/(x4-x3);
	}
	return ret;
}

//インタフェース関数
Point calc_Cross_Point(Point a,Point b,Point c,Point d){
	return calc_Cross_Point(a.x,b.x,c.x,d.x,a.y,b.y,c.y,d.y);
}


Point calc_minus(Point a,Point b){
    Point ret;

    ret.x = a.x-b.x;
    ret.y = a.y-b.y;

    return ret;
}

double calc_len(Vector a){
    return sqrt(a.x*a.x+a.y*a.y);
}


double getDistanceLP(Line l,Point p){
    return fabs(cross(calc_minus(l.p[1],l.p[0]),calc_minus(p,l.p[0]))/calc_len(calc_minus(l.p[1],l.p[0])));
}

Point project(Line l,Point p){

	Vector base = l.p[1]-l.p[0];
	double r = dot(p-l.p[0],base)/norm(base);
	return l.p[0]+base*r;
}

vector<Point> getCrossPoints(Circle c,Line l){

	vector<Point> ret;

	Vector pr = project(l,c.center);
	Vector e = (l.p[1]-l.p[0])/abs(l.p[1]-l.p[0]);
	double base = sqrt(c.r*c.r-norm(pr-c.center));

	ret.push_back(Point(pr+e*base));
	ret.push_back(Point(pr-e*base));

	return ret;

}

//球Aが球Bに衝突するまでに移動する距離を返却する
double calc(Sphere move,Sphere stop){

	double sum_dist = 0,tmp_dist;
	double Vx = first_Vx,Vy = first_Vy,next_Vx,next_Vy;
	double ret = BIG_NUM;

	Point next;
	Type type;

	Line A;
	A.p[0] = move.center;
	A.p[1] = Point(move.center.x+10000*Vx,move.center.y+10000*Vy);

	//★★角に当たる場合に注意★★

	while(LIMIT-sum_dist > EPS){

		bool FLG = false;

		//相対位置を見る
		if(fabs(Vx) < EPS){ //上下に動く

			if(Vy > 0 && A.p[0].y < stop.center.y){

				FLG = true;

			}else if(Vy < 9 && A.p[0].y > stop.center.y){

				FLG = true;
			}

		}else if(fabs(Vy) < EPS){ //左右に動く

			if(Vx > 0 && A.p[0].x < stop.center.x){

				FLG = true;

			}else if(Vx < 0 && A.p[0].x > stop.center.x){

				FLG = true;
			}

		}else if(Vx > 0 && Vy > 0){ //右上に動く

			if(A.p[0].x < stop.center.x || A.p[0].y < stop.center.y){

				FLG = true;
			}

		}else if(Vx > 0 && Vy < 0){ //右下に動く

			if(A.p[0].x < stop.center.x || A.p[0].y > stop.center.y){

				FLG = true;
			}

		}else if(Vx < 0 && Vy > 0){ //左上に動く

			if(A.p[0].x > stop.center.x || A.p[0].y < stop.center.y){

				FLG = true;
			}

		}else if(Vx < 0 && Vy < 0){ //Vx < 0 && Vy < 0 //左下に動く

			if(A.p[0].x > stop.center.x || A.p[0].y > stop.center.y){

				FLG = true;
			}
		}

		if(FLG == true && getDistanceLP(A,stop.center)+EPS < 2*R){ //衝突が起こる可能性がある場合]

			vector<Point> TMP = getCrossPoints(stop,A);

			tmp_dist = min(calc_dist(A.p[0],TMP[0]),calc_dist(A.p[0],TMP[1]));

			if(sum_dist+tmp_dist+EPS < LIMIT){

				ret = sum_dist+tmp_dist;
			}

			break;
		}

		if(fabs(Vx) < EPS){ //上下に動く

			if(Vy > 0){

				type = TOP;

			}else{

				type = UNDER;
			}

			next_Vx = Vx;
			next_Vy = -Vy;


		}else if(fabs(Vy) < EPS){ //左右に動く

			if(Vx > 0){

				type = RIGHT;

			}else{

				type = LEFT;
			}

			next_Vx = -Vx;
			next_Vy = Vy;


		}else if(Vx > 0 && Vy > 0){ //右上に動く

			if(check_Cross(A,LINE[TOP])){

				type = TOP;
				next_Vx = Vx;
				next_Vy = -Vy;

			}else{

				type = RIGHT;
				next_Vx = -Vx;
				next_Vy = Vy;

			}

		}else if(Vx > 0 && Vy < 0){ //右下に動く

			if(check_Cross(A,LINE[RIGHT])){

				type =RIGHT;
				next_Vx = -Vx;
				next_Vy = Vy;

			}else{

				type = UNDER;
				next_Vx = Vx;
				next_Vy = -Vy;
			}

		}else if(Vx < 0 && Vy > 0){ //左上に動く

			if(check_Cross(A,LINE[TOP])){

				type = TOP;
				next_Vx = Vx;
				next_Vy = -Vy;

			}else{

				type = LEFT;
				next_Vx = -Vx;
				next_Vy = Vy;
			}

		}else if(Vx < 0 && Vy < 0){ //Vx < 0 && Vy < 0 //左下に動く

			if(check_Cross(A,LINE[LEFT])){

				type = LEFT;
				next_Vx = -Vx;
				next_Vy = Vy;

			}else{

				type = UNDER;
				next_Vx = Vx;
				next_Vy = -Vy;
			}
		}

		next = calc_Cross_Point(A.p[0],A.p[1],LINE[type].p[0],LINE[type].p[1]);

		//★★隅でないかチェック★★
		if(next == left_under || next == right_under || next == right_top || next == left_top){

			Vx *= -1;
			Vy *= -1;

		}else{

			Vx = next_Vx;
			Vy = next_Vy;
		}

		sum_dist += calc_dist(A.p[0],next);

		A.p[0] = next;
		A.p[1] = Point(A.p[0].x+10000*Vx,A.p[0].y+10000*Vy);
	}

	return ret;
}

void solve(){

	LINE.clear();

	scanf("%lf %lf %lf %lf %lf",&W,&H,&R,&first_Vx,&first_Vy);

	for(int i = 0; i < N; i++){

		scanf("%lf %lf",&info[i].center.x,&info[i].center.y);
		info[i].r = 2*R; //★★注意★★
	}

	//球の中心の座標で考える
	W -= 2*R;
	H -= 2*R;

	for(int i = 0; i < N; i++){

		info[i].center.x -= R;
		info[i].center.y -= R;
	}

	left_under = Point(0,0);
	right_under = Point(W,0);
	right_top = Point(W,H);
	left_top = Point(0,H);

	LINE.push_back(Line(left_top,left_under)); //左
	LINE.push_back(Line(left_under,right_under)); //下
	LINE.push_back(Line(right_under,right_top)); //右
	LINE.push_back(Line(right_top,left_top)); //上

	double minimum = LIMIT+1;
	int min_index = -1;

	for(int i = 1; i <= N-1; i++){

		double ret = calc(info[0],info[i]);

		if(ret+EPS < minimum){
			minimum = ret;
			min_index = i+1;
		}
	}

	printf("%d\n",min_index);
}

int main(){

	while(true){

		scanf("%d",&N);
		if(N == 0)break;

		solve();
	}

	return 0;
}



Measured memory_bytes: 3260