import collections N,K = map(int, input().split()) AC = [list(input().split()) for _ in range(K)] for i in range(K): AC[i][0]=int(AC[i][0])-1 AC = sorted(AC, reverse=True, key=lambda x: x[1]) THREE = collections.defaultdict(list) for a,c in AC: THREE[a//3].append(c) HAT = [] for i in range(N//3+1): USE = {'R','G','B'} for c in THREE[i]: if c in USE: HAT.append(c) USE.discard(c) HAT.extend(list(USE)) print(''.join(map(str, HAT[:N])))