#include using namespace std; int main(){ int t; cin>>t; while(t--){ string s; cin>>s; int white=0,green=0,red=0; bool possible=true; for(int i=0;i<(int)s.size();i++){ if(s[i]=='W') white++; else if(s[i]=='G'){ green++; if(green>white){ possible=false; break; } } else{ red++; if(red>green){ possible=false; break; } } } if(red!=green||red==0) possible=false; if(possible) cout<<"possible"<