#include #include #include #include #include #include #include #include #include using namespace std; void possible() { cout << "possible" << endl; } void impossible() { cout << "impossible" << endl; } bool resolve(const string& s) { int indexR = -1; int indexG = -1; int indexW = -1; int countR = 0; int countG = 0; int countW = 0; for (string::size_type i = 0; i < s.length(); i++) { char ch = s[i]; switch (ch) { case 'R': countR++; indexR = i; break; case 'G': countG++; indexG = i; break; case 'W': countW++; indexW = i; break; } if (countR > countG || countG > countW) { impossible(); return false; } } if (countR == 0 || countR != countG) { impossible(); return false; } if (indexW > indexG) { impossible(); return false; } possible(); return true; } int main() { int n; cin >> n; for (int i = 0; i < n; i++) { string s; cin >> s; } return 0; }