AMD interview question

Can you explain how to make this function using only nand gates?