Cutting rectangle
On the coordinate plane given rectangle, whose height h, and the width - w. Inside the rectangle are given segments, parallel to the axes and the ends that have integer coordinates.
The rectangle will be cut into several horizontal or vertical slits. For one step is allowed to cut into two nonempty rectangular parts only one available at this step rectangles. It is prohibited in any cross section of the specified segments.
Need to write a program that allows to find ways of cutting the number of source rectangle into k parts of the vertical and horizontal cuts. Methods other than the order of the cuts are different.
Input
The first line contains the dimensions of the rectangle - the integers h and w (1 ≤ h, w ≤ 8). The second line contains the number k (1 ≤ k ≤ hw) of parts, which require cutting a rectangle. The third line contains an integer cnt (0 ≤ cnt ≤ 10) - the number given within a rectangle of the segments. Follow cnt lines contain a description of these segments, that is, each line contains four integers x_1, y_1, x_2, y_2 (0 ≤ x_1 ≤ x_2 ≤ w, 0 ≤ y_1 ≤ y_2 ≤ h) - coordinates all segment.
Output
Print the required number of ways of cutting the source rectangle. The answer must be submitted to the modulo 2^30.