Divide by Squares is played on a rectangular grid.
Some of the squares in the grid are numbered.
The objective is to divide the grid into rectangular
and square pieces such that each piece contains exactly one number,
and that number represents the area of the rectangle (from Wikipedia).
On the pictures you can see a sample of the puzzle and its solution.
You are to write program that solves this puzzle.
Input file format
The first line of the input file contains three integers,
separated by spaces — the height H, the width W of the grid,
and total amount K of numbers on the grid.
Each of the next K lines contains three integers,
separated by spaces — position (i,j) of the number and the number itself.
The puzzle in the input has at least one solution.
Output file format
The output file must contain K lines.
For each number in the input you should print four integers on corresponding line —
coordinates of left upper corner of the rectangle that contains
this number and its height and width. You have to print arbitrary solution.