Dolan–Grady relations and noncommutative quasi-exactly solvable systems