#ifdef NACHIA
#define _GLIBCXX_DEBUG
#else
#define NDEBUG
#endif
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using i64 = long long;
using u64 = unsigned long long;
#define rep(i,n) for(i64 i=0; i<i64(n); i++)
const i64 INF = 1001001001001001001;
template<typename A> void chmin(A& l, const A& r){ if(r < l) l = r; }
template<typename A> void chmax(A& l, const A& r){ if(l < r) l = r; }
using namespace std;

void testcase(){
    i64 N, M; cin >> N >> M;
    bool ok = true;
    vector<i64> U(M), V(M), D(N);
    rep(i,M){
        i64 u,v; cin >> u >> v; u--; v--;
        if(u == 0 && v == N-1) ok = false;
        U[i] = u; V[i] = v;
        D[u]++; D[v]++;
    }
    if(!ok || M%2 == 1){ cout << "-1\n"; return; }
    if(D[0] > M/2){
        for(auto& u : U) u = N-1-u;
        for(auto& u : V) u = N-1-u;
        swap(U, V);
    }
    string ans = string(M, 'R');
    i64 cnt = 0;
    rep(i,M) if(U[i] == 0){ cnt++; ans[i] = 'B'; }
    rep(i,M) if(ans[i] != 'B' && cnt < M/2 && V[i] != N-1){ cnt++; ans[i] = 'B'; }
    cout << ans << "\n";
}

int main(){
    ios::sync_with_stdio(false); cin.tie(nullptr);
    rep(t,1) testcase();
    return 0;
}