Triangle Validity and Classification

No attempts yetTime limit1sMemory limit128 MB

Problem

The shape of a triangle is fully determined by the lengths of its three sides. Each input line contains three positive integers. Process the lines in order as follows.

  • Decide whether a triangle whose side lengths equal the three given values exists. Let $c$ be the longest of the three sides and let $a$ and $b$ be the other two; the triangle exists if and only if $a + b > c$.
  • If the triangle exists, classify it as acute, right, or obtuse, then move on to the next line. The classification compares $a^2 + b^2$ with $c^2$: it is acute if $a^2 + b^2 > c^2$, right if $a^2 + b^2 = c^2$, and obtuse if $a^2 + b^2 < c^2$.
  • The first time a line does not form a valid triangle, output — separated by single spaces — the number of triangles counted so far, the number of right triangles, the number of acute triangles, and the number of obtuse triangles, then ignore the remaining input and stop.

You may assume the input always contains at least one line that does not form a triangle.

Input

Several lines are given, each with three positive integers separated by spaces. Each integer is at most $100$. The number of lines is unknown; reading stops at the first line that does not form a valid triangle.

Output

On a single line, print four integers separated by single spaces, in this order: counted before the first non-triangle line, (1) the total number of triangles, (2) the number of right triangles, (3) the number of acute triangles, and (4) the number of obtuse triangles. End the line with a newline character.