Aizu Kogyo undertakes manufacturing work using a processing machine. The processing machine owned by Aizu Kogyo is shown on the left in Figure 1. This machine can process any rectangular object, and its width, depth, and height can be freely set. There is a blade 1 cm wide and 1 cm deep on the top of this rectangular object. This blade can be moved directly above the position where you want to cut. The position where you want to cut is specified by the coordinates of the compartment as shown in the right side of Figure 1.
The machine will cut a rectangular object by repeating the following steps.
An example of shaving one of the end sections is shown in Figure 2.
At Aizu Industries, we determine the processing fee based on the amount of surface area after processing. Until now, this has been measured manually by craftsmen, but we would like to be able to calculate this using a program.
Given the size of the rectangular object to be machined and information on how the rectangular object is to be machined, write a program that calculates how much the surface area will be after machining.
The input is given in the following form.
$W$ $D$ $H$ $C$ $x_1$ $y_1$ $z_1$ $x_2$ $y_2$ $z_2$ : $x_C$ $y_C$ $z_C$
In the first line, the width $W$ ($1 \leq W \leq 100,000$), depth $D$ ($1 \leq D \leq 100,000$), height $H$ ($1 \leq H \leq 100,000$), and the number of cuts $C$ ($0 \leq C \leq 100,000$) of the rectangle to be machined are given. In the following $C$ lines, the information on how to cut the rectangle is given. $x_i$ ($0 \leq x_i < W$) and $y_i$ ($0 \leq y_i < D$) are the coordinates of the plot to be cut. Also, $z_i$ ($1 \leq z_i < H$) is an integer that represents how much the plot should be cut from its current height. However, for each parcel, no input is given such that the height after shaving will be less than 1.
Output the surface area after processing a line.
3 4 5 2 0 0 4 1 1 4
110
1 2 3 0
22
Since Sample Input 2 is a case where the surface area is never scraped, the surface area is the same as the surface area of the given rectangular.