Extensions of topological and semitopological groups and the product operation