. . . . "Section 39G. Upon substantial completion of the work required by a contract with the commonwealth, or any agency or political subdivision thereof, for the construction, reconstruction, alteration, remodeling, repair or improvement of public ways, including bridges and other highway structures, sewers and, water mains, airports and other public works, the contractor shall present in writing to the" . .