How does the (a) average kinetic energy (b) average potential energy of molecules of a substance change during its change in phase at a constant temperature, on heating ?