class Neg:

    def __init__(self, x):
        self.x = x

def __cmp__(self, other):
    return -cmp(self.x, other.x)

def maxheappush(heap, item):
    heapq.heappush(heap, Neg(item))

def maxheappop(heap):
    pass
built-in max heap API in Python