#include #include using namespace std; auto T=0; void input(){ cin >> T; } void solve(){ for(int i=0; i> s; if(s.size()<3){ cout << "impossible" << endl; continue; } auto r_cnt = 0, g_cnt = 0, w_cnt = 0; bool ans = true, f = false; for(int j=0;j=g_cnt&&g_cnt>=r_cnt)){ ans = false; break; } } if(g_cnt!=r_cnt||!f) ans = false; if(ans) cout<<"possible" << endl; else cout << "impossible" << endl; } } int main(){ input(); solve(); }