A number n is a perfect number if it equals the sum of all its divisors except itself.
For example, 6=1+2+3, so 6 is perfect.
Write a program that decides whether n is a perfect number.
The input holds several test cases, one integer n per line (2<n<100,000).
The last line of the input is −1, and that line is not processed. The number of test cases is not given in advance.
Print one line per test case.
If n is perfect, print it as n = d1 + d2 + ... + dk, where d1<d2<⋯<dk are the divisors of n other than n itself, in ascending order. Put one space on each side of the equals sign and of every plus sign.
If n is not perfect, print n is NOT perfect.