//#pragma comment(linker, "/STACK:16777216")
#include<iostream>
#include<cstdio>
//#include<cmath>
#include<algorithm>
#include<vector> 
#include<cstring>
#include<string>
//#include<queue>
#define mp make_pair
#define scn second
#define frs first
#define pb push_back
#define NAME "basket"
#define fop freopen(NAME ".in", "r", stdin); freopen(NAME ".out", "w", stdout); 
using namespace std;
const unsigned long long P=239017, MaxN=2100000, INF=100000000;
typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pi;
const double eps = 0.00000001;

int n, m, l, r, xn[10100], yn[10010], xp[100100], yp[100100], z[100100], p[100100];
int sz[1000100];

ll len(int x1, int y1, int x2, int y2) {
	return (x2 - x1)*(x2 - x1) + (y2 - y1)*(y2 - y1);
}
                                                   
bool cmp(int a, int b) {
	if (p[a] * (len(xn[b], yn[b], 0, 0) * (ll)(1 + sz[b])) == p[b] * (len(xn[a], yn[a], 0, 0) * (ll)(1 + sz[a]))) 
		return a < b;
	return p[a] * (len(xn[b], yn[b], 0, 0) * (ll)(1 + sz[b])) > p[b] * (len(xn[a], yn[a], 0, 0) * (ll)(1 + sz[a]));
                                                              		
}

int a[100000];

int main(){
	fop;
	scanf("%d%d%d%d", &n, &m, &r, &l);
	for (int i = 0; i < n; ++i)	
		scanf("%d%d", &xn[i], &yn[i]), p[i] = len(xn[i], yn[i], 0, 0) > r * r ? 3 : 2;
	for (int i = 0; i < m; ++i)	
		scanf("%d%d%d", &xp[i], &yp[i], &z[i]);

	for (int j = 0; j < n; ++j) {
		for (int i = 0; i < m; ++i) {
			if (len(xn[j], yn[j], xp[i], yp[i]) <= l * l)
				sz[j] += z[i];
		}
	}
	for (int i = 0; i < n; ++i)
		a[i] = i;
	sort(a, a + n, cmp);
	for (int i = 0; i < n; ++i)
		printf("%d ", a[i] + 1);
		
	return 0;
}