import math
p, q = map(int, input().split())
g = math.gcd(p, q)
p //= g
q //= g
n = 1
s = 1
while s % (p + q) != 0:
n += 1
s += n
s = s * p // (p + q)
ans = ['B'] * n
for i in range(n, 0, -1):
if i <= s:
s -= i
ans[i - 1] = 'R'
print(n, "".join(ans), sep='\n')