ans' x =
  let z  = zip [0..] x
      gs = map (\g -> filter (\(i,v) -> elem i g) z ) gp
      gr = map fst $ concat $ map chk gs
  in
    to_s gr z
ans' x =
  let z  = zip [0..] x
      gs = map (\g -> filter (\(i,v) -> elem i g) z ) gp
      gr = map fst $ concat $ map chk gs
  in
    to_s gr z
ans' x =
  let z  = zip [0..] x
      gs = map (\g -> filter (\(i,v) -> elem i g) z ) gp
      gr = map fst $ concat $ map chk gs
  in
    to_s gr z