Buggy python submission (verdict: Time Limit Exceeded):
#! /usr/bin/env python
# -*- coding: utf-8 -*-

''' ????????????????????£????????\??? '''


class PQueue(object):
    """ Priority Queue """

    def __init__(self):
        self.pqueue = []

    def insert(self, x):
        self.pqueue.append(x)

    def extractMax(self):
        max_value = max(self.pqueue)
        self.pqueue.pop(self.pqueue.index(max_value))
        return max_value


if __name__ == '__main__':

    pqueue = PQueue()

    line = input()
    while line != 'end':
        if line.split()[0] == 'insert':
            pqueue.insert(int(line.split()[1]))
        elif line.split()[0] == 'extract':
            print(pqueue.extractMax())
        line = input()

Fixed submission:
#! /usr/bin/env python
# -*- coding: utf-8 -*-

''' ????????????????????£????????\??? '''

import heapq


class PQueue(object):
    """ Priority Queue """

    def __init__(self):
        self.pqueue = []

    def insert(self, x):
        # self.pqueue.append(x)
        heapq.heappush(self.pqueue, -x)

    def extractMax(self):
        # return self.pqueue.pop(self.pqueue.index(max(self.pqueue)))
        return -heapq.heappop(self.pqueue)


if __name__ == '__main__':

    pqueue = PQueue()
    result = []

    while True:
        line = input()
        if line == 'end':
            break

        if line.split()[0] == 'insert':
            pqueue.insert(int(line.split()[1]))
        elif line.split()[0] == 'extract':
            result.append(pqueue.extractMax())

    for i in range(len(result)):
        print(result[i])

Buggy python submission (verdict: Time Limit Exceeded):
#! /usr/bin/env python
# -*- coding: utf-8 -*-

''' ????????????????????£????????\??? '''


class PQueue(object):
    """ Priority Queue """

    def __init__(self):
        self.pqueue = []

    def insert(self, x):
        self.pqueue.append(x)

    def extractMax(self):
        max_value = max(self.pqueue)
        self.pqueue.pop(self.pqueue.index(max_value))
        return max_value


if __name__ == '__main__':

    pqueue = PQueue()
    result = []

    line = input()
    while line != 'end':
        if line.split()[0] == 'insert':
            pqueue.insert(int(line.split()[1]))
        elif line.split()[0] == 'extract':
            result.append(pqueue.extractMax())
        line = input()

    for i in range(len(result)):
        print(result[i])

Fixed submission:
#! /usr/bin/env python
# -*- coding: utf-8 -*-

''' ????????????????????£????????\??? '''

import heapq


class PQueue(object):
    """ Priority Queue """

    def __init__(self):
        self.pqueue = []

    def insert(self, x):
        # self.pqueue.append(x)
        heapq.heappush(self.pqueue, -x)

    def extractMax(self):
        # return self.pqueue.pop(self.pqueue.index(max(self.pqueue)))
        return -heapq.heappop(self.pqueue)


if __name__ == '__main__':

    pqueue = PQueue()
    result = []

    while True:
        line = input()
        if line == 'end':
            break

        if line.split()[0] == 'insert':
            pqueue.insert(int(line.split()[1]))
        elif line.split()[0] == 'extract':
            result.append(pqueue.extractMax())

    for i in range(len(result)):
        print(result[i])

Buggy python submission (verdict: Time Limit Exceeded):
#! /usr/bin/env python
# -*- coding: utf-8 -*-

''' ????????????????????£????????\??? '''


class PQueue(object):
    """ Priority Queue """

    def __init__(self):
        self.pqueue = []

    def insert(self, x):
        self.pqueue.append(x)

    def extractMax(self):
        max_value = max(self.pqueue)
        self.pqueue.pop(self.pqueue.index(max_value))
        return max_value


if __name__ == '__main__':

    pqueue = PQueue()
    result = []

    while True:
        line = input()
        if line == 'end':
            break

        if line.split()[0] == 'insert':
            pqueue.insert(int(line.split()[1]))
        elif line.split()[0] == 'extract':
            result.append(pqueue.extractMax())

    for i in range(len(result)):
        print(result[i])

Fixed submission:
#! /usr/bin/env python
# -*- coding: utf-8 -*-

''' ????????????????????£????????\??? '''

import heapq


class PQueue(object):
    """ Priority Queue """

    def __init__(self):
        self.pqueue = []

    def insert(self, x):
        # self.pqueue.append(x)
        heapq.heappush(self.pqueue, -x)

    def extractMax(self):
        # return self.pqueue.pop(self.pqueue.index(max(self.pqueue)))
        return -heapq.heappop(self.pqueue)


if __name__ == '__main__':

    pqueue = PQueue()
    result = []

    while True:
        line = input()
        if line == 'end':
            break

        if line.split()[0] == 'insert':
            pqueue.insert(int(line.split()[1]))
        elif line.split()[0] == 'extract':
            result.append(pqueue.extractMax())

    for i in range(len(result)):
        print(result[i])

Buggy python submission (verdict: Time Limit Exceeded):
#! /usr/bin/env python
# -*- coding: utf-8 -*-

''' ????????????????????£????????\??? '''


class PQueue(object):
    """ Priority Queue """

    def __init__(self):
        self.pqueue = []

    def insert(self, x):
        self.pqueue.append(x)

    def extractMax(self):
        return self.pqueue.pop(self.pqueue.index(max(self.pqueue)))


if __name__ == '__main__':

    pqueue = PQueue()
    result = []

    while True:
        line = input()
        if line == 'end':
            break

        if line.split()[0] == 'insert':
            pqueue.insert(int(line.split()[1]))
        elif line.split()[0] == 'extract':
            result.append(pqueue.extractMax())

    for i in range(len(result)):
        print(result[i])

Fixed submission:
#! /usr/bin/env python
# -*- coding: utf-8 -*-

''' ????????????????????£????????\??? '''

import heapq


class PQueue(object):
    """ Priority Queue """

    def __init__(self):
        self.pqueue = []

    def insert(self, x):
        # self.pqueue.append(x)
        heapq.heappush(self.pqueue, -x)

    def extractMax(self):
        # return self.pqueue.pop(self.pqueue.index(max(self.pqueue)))
        return -heapq.heappop(self.pqueue)


if __name__ == '__main__':

    pqueue = PQueue()
    result = []

    while True:
        line = input()
        if line == 'end':
            break

        if line.split()[0] == 'insert':
            pqueue.insert(int(line.split()[1]))
        elif line.split()[0] == 'extract':
            result.append(pqueue.extractMax())

    for i in range(len(result)):
        print(result[i])