mod = 998244353 def main(): import sys input = sys.stdin.readline T = {"R": 0, "G": 1, "B": 2} N, K = map(int, input().split()) ans = [""] * (N + 10) for _ in range(K): a, c = input().split() a = int(a) ans[a-1] = c for i in range((N // 3) + 1): cnt = [0] * 3 for j in range(3): s = ans[i * 3 + j] if s == "R": cnt[0] += 1 elif s == "G": cnt[1] += 1 elif s == "B": cnt[2] += 1 # j = 0 if ans[i * 3] == "": if cnt[0] == 0: ans[i * 3] = "R" cnt[0] += 1 elif cnt[1] == 0: ans[i * 3] = "G" cnt[1] += 1 else: ans[i * 3] = "B" cnt[2] += 1 # j = 1 if ans[i * 3 + 1] == "": if cnt[0] == 0: ans[i * 3 + 1] = "R" cnt[0] += 1 elif cnt[1] == 0: ans[i * 3 + 1] = "G" cnt[1] += 1 else: ans[i * 3 + 1] = "B" cnt[2] += 1 else: s = ans[i * 3 + 1] if cnt[T[s]] > 1: cnt[T[s]] -= 1 if cnt[0] == 0: ans[i * 3 + 1] = "R" cnt[0] += 1 elif cnt[1] == 0: ans[i * 3 + 1] = "G" cnt[1] += 1 else: ans[i * 3 + 1] = "B" cnt[2] += 1 # j = 2 if ans[i * 3 + 2] == "": if cnt[0] == 0: ans[i * 3 + 2] = "R" cnt[0] += 1 elif cnt[1] == 0: ans[i * 3 + 2] = "G" cnt[1] += 1 else: ans[i * 3 + 2] = "B" cnt[2] += 1 else: s = ans[i * 3 + 2] if cnt[T[s]] > 1: cnt[T[s]] -= 1 if cnt[0] == 0: ans[i * 3 + 2] = "R" cnt[0] += 1 elif cnt[1] == 0: ans[i * 3 + 2] = "G" cnt[1] += 1 else: ans[i * 3 + 2] = "B" cnt[2] += 1 print("".join(ans[:N])) if __name__ == '__main__': main()