Thanks for the fast and accurate answer.
I made a diagram of the final circuit, is it ok?

Click to expand...

You final circuit doesn't use just NAND gates. You have inverters in there as well. You need to implement those with NAND gates, too. Also, you have a 3-input NAND. Be sure that that is acceptable since problems like this frequently only allow you to use 2-input NAND gates.