#include #include #include int main(){ std::ios::sync_with_stdio(false); std::cin.tie(0); int t; std::cin >> t; for(int i=0; i imos; std::string str; std::cin >> str; for(auto c : str){ switch(c){ case 'G': imos.push_back( 1); break; case 'R': imos.push_back(-1); break; } } std::cout << (([&]() -> bool { if(imos[0]==-1) return false; for(size_t j=1; j