Mechanism should follow something like this. I agree with compound B being the only correct connectivity. But, if the nitrogen did attack directly at the carbonyl, you would not end up with a 6 member ring, I think i count an 8 member ring, which you have not shown as an answer (and would be fairly unfavourable anyway).
Generally shown by
1,4-michael addition (nitrogen attacking end of double bond).
Proton transter (to make enol)
Equilibration (to make ketone, which i believe is the more favoured/stabled state).
So, in all, I believe B is the only correct answer.