n,k = map(int,input().split()) ans = [] RGB = [0]*3 AC = [] for i in range(k): a,c = input().split() a = int(a) AC.append([a,c]) AC.sort() l = "RGB" now = 0 for i in range(1,n+1): if now < k and AC[now][0] == i: # print(i) c = AC[now][1] now += 1 ind = l.index(c) # print(c,ind,RGB) if max(RGB) == RGB[ind]: if i%3 == 1: RGB[ind] += 1 ans.append(ind) else: m = max(RGB) for j in range(3): if RGB[j] != m: RGB[j] += 1 ans.append(j) break else: RGB[ind] += 1 ans.append(j) else: if i%3 == 1: RGB[0] += 1 ans.append(0) else: m = max(RGB) for j in range(3): if RGB[j] != m: RGB[j] += 1 ans.append(j) ans = [l[i] for i in ans] print("".join(ans))