<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def constructor(self):
        '''
            Return the contract's immediate constructor.
            If there is no immediate constructor, returns the first constructor
            executed, following the c3 linearization
            Return None if there is no constructor.
        '''
        cst = self.constructor_not_inherited
        if cst:
            return cst
        for inherited_contract in self.inheritance:
            cst = inherited_contract.constructor_not_inherited
            if cst:
                return cst
        return None