#include "bits/stdc++.h" using namespace std; #define print(x) cout< PI; typedef pair V; typedef vector VE; const ll mod = 1000000007; int main(){ int n; cin>>n; REP(i,n){ string s; cin>>s; int cnt=0; int w=0; int g=0; int r=0; bool flag=1; REP(j,GET_ARRAY_SIZE(s)){ if(s[j]=='G'){g++;} else if(s[j]=='R'){r++;} else if(s[j]=='W'){w++;} if(w