n,k = map(int,input().split()) from collections import defaultdict ac = defaultdict(str) d = defaultdict(str) for i in range(k): a,c = input().split() a = int(a)-1 d[a] = c rgb = ["R","G","B"] ans = [] for i in range(-(-n//3)*3): ans.append(rgb[i%3]) for i in range(n): if (i % 3 == 2):continue if not d[i]:continue c = d[i] if i % 3 == 0: if ans[i] != c: idx = rgb.index(c) for j in range(3): ans[i+j] = rgb[(idx+j)%3] if i % 3 == 1: if ans[i] != c and ans[i-1] != c: ans[i],ans[i+1] = ans[i+1],ans[i] print("".join(ans[:n]))