Electron rearrangement for the water molecule in different environments