n,k=map(int,input().split()) ans=[-1]*(n+1) que=[] for i in range(k): a,k=input().split() a=int(a) if k=="R":k=0 elif k=="G":k=1 else:k=2 que.append((a,k)) que.sort() cnt=[0,0,0] now=1 for a,k in que: while now<=3*(a//3): for j in range(3): if min(cnt)==cnt[j]: ans[now]=j cnt[j]+=1 now+=1 break if a%3==0:continue elif a%3==1: ans[a]=k cnt[k]+=1 now+=1 else: if now==a-1: ans[now]=k cnt[k]+=1 now+=1 else: if ans[a-1]==k:continue else: ans[now]=k cnt[k]+=1 now+=1 res=[] for i in range(1,n+1): if ans[i]==0: res.append("R") elif ans[i]==1: res.append("G") else: res.append("B") print("".join(res))