KRAVE

No attempts yetTime limit5sMemory limit256 MB

Problem

A meadow is an A×BA \times B rectangle. From point (X,Y)(X,Y), build a horizontal or vertical fence until it hits another fence. After each fence, print the areas of the two new fields, smaller first.

Input

AA, BB, NN, then NN lines with XX, YY, DD (11 horizontal, 22 vertical).

Output

NN lines, two 64-bit integers per line.