import sys readline = sys.stdin.readline N, K = map(int, readline().split()) D = [[10 ** 18, 0]] for i in range(K): A, c = readline().split() if c == "R": n = 0 elif c == "G": n = 1 else: n = 2 D.append([int(A), n]) D.sort(reverse=True) color = [0] * 3 ans = [] hat = ["R", "G", "B"] for i in range(N): if max(color) == min(color): ind = 0 else: for j in range(3): if color[j] == min(color): ind = j break temp = [0] * 3 for j in range(3): temp[j] = color[j] temp[ind] += 1 if D[-1][0] != i + 1: ans.append(hat[ind]) color[ind] += 1 else: A, c = D[-1] D.pop() if temp[c] == max(temp): ans.append(hat[ind]) color[ind] += 1 else: ans.append(hat[c]) color[c] += 1 print(*ans, sep="")