#include #include #include using namespace atcoder; using mint = modint998244353; using namespace std; #define rep(i,n) for (int i = 0; i < (n); ++i) #define Inf 1000000001 unsigned long xor128() { static unsigned long x=123456789, y=362436069, z=521288629, w=88675123; unsigned long t=(x^(x<<11)); x=y; y=z; z=w; return (w=(w^(w>>19))^(t^(t>>8))); } int main(){ int N,M; cin>>N>>M; vector A(M),B(M); vector> E(N); rep(i,M){ cin>>A[i]>>B[i]; A[i]--;B[i]--; E[A[i]].push_back(B[i]); } rep(i,N){ vector visited(N,false); visited[i] = true; queue Q; Q.push(i); while(Q.size()>0){ int u = Q.front(); Q.pop(); rep(j,E[u].size()){ int v = E[u][j]; if(visited[v])continue; visited[v] = true; Q.push(v); } } rep(j,N){ if(!visited[j]){ cout<<-1< dis(N,Inf); stack Q; int X = xor128()%N; Q.push(X); dis[X] = 0; while(Q.size()>0){ int u = Q.top(); Q.pop(); rep(i,E[u].size()){ int v = E[u][i]; if(dis[v]==Inf)continue; dis[v] = dis[u] + 1; Q.push(v); } } string t = "RBBR"; string ans = ""; rep(i,M){ ans += t[dis[A[i]]%4]; } cout<