#include<stdio.h>
#include<stdlib.h>
struct Pointer
{
int num;
struct Pointer *next;
};
typedef struct Pointer Node;
void Move(int i,int a[][1005],int x,int y,Node *head,int n);
void Moveleft(int i,int a[][1005],int x,int y,Node *head,int n);
void Moveright(int i,int a[][1005],int x,int y,Node *head,int n);
void Moveup(int i,int a[][1005],int x,int y,Node *head,int n);
void Movedown(int i,int a[][1005],int x,int y,Node *head,int n);
void Moveleft(int i,int a[][1005],int x,int y,Node *head,int n)
{
Node *node;
x--;
a[x][y]=1;
i++;
if(x-1>=0)
{
if(a[x-1][y]==2)
{
i++;
node=(Node *)malloc(sizeof(Node));
head->num=i;
node->next=head->next;
head->next=node;
}
else if(a[x-1][y]==0)
{
Moveleft(i,a,x,y,head,n);
}
}
if(y-1>=0)
{
if(a[x][y-1]==2)
{
i++;
node=(Node *)malloc(sizeof(Node));
node->num=i;
node->next=head->next;
head->next=node;
}
else if(a[x][y-1]==0)
{
Movedown(i,a,x,y,head,n);
}
}
if(y+1<n)
{
if(a[x][y+1]==2)
{
i++;
node=(Node *)malloc(sizeof(Node));
node->num=i;
node->next=head->next;
head->next=node;
}
else if(a[x][y+1]==0)
{
Moveup(i,a,x,y,head,n);
}
}
}
void Moveright(int i,int a[][1005],int x,int y,Node *head,int n)
{
Node *node;
x++;
a[x][y]=1;
i++;
if(x+1<n)
{
if(a[x+1][y]==2)
{
i++;
node=(Node *)malloc(sizeof(Node));
node->num=i;
node->next=head->next;
head->next=node;
}
else if(a[x+1][y]==0)
{
Moveright(i,a,x,y,head,n);
}
}
if(y-1>=0)
{
if(a[x][y-1]==2)
{
i++;
node=(Node *)malloc(sizeof(Node));
node->num=i;
node->next=head->next;
head->next=node;
}
else if(a[x][y-1]==0)
{
Movedown(i,a,x,y,head,n);
}
}
if(y+1<n)
{
if(a[x][y+1]==2)
{
i++;
node=(Node *)malloc(sizeof(Node));
node->num=i;
node->next=head->next;
head->next=node;
}
else if(a[x][y+1]==0)
{
Moveup(i,a,x,y,head,n);
}
}
}
void Moveup(int i,int a[][1005],int x,int y,Node *head,int n)
{
Node *node;
y++;
a[x][y]=1;
i++;
if(y+1<n)
{
if(a[x][y+1]==2)
{
i++;
node=(Node *)malloc(sizeof(Node));
node->num=i;
node->next=head->next;
head->next=node;
}
else if(a[x][y+1]==0)
{
Moveup(i,a,x,y,head,n);
}
}
if(x-1>=0)
{
if(a[x-1][y]==2)
{
i++;
node=(Node *)malloc(sizeof(Node));
node->num=i;
node->next=head->next;
head->next=node;
}
else if(a[x-1][y]==0)
{
Moveleft(i,a,x,y,head,n);
}
}
if(x+1<n)
{
if(a[x+1][y]==2)
{
i++;
node=(Node *)malloc(sizeof(Node));
node->num=i;
node->next=head->next;
head->next=node;
}
else if(a[x+1][y]==0)
{
Moveright(i,a,x,y,head,n);
}
}
}
void Movedown(int i,int a[][1005],int x,int y,Node *head,int n)
{
Node *node;
y--;
a[x][y]=1;
i++;
if(y-1>=0)
{
if(a[x][y-1]==2)
{
i++;
node=(Node *)malloc(sizeof(Node));
node->num=i;
node->next=head->next;
head->next=node;
}
else if(a[x][y-1]==0)
{
Movedown(i,a,x,y,head,n);
}
}
if(x-1>=0)
{
if(a[x-1][y]==2)
{
i++;
node=(Node *)malloc(sizeof(Node));
node->num=i;
node->next=head->next;
head->next=node;
}
else if(a[x-1][y]==0)
{
Moveleft(i,a,x,y,head,n);
}
}
if(x+1<n)
{
if(a[x+1][y]==2)
{
i++;
node=(Node *)malloc(sizeof(Node));
node->num=i;
node->next=head->next;
head->next=node;
}
else if(a[x+1][y]==0)
{
Moveright(i,a,x,y,head,n);
}
}
}
void Move(int i,int a[][1005],int x,int y,Node *head,int n)
{
Node *node;
if(x-1>=0)
{
if(a[x-1][y]==2)
{
i++;
node=(Node *)malloc(sizeof(Node));
node->num=i;
node->next=head->next;
head->next=node;
}
else if(a[x-1][y]==0)
{
Moveleft(i,a,x,y,head,n);
}
}
if(x+1<n)
{
if(a[x+1][y]==2)
{
i++;
node=(Node *)malloc(sizeof(Node));
node->num=i;
node->next=head->next;
head->next=node;
}
else if(a[x+1][y]==0)
{
Moveright(i,a,x,y,head,n);
}
}
if(y-1>=0)
{
if(a[x][y-1]==2)
{
i++;
node=(Node *)malloc(sizeof(Node));
node->num=i;
node->next=head->next;
head->next=node;
}
else if(a[x][y-1]==0)
{
Movedown(i,a,x,y,head,n);
}
}
if(y+1<n)
{
if(a[x][y+1]==2)
{
i++;
node=(Node *)malloc(sizeof(Node));
node->num=i;
node->next=head->next;
head->next=node;
}
else if(a[x][y+1]==0)
{
Moveup(i,a,x,y,head,n);
}
}
}
int main()
{
int n,m,k,d,i,j,minx,a[1005][1005]={0},x,y,food[1005],sum=0;
Node *head,*p;
fflush(stdin);
scanf("%d %d %d %d",&n,&m,&k,&d);
for(i=0;i<m;i++)
{
scanf("%d %d",&x,&y);
a[x][y]=2;
}
for(i=0;i<k;i++)
{
scanf("%d %d %d",&x,&y,&food[i]);
}
for(i=0;i<d;i++)
{
scanf("%d %d",&x,&y);
a[x][y]=100;
}
head=(Node *)malloc(sizeof(Node));
head->next=NULL;
head->num=0;
for(i=0;i<k;i++)
{
Move(0,a,x,y,head,n);
minx=head->next->num;
for(p=head->next->next;p->next!=NULL;p=p->next);
{
if(p->num<minx)
minx=p->num;
}
sum+=minx*food[i];
}
printf("%d\n",sum);
return 0;
}