n, m, k = [int(x) for x in input().strip().split()]
agent = [0] * k
b1 = [0] * k
b2 = [0] * k
for i in range(k):
agent_input = input().strip().split()
agent[i] = int(agent_input[0])
b1[i] = float(agent_input[1])
b2[i] = float(agent_input[2])
edge_u = [0] * m
edge_v = [0] * m
edge_cap = [0] * m
edge_util = [0] * m
edge_count = [0] * m
for i in range(m):
edge_input = input().strip().split()
edge_u[i] = int(edge_input[0])
edge_v[i] = int(edge_input[1])
edge_cap[i] = float(edge_input[2])
edge_util[i] = float(edge_input[3])
edge_count[i] = int(edge_input[4])
t, v, c_dest = [int(x) for x in input().strip().split()]
dest = [0] * c_dest
c_path = [0] * c_dest
amount = [0] * c_dest
path = [[]] * c_dest
for i in range(c_dest):
dest_input = input().strip().split()
dest[i] = int(dest_input[0])
c_path[i] = int(dest_input[1])
amount[i] = float(dest_input[2])
path[i] = [[]] * c_path[i]
for j in range(c_path[i]):
path[i][j] = [int(x) for x in input().strip().split()[1:]]
d = amount[i] / c_path[i]
for j in range(c_path[i]):
print ("%.15f " % d, end = '')
print()
print ('0 0')