import sys input = sys.stdin.readline def f1(s): if s=='R': return 0 elif s=='G': return 1 else: return 2 def f2(x): if x==0: return 'R' elif x==1: return 'G' else: return 'B' N, K = map(int, input().split()) color = [-1]*(N+1) for _ in range(K): A, c = input().split() color[int(A)] = f1(c) cnt = [0, 0, 0] ans = [] for i in range(1, N+1): if color[i]==-1: m = min(cnt) i = cnt.index(m) cnt[i] += 1 ans.append(i) else: d = 5 x = -1 for j in range(3): cnt[j] += 1 M = max(cnt) m = min(cnt) if color[i] in [k for k in range(3) if cnt[k]==M]: if d>M-m: d = M-m x = j cnt[j] -= 1 assert(x!=-1) cnt[x] += 1 ans.append(x) cnt = [0, 0, 0] for i in range(1, N+1): cnt[ans[i-1]] += 1 M = max(cnt) if color[i]!=-1: assert(color[i] in [k for k in range(3) if cnt[k]==M]) print(''.join(map(f2, ans)))