#include <bits/stdc++.h>

const int N = 400010;

int n, C[3][3];
char str[N];

int Lucas(int n, int m) {
	if (!n || !m) return 1;
	return 1ll * Lucas(n / 3, m / 3) * C[n % 3][m % 3] % 3;
}
int main() {
	scanf("%d", &n);
	scanf("%s", str);
	C[0][0] = 1;
	C[1][0] = C[1][1] = 1;
	C[2][0] = 1; C[2][1] = 2; C[2][2] = 1;
	int ans = 0;
	for (int i = 0; i < n; i ++) {
		int t;
		if (str[i] == 'W') t = 0;
		else if (str[i] == 'B') t = 1;
		else t = 2;
		ans = (ans + 1ll * Lucas(n - 1, i) * t % 3) % 3;
	}
	if (n % 2 == 0) ans = (-ans	 + 3) % 3;
	if (!ans) puts("W");
	else if(ans == 1) puts("B");
	else puts("R");
	return 0;
}
#include<bits/stdc++.h>
using namespace std;
#define arep(i,x,n) for(int i=int(x);i<(int)(n);i++)
#define rep(i,n) for(int i = 0;i < n;++i)
#define rrep(i,n) for(int i=int(n-1);i>=0;i--)
#define fs first
#define sc second
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).begin(), (x).end()
#define coy cout<<"Yes"<<endl
#define con cout<<"No"<<endl
#define pi 3.141592653589793
#define eps 0.00000001
#define INF 1e9+7
#define LINF 1e18+10  
using ll = long long;

using P = pair<int, int>;
using lP = pair<ll, ll>;
using fP = pair<double, double>;
using PPI = pair<P, int>;
using PIP = pair<int, P>;
using Ps = pair<int, string>;

using vi = vector<int>;
using vl = vector<ll>;
using vc = vector<char>;
using vd = vector<double>;
using vs = vector<string>;
using vp = vector<P>;
using vb = vector<bool>;
using vvi = vector<vector<int>>;
using vvl = vector<vector<ll>>;
using vvd = vector<vector<double>>;
using vvc = vector<vector<char>>;
using vvp = vector<vector<P>>;
using vvb = vector<vector<bool>>;
template <typename T>
bool chmax(T& a, const T b) { if (a < b) { a = b; return true; } return false; }
template <typename T>
bool chmin(T& a, const T b) { if (a > b) { a = b; return true; } return false; }

//const ll mod=998244353;
const ll mod = 1e9 + 7;
const ll MAX =  100;
template <typename T>
T abs(T a) { if (a < 0)return -a; else return a; }//2020/09/30 stdlib has abs(long) abs(long long) error

//////////////////////////////////////

int main(){
    int t;
    cin>>t;
    vl res;
    rep(i,t){
        ll l,r;
        cin>>l>>r;

        ll ans=max((ll)0,(r-2*l+1)*(r-2*l+2)/2);
        if(r-2*l+1<0)ans=0;
        res.push_back(ans);
    }
    for(auto x:res)cout<<x<<endl;
    return 0;
}