<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def pop(h):
 """Pop the heap value from the heap."""

    n = h.size() - 1
    h.swap(0, n)
    down(h, 0, n)
    return h.pop()