#include #include #include #include #include using namespace std; int M; unsigned long long N; int P[10001]; int main() { int T; cin>>T; while(T--) { cin>>M; //M=10; cin>>N; memset(P,0,sizeof(P)); int x=0; while(N>0) { P[++x]=N%3; N/=3; } int L=0; for(int i=M; i>=1; i--) { if(P[i]==0)cout<<"R"; if(P[i]==1)cout<<"G"; if(P[i]==2)cout<<"B"; L++; } cout<