Products of o-aminobenzaldehyde thermal treatment with acetone and further with sulfuric acid
This is an example of the Friedländer synthesis of quinolines Wikipedia article  here.

Under catalysis by hydroxide acetone undergoes an aldol condensation with the aldehyde group to give 3, which is your compound A ($\ce{R2=Me, R3=H}$). Under the catalysis of sulfuric acid A loses water to give the quinoline 7 (for your B $\ce{R2 = Me, R3=H}$).

Several reviews of the Friedländer exist, this is a good one Chem. rev. here. 



Image is from ref 1.