N,M=map(int,input().split()) G=[[] for i in range(N+1)] if M%2==1: print(-1) exit() for i in range(M): x,y=map(int,input().split()) if x>y: x,y=y,x if x==1 and y==N: print(-1) exit() G[y].append((x,i)) G[x].append((y,i)) c=0 result=['B']*M if len(G[1])<=M//2: for B in G[1]: y,pos=B[:] result[pos]='R' c+=1 else: for B in G[y]: y,pos=B[:] result[pos]='R' for x in range(1,N+1): if c==M//2: break for B in G[x]: y,pos=B[:] if result[pos]=='R': continue result[pos]='R' c+=1 if c==M//2: break print(*result,sep='')