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