Problem B - Square Sequence --------------------------- Given a positive integer n, one can build a sequence of perfect square numbers in the following manner: The first term of the sequence is computed by adding up the digits of n, and taking the square of that sum. Every other term in the sequence is computed by adding up the digits of the previous term, and taking the square of that sum. For example, if n=12, then the first term of the sequence is (1+2)^2 = 9. The whole sequence is 9 81 81 81 .... It has been proven that any such sequence will eventually reach a repeating pattern as in the example above (the repeating pattern may contain more than number). Input ----- Each line of input will contain a value for n. The last line input will contain a 0. No output should be created for this last line. Output ------ For each line of input, output the number of sequence terms that occur before the repeating pattern begins, followed by one repetition of the pattern, as in the sample output below. Sample Input ------------ 10 12 0 Output for Sample Input ----------------------- 0 1 1 81