The sum of the roots of a polynomial equation of degree n is -b/a, where a is the leading coefficient (of the x^n term) and b is the coefficient of the x^(n-1) term.
So in this problem the sum of the roots is -5.
But the sum of the roots is w + 2w + w+3. So
So the roots of the polynomial are -2, -4, and 1. And then the polynomial is