A company rents vaults arranged on a two-dimensional plane. Each vault is a point with integer coordinates. For every integer x with 1 <= x <= L and every integer y with -A <= y <= B, there is exactly one vault at (x, y), for a total of L * (A + B + 1) vaults.
Two guards watch the vaults. One guard stands at (0, -A), and the other stands at (0, B). A guard can see a vault if the open line segment between the guard and that vault contains no other vault.
A vault that neither guard can see is unsafe. A vault that exactly one guard can see is safe. A vault that both guards can see is very safe.
Given A, B, and L, count the unsafe, safe, and very safe vaults.
The first line contains A and B. The second line contains L.
1 <= A, B <= 2000, 1 <= L <= 1,000,000,000.
Print three lines. The first line must contain the number of unsafe vaults, the second line the number of safe vaults, and the third line the number of very safe vaults.