On the way to Rigel 7, chief engineer Geordi and Data compared their favorite numbers. Geordi said he likes narcissistic numbers: a number that equals the sum of its own digits, each digit raised to the power of the number of digits.
Data answered that narcissistic numbers are interesting but not as good as his own favorite, perfect numbers. Geordi had never heard of a perfect number, so Data explained. A positive integer is perfect if it equals the sum of its positive divisors smaller than itself. 6 is perfect because 6 = 1 + 2 + 3.
Geordi started working out how to decide whether a number is perfect, but he does not compute as fast as Data. Write the program for him.
The input holds one number per line. Each line contains a positive integer n with 2<n<100000. A line containing -1 marks the end of the input and is not processed.
For each n, decide whether it is perfect. If n is perfect, print the number, an equals sign, and its positive divisors smaller than the number in ascending order, in the form n = d1 + d2 + ... + dk. If n is not perfect, print <NUM> is NOT perfect. where <NUM> is that number. Separate every word, symbol, and number in the output with a single space. The period that ends the sentence for a number that is not perfect is the only exception.