N, K = map(int, input().split()) A = [-1]*N S = 'RGB' for _ in range(K): a, b = input().split() A[int(a)-1] = S.index(b) ans = [-1]*N ct = [0]*3 for i in range(N): if A[i] >= 0 and ct[A[i]] == min(ct): ans[i] = A[i] else: ans[i] = ct.index(min(ct)) ct[ans[i]] += 1 print(''.join(S[a] for a in ans))