let q f x y = (fst (f x) = 'q')&&(y-->dir (fst x) (snd x))&& (segV x y) && (rr f x y)