A triangular number is a number that can be represented as a set of points arranged in an equilateral triangle with points on each side. Below are several examples of such triangles and their corresponding triangular numbers:

It is easy to see that a triangular number is an additive analogue of the factorial:
Given an integer , determine whether it is a triangular number. If the number is triangular, you must also determine the number of points on each side of the corresponding triangle.
For example, if n = 10, the program should report that this is a triangular number with points on each side, since
If n = 11, the program should report that it is not a triangular number.
Each line contains one integer n~(0 < n < 10^9). The last line contains and should not be processed.
For each value of , determine whether it is a triangular number. If it is, print the number of points on a side on a separate line. Otherwise, print the string "bad".
Example 1