update cs (Rotate n)
  | n > 0 = let (h, t) = S.splitAt n cs
            in t >< h
  | otherwise = update cs (Rotate (S.length cs + n))
update cs (Rotate n)
  | n > 0 = let (h, t) = S.splitAt n cs
            in t >< h
  | otherwise = update cs (Rotate (S.length cs + n))
update cs (Rotate n)
  | n > 0 = let (h, t) = S.splitAt n cs
            in t >< h
  | otherwise = update cs (Rotate (S.length cs + n))