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