@ Gabe – tricky question.
But – here's what you do:
There was a distribution of property. We know we need to use FMV then. FMV is $40,000 and adjusted basis of the contributed property is $5,000. Thus, there's a $35,000 gain. The tricky part is this: This $35,000 INCREASES Current E & P. So, remember that.
The distribution made was $49,000 in total (Cash of $9,000 + FMV of $40,000).
Then, we have $35,000 of the gain in Current E & P. We also have Accumulated E & P of $9,000.
This means that up to Current E &P and up to Accumulated E & P is taxable. This means that $44,000 is taxable of the distribution and the remaining $5,000 is a reduction in the shareholder's basis (non-taxable).
Hope that helps! Tried to give you a detailed explanation, so, you can see what's going on.
Let me know if you're still confused!