#include<iostream>
#include<cstdio>
#include<cstring>
#include<stack>
using namespace std;
int n;
long long m;
int main()
{
freopen("lightt.in","r",stdin);
freopen("lightt.out","w",stdout);
stack<int> st;
scanf("%d%lld",&n,&m);
int i=1;
while(i<=n){
st.push(m%3);
m/=3;
i++;
}
int a;
for(i=1;i<=n;i++){
a=st.top();st.pop();
if(a==0)putchar('R');
if(a==1)putchar('G');
if(a==2)putchar('B');
}
}