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

// modpow
template<class T> T modpow(T b,T p,T m){
  T rt = 1; b %= m;
  while(p>0){
    if(p&1) rt = (rt*b)%m;
    b = (b*b)%m; p>>=1;
  }
  return rt;
}

// small mod combination
// # f,g を次のようにする
// - f[i] : i が何回 MOD で割れるか. これを f_pre とする
// - g[i] : i の MOD で割れない部分の MOD での余り. これを g_pre とする
// # その後, f,g を次のようにする
// - f[i] : i! が何回 MOD で割れるか
//   * f[i] = f_pre[1]+...+f_pre[i] 累積和
// - g[i] : i! が MOD で割れない部分の MOD での余り
//   * g[i] = g_pre[1]*...*g_pre[i] 累積積(mod)
const int64_t MOD = 3;
const int64_t fMAX = 400007;
int64_t f[fMAX+1],g[fMAX+1],g_inv[fMAX+1];

void init(){
  for(int64_t i=1,tmp;i<=fMAX;i++){
    tmp = i;
    while(tmp%3==0){
      tmp /= 3; f[i]++;
    }
    g[i] = tmp%3;
  }
  g[0]=1;
  for(int64_t i=1;i<=fMAX;i++)
    f[i] += f[i-1];
  for(int64_t i=1;i<=fMAX;i++)
    g[i] = g[i]*g[i-1]%MOD;
  for(int64_t i=0;i<=fMAX;i++)
    g_inv[i] = modpow(g[i],MOD-2,MOD);
  return;
}

int64_t modcomb_s(int64_t n,int64_t r,int64_t m){
  if(f[n]-f[r]-f[n-r]>0) return 0;
  return g[n]*g_inv[r]*g_inv[n-r]%m;
}

int main(){
  std::cin.tie(nullptr);
  std::cout.tie(nullptr);
  ios::sync_with_stdio(false);

  int64_t n; cin >> n;
  string s; cin >> s;

  init();
  vector<int64_t> a(n);
  for(int64_t i=0;i<n;i++){
    if(s[i]=='B') a[i] = 0;
    else if(s[i]=='R') a[i] = 1;
    else if(s[i]=='W') a[i] = 2;
  }
  int64_t ans=0;
  for(int64_t i=0;i<n;i++){
    ans += a[i] * modcomb_s(n-1,i,MOD);
    ans %= MOD;
  }

  ans = ans * modpow((int64_t)2,n-1,MOD) % MOD;

  string ans_s;
  if(ans==0) ans_s='B';
  else if(ans==1) ans_s='R';
  else if(ans==2) ans_s='W';

  cout << ans_s << "\n";

  return 0;
}

// KNOW NOTHING!
#include <bits/stdc++.h>
#define ll long long int
#define F(i,j,k,in) for(int i=j;i<k;i+=in)
#define DF(i,j,k,in) for(int i=j;i>=k;i-=in)
#define feach(it,l) for (auto it = l.begin(); it != l.end(); ++it)
#define fall(a) a.begin(),a.end()
#define sz(x) (int)x.size()
#define szs(x) (int)x.length()
#define pb push_back
#define ub upper_bound
#define lb lower_bound
#define eq equal_range
#define fs first
#define ss second
#define ins insert
#define mkp make_pair
#define endl "\n"
using namespace std;
typedef vector<ll> vll;
typedef vector<int> vin;
typedef vector<char> vch;
typedef vector<string> vst;
typedef set<ll> sll;
typedef set<int> sint;
typedef set<char> sch;
typedef set<string> sst;
typedef queue<ll> qll;
typedef queue<int> qin;
typedef deque<ll> dqll;
typedef deque<int> dqint;
typedef priority_queue<ll> pqll;
typedef priority_queue<int> pqin;
typedef map<ll,ll> mpll;
typedef map<int,int> mpin;
typedef pair<ll,ll> pll;
typedef pair<int,int> pin;
const ll MOD=1000000007;
const long double PI=3.1415926535897932384626433832795;
ll pwr(ll b,ll p){ll res=1;while(p){if(p&1) {res*=b; p--;}else{b*=b; p>>=1;}}return res;}
ll mpwr(ll b,ll p){ll res=1;while(p){if(p&1) {res=(res*b)%MOD; p--;}else{b=(b*b)%MOD; p>>=1;}}return res;}
int msb (int n) {return 31-__builtin_clz(n);}
ll msbl (ll n) {return 63-__builtin_clzll(n);}
int lsb (int n) {return __builtin_ctz(n);}
ll  lsbl (ll n) {return __builtin_ctzll(n);}
int setbit (int n) {return __builtin_popcount(n);}
ll setbitl (ll n) {return __builtin_popcountll(n);}
int main()
{
/*
freopen ("input.txt","r","stdin");
freopen ("output.txt","w","stdout");
*/
ios_base::sync_with_stdio(false) , cin.tie(NULL) , cout.tie(NULL);
int h,w; cin>>h>>w;
int x, y; cin>>x>>y;
vector<string> v (h);
F (i,0,h,1) cin>>v[i];
--x; --y;
int cnt=0;
DF (i,y,0,1) {
	if (v[x][i]=='#') break;
	else ++cnt;
}
F (i,y+1,w,1) {
	if (v[x][i]=='#') break;
	else ++cnt;
}
DF (i,x-1,0,1) {
	if (v[i][y]=='#') break;
	else ++cnt;
}
F (i,x+1,h,1) {
	if (v[i][y]=='#') break;
	else ++cnt;
}
cout<<cnt;
return 0;
}
/* What we know is a drop , but what we don't know is an ocean !*/