The Holstein-Hubbard dimer of variable length as the building block of the CuO plane: Electronic and phononic transitions