Considering perfect competition, monopolistic competition, and monopoly, which of the market structures results in production of the welfare-maximizing level of output?

a) Perfect competition
b) Monopolistic competition
c) Monopoly
d) Both a and b