you only need to use the right two simple formulas:
work = (force) x (distance)
-- a mass that weighs 500n is being pulled down by gravity with a force of 500n. (that's what "weighs" means.) if you want to lift it straight up against gravity, you have to lift with a force of 500n.
the work you do on the mass is (500n) x (height you raise it to).
power = (work) / (time)
-- 4,000 watts = (500n x height) / 20 seconds
from here, the rest is just algebra pulling the height out of this equation:
multiply each side by (20 sec):
(500n x height) = (4,000 watts x 20 sec)
divide each side by (500n):
height = (4,000 watts x 20 sec) / (500n)
height = (4,000 x 20 / 500) (watt x second / newton)
(remember that "watt-second" = "joule",
and "joule" = "newton-meter".)
height = 160 meters