\begin{problem}{Bart is A Tycoon}{\textsl{standard input}}{\textsl{standard output}}{1 second}{512 Mebibytes}{}

Bart likes skateboarding and knows everything about it. He is going to become
a tycoon and to have a skateboard producing factory.

Yet Bart thinks about the following problem. Assume he got $M$ customers
and $C$ packs of skateboards. How to sell skateboards with maximum profit?

\InputFile

The first line of input contains four integers $N$, $S$, $C$ and $R$ ---
number of cities, number of the city where Bart's factory is placed,
number of packs of skateboards Bart got for sale and penalty for car accident
($1 \le N,~C \le 100$, $1 \le S \le N$, $0 \le R \le 10^4$).

The second line contains an integer $M$ --- number of customers
($1 \le M \le 100$).

Next $M$ lines consist of customer descriptions and contain three positive
integers $P_i$, $C_i$ and $M_i$ each, where $P_i$ is the customer city number
($1 \le P_i \le N$), $C_i$ is the maximal number of packs of skateboards that
customer could buy ($1 \le C_i \le 100$) and $M_i$ is the profit that Bart
gets from selling one pack to this customer ($1 \le M_i \le 10^4$).
A customer can buy any integer number of packs of skateboards between
$0$ and $C_i$, inclusive.

Next line consists of one integer $E$ --- the number of roads
($0 \le E \le 10^4$). All roads between cities are directed,
but car accidents are still possible.

Next $E$ lines consist of road descriptions. Each road is described by six
integers $V_1$, $V_2$, $U$, $F$, $P_1$ and $P_2$ --- numbers of beginning
and ending city on this road, maximum road capacity in trucks, fuel expenses
for one truck to pass this road and two special parameters, related to car
accident probability, respectively ($1 \le V_1, V_2 \le N$, $V_1 \ne V_2$,
$1 \le U \le 100$, $1 \le F \le 10^4$, $0 \le P_1 \le P_2 \le 100$).
One truck can carry one pack of skateboards. If during the whole period
of deliveries, there will be more than $U$ trucks on the road, there would
be a traffic jam and all these trucks won't arrive in time. If $U > 1$,
the probability of a car accident for $i$-th truck on the road
is $P_1 + (P_2 - P_1) (i - 1) / (U - 1)$. In case of $U = 1$, the probability
of a car accident for a truck is $P_1 = P_2$.

If a truck has accident, Bart pays $R$ as a penalty and then the truck
continues delivery. A truck can have no more than one accident per a road.

\OutputFile

Output expected profit with accuracy $10^{-2}$.
Note that Bart need not sell all $C$ packs of skateboards.

\Example

\begin{example}
\exmp{
3 1 3 100
2
2 2 1000
3 1 900
2
1 3 2 5 10 10
1 2 2 5 10 20
}{
2845.00
}%
\end{example}

\end{problem}
