I have to find the ternary coefficients for a given number.
For example, if the given number is 29, the desired output should be -1101. Som