Rovibronic structure of Rydberg and non-Rydberg states of H2O and D2O