A-B Problem solution