#include <iostream>
#include <queue>
#include <cstring>
using namespace std;
const int N = 1010;
typedef pair<int, int> pii;
bool graph[N][N];
int dis[N][N];
struct node{
int x, y, w;
}tg[N * N];
queue<pii> qu;
int dx[] = {-1, 0, 1, 0};
int dy[] = {0, 1, 0, -1};
int n, m, k, d;
void bfs(){
while(!qu.empty()){
pii now = qu.front();
qu.pop();
for(int i = 0; i < 4; i ++ ){
int xx = now.first + dx[i];
int yy = now.second + dy[i];
if(xx <= 0 || xx > n || yy <= 0 || yy > n) continue;
if(graph[xx][yy]) continue;
if(dis[xx][yy] > dis[now.first][now.second] + 1){
dis[xx][yy] = dis[now.first][now.second] + 1;
qu.push({xx, yy});
}
}
}
}
int main(){
cin >> n >> m >> k >> d;
memset(dis, 0x3f, sizeof dis);
while(m -- ){
int x, y; scanf("%d%d", &x, &y);
qu.push({x, y});
dis[x][y] = 0;
}
for(int i = 0; i < k; i ++) scanf("%d%d%d", &tg[i].x, &tg[i].y, &tg[i].w);
while(d -- ){
int x, y; scanf("%d%d", &x, &y);
graph[x][y] = true;
}
bfs();
long long res = 0;
for(int i = 0; i < k; i ++ ) res += dis[tg[i].x][tg[i].y] * tg[i].w;
cout << res << endl;
return 0;
}