# とにかくできるだけイーブンにR, G, Bを増やしていく # 証言は順番昇順でソート # 証言の色が足らなければ増やす、そうでなければイーブンにする # 同順位でいいので不可能はないはず N, K = map(int, input().split()) testimony = {} for i in range(K): a, c = map(str, input().split()) if c == 'R': testimony[int(a)] = 0 elif c == 'G': testimony[int(a)] = 1 elif c == 'B': testimony[int(a)] = 2 RGB = [0, 0, 0] ans = '' string = 'RGB' for i in range(N): smallest_num = min(RGB) if i+1 in testimony: if RGB[testimony[i+1]] == smallest_num: RGB[testimony[i+1]] += 1 ans += string[testimony[i+1]] else: for j in range(3): if RGB[j] == smallest_num: RGB[j] += 1 ans += string[j] break else: for j in range(3): if RGB[j] == smallest_num: RGB[j] += 1 ans += string[j] break #print('i', i, 'RGB', RGB, 'ans', ans) print(ans)