#include #include using namespace std; int main() { int T; cin>>T; while (T--) { string s; cin>>s; int n=s.size(); int r=0, g=0, w=0; bool possible=true; for(int i=0;iw) possible=false; cout<<(possible?"possible":"impossible")<