Increasing order of stability of the resonance structure is:

Key idea: A resonance structure is more stable when every atom has an octet, there is less charge separation, and charges sit where they are best stabilised (– next to C=O, + next to the N lone pair). A cation on an electronegative atom with an incomplete octet is the worst case.
Increasing stability: C < A < B < D.
Answer: (B)
Tagged Reactive intermediates and rearrangements. Machine-assigned, so read it as a strong shortlist rather than a verdict.