#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define fr(i,n) for(int i=0;i<n;i++)
#define fro(i,j,n) for(int i=j;i<n;i++)
#define ifr(i,n) for(int i=n-1;i>=0;i--)

char change(char x,char y){
  char list[3]={'R','W','B'};
  if(x==y)return x;
  else{
    fr(i,3){
      if(x!=list[i]&&y!=list[i]) return list[i];
    }
  }
}

int main() {
    int n;
	cin >> n;
    string c;
    cin >> c;
    int a=1;
    while(a<n-1){
      a*=3;
    }
    while(n>1){
      while(a>n-1){a/=3;}
      fr(i,n-a){
        c[i]=change(c[i],c[i+a]);
      }
      n-=a;
    }
    cout << c[0] << endl;
}
#include<bits/stdc++.h>
#define REP(i,b,e) for(int i=b; i<e; i++)

struct binom_mod3 {
	std::vector<int> quo, rem;
	binom_mod3(int n): quo(n), rem(n) {
		quo[0] = 0;
		rem[0] = 1;
		for(int i=1; i<n; i++){
			int m = i, cnt = 0;
			while(m%3==0){
				m /= 3;
				cnt++;
			}
			quo[i] = quo[i-1] + cnt;
			rem[i] = rem[i-1] * m % 3;
		}
	}
	
	int eval(int n, int k){
		assert(n < quo.size());
		if(n<0 || k<0 || n<k) return 0;
		if(quo[n] > quo[k] + quo[n-k]) return 0;
		int num = rem[n], den = rem[k] * rem[n-k] % 3;
		return num * den % 3;
	}
};

int main(){
	int n;
	scanf("%d", &n);

	getchar();
	binom_mod3 bi3(5e5);

	int m = 0;
	REP(i, 0, n){
		char c = getchar();
		int a = (c=='B')? 0: (c=='W')? 1:2;
		m += a * bi3.eval(n-1, i) % 3;
		m %= 3;
	}
	if(n%2==0) m = (3 - m) % 3;
	printf("%c\n", "BWR"[m%3]);
	return 0;
}

