NB: this is unsafe for cyclic alternations.