First, make a NAND gate by feeding the output of an AND gate to a NOT gate. Then, make this.
u dont need to use 3 NANDs, u just need to use the last NAND, and the 2 first can be swapped for NOTs