There is a tasty jelly. To make it easy to cut, the jelly is divided into unit cubes of volume 1: R cells wide, C cells deep and H cells tall. The jelly holds N raisins. No raisin spans more than one cell, and no cell holds two or more raisins. So the jelly can be read as a three dimensional array, and the position of a raisin is written as three integers (r,c,h). See the figure below.

Tokkaengi wants to divide the jelly into exactly N pieces so that every piece holds exactly one raisin. A cut follows cell boundaries exactly, goes all the way through the piece being cut and leaves two rectangular boxes; a cut cannot stop halfway. Among the N pieces, Tokkaengi wants the smallest volume to be as large as possible. Help Tokkaengi cut the jelly.
The first line contains the jelly size R, C, H and the number of raisins N, separated by spaces. (1≤R,C,H≤7, 1≤N≤min(R×C×H,77))
Each of the next N lines contains three integers r, c, h giving the position of one raisin, separated by spaces. (1≤r≤R, 1≤c≤C, 1≤h≤H) No two raisins share a position.
Print the largest volume the smallest piece can have when the jelly is divided into exactly N pieces with one raisin in each piece.

This is the jelly of the example input seen from above. However well it is cut, the three pieces have volumes 2, 3 and 4.