#include <bits/stdc++.h>
using namespace std;
int main(){
int p, q; cin >> p >> q;
int g = __gcd(p, q);
p /= g;
q /= g;
int n = 1;
long long sum = 0;
while(true){
sum += n;
if (sum % (p + q) == 0){
break;
}
n += 1;
}
sum = sum / (p + q) * q;
string ans(n, 'R');
for(int i = n; i > 0; --i){
if (sum >= i){
sum -= i;
ans[i - 1] = 'B';
}
}
assert(sum == 0);
cout << n << endl << ans << endl;
return 0;
}