Domanda di colloquio di AMD

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