solve p040