program hh;
var
n,k,q,i,m,l,j,z:longint;
a,b:array[1..200000]of integer;
procedure inti;
begin
assign(input,'coffee.in'); assign(output,'coffee.out');
reset(input);rewrite(output);
end;
procedure rr;
begin
read(n,k,q);
for i:=1 to n do read(a[m],a[l]);
for i:=1 to q do read(b[j],b[z]);
end;
begin
inti;
rr;
while (a[m]<b[j])and(a[l]>b[z]) do write(b[z]-b[j]);
while (a[m]<b[j])and(a[l]<b[z]) do write(a[l]-b[j]);
while a[m]>b[z] do write(0);
close(input);close(output);
end.