var
i, j, z, len: longint;
d: double;
n, m, k: longint;
agent: array of longint;
b1, b2: array of double;
edge_u, edge_v, edge_count: array of longint;
edge_cap, edge_util: array of double;
t, v, c_dest: longint;
c_path, dest: array of longint;
amount: array of double;
path: array of array of array of longint;
begin
read(n, m, k);
setlength(agent, k);
setlength(b1, k);
setlength(b2, k);
for i:=0 to k-1 do
begin
read(agent[i], b1[i], b2[i]);
end;
setlength(edge_u, m);
setlength(edge_v, m);
setlength(edge_count, m);
setlength(edge_cap, m);
setlength(edge_util, m);
for i:=0 to m-1 do
begin
read(edge_u[i], edge_v[i], edge_cap[i], edge_util[i], edge_count[i]);
end;
read(t, v, c_dest);
setlength(c_path, c_dest);
setlength(dest, c_dest);
setlength(amount, c_dest);
setlength(path, c_dest);
for i:=0 to c_dest-1 do
begin
read(dest[i], c_path[i], amount[i]);
setlength(path[i], c_path[i]);
for j:=0 to c_path[i]-1 do
begin
read(len);
setlength(path[i][j], len);
for z:=0 to len-1 do
begin
read(path[i][j][z]);
end;
end;
d := amount[i] / c_path[i];
for j:=0 to c_path[i]-1 do
begin
if j > 0 then
begin
write(' ');
end;
write(d:0:15);
end;
writeln;
end;
writeln('0 0');
end.