#include #include using namespace std; int main(){ int t; cin>>t; string s; for(int i=0; i>s; int w,g,r,f; w=0; g=0; r=0; for(int j=0; jg){ g++; } else { f=1; cout<<"impossible"<=g && g>r){ r++; } else { f=1; cout<<"impossible"<=g && w>=r && g==r){ cout<<"possible"<