#include <bits/stdc++.h>
using namespace std;

template <typename A, typename B>
string to_string(pair<A, B> p);
 
template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p);
 
template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p);
 
string to_string(const string& s) {
  return '"' + s + '"';
}
 
string to_string(const char* s) {
  return to_string((string) s);
}
 
string to_string(bool b) {
  return (b ? "true" : "false");
}
 
string to_string(vector<bool> v) {
  bool first = true;
  string res = "{";
  for (int i = 0; i < static_cast<int>(v.size()); i++) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(v[i]);
  }
  res += "}";
  return res;
}
 
template <size_t N>
string to_string(bitset<N> v) {
  string res = "";
  for (size_t i = 0; i < N; i++) {
    res += static_cast<char>('0' + v[i]);
  }
  return res;
}
 
template <typename A>
string to_string(A v) {
  bool first = true;
  string res = "{";
  for (const auto &x : v) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(x);
  }
  res += "}";
  return res;
}
 
template <typename A, typename B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
 
template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p) {
  return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " + to_string(get<2>(p)) + ")";
}
 
template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p) {
  return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " + to_string(get<2>(p)) + ", " + to_string(get<3>(p)) + ")";
}
 
void debug_out() { cerr << endl; }
 
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}
#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif

#define fi first
#define se second
#define pb push_back
#define mod(n,k) ( ( ((n) % (k)) + (k) ) % (k))
#define forn(i,a,b) for(int i = a; i < b; i++)
#define forr(i,a,b) for(int i = a; i >= b; i--)
#define all(x) (x).begin(), (x).end()

typedef long long ll;
typedef long double ld;
typedef pair<int,int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;

const int mod = 3;
int sum(int a, int b){return (a+b) % mod;}
int sub(int a, int b){return (a + mod - b) % mod;}
int mul(int a, int b){return (1ll * a * b) % mod;}
int power(int a,int b){
	int res = 1;
	while(b){
		if(b&1)res = mul(res,a);
		b >>= 1;
		a = mul(a,a);
	}
	return res;
}
const int maxn = 400010;
int fac[maxn],caf[maxn],pot[maxn]; 
int deg(int x,int d){
	d %= mod - 1;
    if(d < 0)d += mod - 1;
    int y = 1;
    while(d){
		if (d & 1)y = mul(y,x);
        x = mul(x,x);
        d /= 2;
    }
    return y;
}
int coeff(int n,int k){
	return mul(fac[n],mul(caf[k],caf[n-k]));
}

int main(){
	ios_base::sync_with_stdio(0); cin.tie(0);
	fac[0] = caf[0] = 1;
	forn(i,1,maxn){
		int act = i;
		int add = 0;
		while(act%3 == 0){
			act /= 3;
			add++;
		}
		fac[i] = mul(act,fac[i-1]);
		pot[i] = add+pot[i-1];
		caf[i] = deg(fac[i],-1);
	}
	//forn(i,1,10){
		//debug(i,fac[i],caf[i],pot[i]);
	//}
	int N; cin >> N;
	string str; cin >> str;
	map<char,int> val = {{'B',0},{'W',1},{'R',2}};
	map<int,char> rev = {{0,'B'},{1,'W'},{2,'R'}};
	int act = 0;
	int sig = (N%2 == 0) ? -1 : 1;
	forn(i,0,N){
		if(i == 0 || i == N-1){
			act = sum(act,mul(sig,val[str[i]]));
		}else{
			int p1 = pot[N-1];
			int p2 = pot[i]+pot[N-1-i]; 
			int p = p1-p2;
			int add = mul(mul(coeff(N-1,i),val[str[i]]),sig);
			if(p >= 0){
				add = mul(add,power(3,p));
			}else{
				add = power(3,p);
			}
			act = sum(act,add);
			//debug(N-1,i,coeff(N-1,i),add,p);
		}
	}
	if(act < 0)act += mod;
	cout << rev[act] << '\n';
	
	return 0;
}
/*
__builtin_mul_overflow(x,y,&x)
-fsplit-stack
*/

#pragma GCC optimize ("-O3")
#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
#define forn(i,x,n) for(ll i=x;i<n;i++)
#define pb push_back
#define int             long long
#define mp make_pair
#define debug(x) cout<<x<<"\n";
#define lb lower_bound
#define ub upper_bound
#define bs binary_search
#define mod 1000000007
#define endl '\n'
#define N 1000000
int n,m,k,b,c,d,x,y,z,e,v,r,w,f;
string s;
int a[1000000];
void least_prime_factor(vector<int>&lpf,vector<int>&mobius)
{
    for (int i = 2; i < 2000000; i++)
 
        // If it is a prime number
        if (!lpf[i])
 
            for (int j = i; j < 2000000; j += i)
 
                // For all multiples which are not
                // visited yet.
                if (!lpf[j])
                    lpf[j] = i;
}
 
// Function to find the value of Mobius function
// for all the numbers from 1 to n
void Mobius(vector<int>&lpf,vector<int>&mobius)
{
    for (int i = 1; i < 2000000; i++) {
 
        // If number is one
        if (i == 1)
            mobius[i] = 1;
        else {
 
            // If number has a squared prime factor
            if (lpf[i / lpf[i]] == lpf[i])
                mobius[i] = 0;
 
            // Multiply -1 with the previous number
            else
                mobius[i] = -1 * mobius[i / lpf[i]];
        }
    }
}
 
// Function to find the number of pairs
// such that gcd equals to 1
int gcd_pairs(vector<int>&a, int n,vector<int>&lpf,vector<int>&mobius)
{
    // To store maximum number
    int maxi = 0;
 
    // To store frequency of each number
    vector<int>fre(2000000,0);
 
    // Find frequency and maximum number
    for (int i = 0; i < n; i++) {
        fre[a[i]]++;
        maxi = max(a[i], maxi);
    }
 
    least_prime_factor(lpf,mobius);
    Mobius(lpf,mobius);
 
    // To store number of pairs with gcd equals to 1
    int ans = 0;
 
    // Traverse through the all possible elements
    for (int i = 1; i <= maxi; i++) {
        if (!mobius[i])
            continue;
 
        int temp = 0;
        for (int j = i; j <= maxi; j += i)
            temp += fre[j];
 
        ans += temp * (temp - 1) / 2 * mobius[i];
    }
 
    // Return the number of pairs
    return ans;
}
 
// Driver code
int32_t main()
{
     ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
   //std::cout << fixed<< std::setprecision(3);
  
   int  t;
    t=1;
    //cin>>t;
    while(t--)
    {   
     cin>>x>>y;
    vector<int>a(y-x+1);
    vector<int>lpf(2000000,0);
    vector<int>mobius(2000000,0);

    int j=0;
    for(int i=x;i<=y;i++)
    {
    	 a[j++]=i;
	}
    int n =y-x+1;
 
    // Function call
    int ah=n-1;
    int ans=((ah)*(ah+1))/2;
   int temp= gcd_pairs(a, n,lpf,mobius);
    ans-=temp;
    if(x==1)
     x++;
	  for(int i=x;i<=y;i++)
	  {    
	      int l=i;
	      j=2;
	  	 while((i*j)<=y)
	  	 {
	  	 	 j++;
	  	 	 ans--;
		   }
	  }
	  ans=ans*2;
	  cout<<ans<<endl;
 
  }
   
}