# https://yukicoder.me/problems/no/3056 def main(): N, M = map(int, input().split()) edges = [] for _ in range(M): u, v = map(int, input().split()) edges.append((u - 1, v - 1)) if M % 2 == 1: print(-1) return next_nodes = [[] for _ in range(N)] for i in range(M): u, v = edges[i] next_nodes[u].append((v, i)) next_nodes[v].append((u, i)) for x, _ in next_nodes[0]: if x == N - 1: print(-1) return answers = [None for _ in range(M)] r_num = M // 2 b_num = M // 2 f1 = 0 f2 = N -1 if len(next_nodes[0]) < len(next_nodes[v]): f1 = 0 f2 = N -1 else: f1 = N -1 f2 = 0 m = len(next_nodes[f1]) for _, i in next_nodes[f1]: answers[i] = "R" r_num -= 1 for _ , i in next_nodes[f2]: answers[i] = "B" m -= 1 b_num -= 1 if m == 0: break for i in range(M): if answers[i] is None: if r_num > 0: answers[i] = "R" r_num -= 1 elif b_num > 0: answers[i] = "B" b_num -= 1 print("".join(answers)) if __name__ == "__main__": main()