#include using namespace std; struct INIT{INIT(){ios::sync_with_stdio(false);cin.tie(0);}}init; bool check(string S){ int white_count(0),green_count(0),white_exist(0); for(auto& it : S) switch(it){ case 'W':white_count++;white_exist=1;break; case 'G':green_count++;white_exist=0; if(white_count--<=0)return false;break; case 'R':if(green_count--<=0)return false;break; } return green_count==0&&white_exist==0; } int main() { int T; cin>>T; while(T--){ string S; cin>>S; if(check(S))cout<<"possible"<