If you take the x axis horizontal and the y axis vertical for a total variation of the height of `Delta(y) =50 m` the work done by hiker to increase its potential energy is:

`W = m*g*Delta(y) = 55.6*9.81*50 =27271.8 J`

The work done by gravity is simply this work above with a sign minus in front of it (that show that the force of gravity is downwards and the higer is climbing upwards)

`W_g=-27271.8 J`

This happens because the gravitational force is a conservative force or in other words it does not depend on the path followed between initial and final positions.