<>;map{$_=reverse;$i++while s/^\s*R(R*?)G(.*?)W/$1$2/;$i=!print"im"x(!$i||/[GR]/),possible,$/}<>