There is a matrix in the 2D plane, whose vertices labelled as $$$(0,0)$$$, $$$(n, 0)$$$, $$$(0, m)$$$ and $$$(n, m)$$$.
$$$333lfy$$$ has $$$q$$$ segments. The length of the $$$i$$$-th segment is $$$a_i$$$. He wants to place these segments in this 2D plane.
There are following four ways to place the $$$i$$$-th segment:
After placing all segments, the matrix is divided into several parts by these segments. Now please calculate the area of the largest part.
The first line of the input contains three integers $$$n, m, q$$$ $$$(1 \le n, m \le 10^6, 1 \le q \le 2000)$$$ — The size of the matrix and the number of the segments.
The next $$$q$$$ lines each line contains three integers, and the $$$i$$$-th line belong to one of the following four types:
Print one integer — the number satisfying the conditions above.
4 7 5 2 1 1 6 3 6 2 4 3 3 3 2 3 2 2
14
The example is shown in the figure: