#include <iostream>
#include <cstring>
#include <algorithm>
#include <queue>
using namespace std;
const int N = 1010;
typedef long long LL;
typedef pair<int, int> PII;
int n,m,k,d;
int dist[N][N];
bool g[N][N];
bool f[N][N]; //第一次搜到的
queue<PII> q;
struct tg{
int x,y,c;
}tg[N*N];
void bfs()
{
int dx[4] = {-1, 0, 1, 0}, dy[4] = {0, 1, 0, -1};
while(q.size())
{
auto t=q.front();
q.pop();
for(int i=0;i<4;i++)
{
int x=t.first+dx[i],y=t.second+dy[i];
if (x < 1 || x > n || y < 1 || y > n || g[x][y]||f[N][N]) continue;
if(dist[x][y]>dist[t.first][t.second]+1)
{
dist[x][y]=dist[t.first][t.second]+1;
q.push({x,y});
f[x][y]=true;
}
}
}
}
int main()
{
cin>>n>>m>>k>>d;
memset(dist,0x3f,sizeof dist);
while(m--)
{
int x1,y1;
scanf("%d%d",&x1,&y1);
dist[x1][y1]=0;
q.push({x1,y1});
}
for(int i=0;i<k;i++)
{
int x,y,z;
scanf("%d%d%d",&x,&y,&z);
tg[i]={x,y,z};
}
while(d--)
{
int x1,y1;
scanf("%d%d",&x1,&y1);
g[x1][y1]=true;
}
bfs();
LL res=0;
for(int i=0;i<k;i++)
{
res+=dist[tg[i].x ][tg[i].y]*tg[i].c;
}
cout<<res;
return 0;
}