open System
let nmk = Console.ReadLine().Split()
let n = int32(nmk.[0])
let m = int32(nmk.[1])
let k = int32(nmk.[2])
let agent = Array.create k 0
let b1 = Array.create k 0.0
let b2 = Array.create k 0.0
for i in 0..k-1 do
let agent_input = Console.ReadLine().Split()
agent.[i] <- int32(agent_input.[0])
b1.[i] <- float(agent_input.[1])
b2.[i] <- float(agent_input.[2])
let edge_u = Array.create m 0
let edge_v = Array.create m 0
let edge_cap = Array.create m 0.0
let edge_util = Array.create m 0.0
let edge_count = Array.create m 0
for i in 0..m-1 do
let edge_input = Console.ReadLine().Split()
edge_u.[i] <- int32(edge_input.[0])
edge_v.[i] <- int32(edge_input.[1])
edge_cap.[i] <- double(edge_input.[2])
edge_util.[i] <- double(edge_input.[3])
edge_count.[i] <- int32(edge_input.[4])
let tvc = Console.ReadLine().Split()
let t = int32(tvc.[0])
let v = int32(tvc.[1])
let c_dest = int32(tvc.[2])
let dest = Array.create c_dest 0
let c_path = Array.create c_dest 0
let amount = Array.create c_dest 0.0
let path = Array.create c_dest [||]
for i in 0..c_dest-1 do
let dest_input = Console.ReadLine().Split()
dest.[i] <- int32(dest_input.[0])
c_path.[i] <- int32(dest_input.[1])
amount.[i] <- double(dest_input.[2])
path.[i] <- Array.create c_path.[i] []
for j in 0..c_path.[i]-1 do
let line = Console.ReadLine().Split()
path.[i].[j] <- [ for t in line -> int(t)]
let d = amount.[i] / double(c_path.[i])
for j in 0..c_path.[i]-1 do
printf "%0.15f " d
printfn ""
printfn "0 0"