Whatever be the initial input, once B gets input 0 it will turn the output Y to 1.
Now the input to the A's NAND gate are 1 and 1 which makes the output at X as 0.
Now when input at B changed to 1 from 0, the B's NAND gate will have inputs 1 and 0 which will keep the output at Y at 1.
Hence now whatever input is given to B, the output will not change unless the input to A changes.
Hence A is the answer.