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

int n;
char s[400011];
int f[400011];
int c3[400011];

int getc(int m,int k)
{
    if(c3[m]>c3[k]+c3[m-k])
    {
        return 0;
    }

    return f[m]*f[k]*f[m-k]%3;
}

int main()
{
    int i,j,k;
    cin>>n;
    cin>>s+1;

    memset(f,0,sizeof(f));
    memset(c3,0,sizeof(c3));
    f[0]=1;
    c3[0]=0;
    for(i=1;i<=n;i++)
    {
        int x=i;
        while(x%3==0)
        {
            c3[i]++;
            x/=3;
        }
        f[i]=f[i-1]*x%3;
        c3[i]+=c3[i-1];

        //cout<<f[i]<<' '<<c3[i]<<' '<<x<<endl;
    }

    int ans=0;
    for(i=1;i<=n;i++)
    {
        int cur;
        if(s[i]=='B')
        {
            cur=0;
        }
        else if(s[i]=='W')
        {
            cur=1;
        }
        else if(s[i]=='R')
        {
            cur=2;
        }

        int p=getc(n-1,i-1);

        //cout<<cur<<' '<<p<<endl;
        ans=(ans+p*cur)%3;
    }

    if(n%2==0)
    {
        ans=(-ans+3)%3;
    }

    if(ans==0)
    {
        cout<<'B'<<endl;
    }
    else if(ans==1)
    {
        cout<<'W'<<endl;
    }
    else if(ans==2)
    {
        cout<<'R'<<endl;
    }

    return 0;
}


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

#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define MIN(a) *min_element(all(a))
#define MAX(a) *max_element(all(a))
#define SUM(a) accumulate(all(a), 0LL)
#define REP(i, n) for(int (i)=0; (i)<(n); (i)++)
#define RREP(i, n) for(int (i)=(n)-1; (i)>=0; (i)--)
#define FOR(i, m, n) for(int (i)=(m); (i)<(n); i++)
#define FORR(i, m, n) for(int (i)=(n)-1; (i)>=(m); i--)
#define debug(x) cerr << #x << " = " << x << endl
//#define int long long

typedef long long ll;
//ll const MOD = 998244353;
ll const MOD = 1e9+7;
int const inf = 1e9;
ll const INF = 1e18;

inline void ios_(){cin.tie(0); ios::sync_with_stdio(false);}
template<typename T> int size(const T& a){return (int)a.size();}
template<typename T> T Div(T a, T b){return (a + b - 1) / b;}
template<typename T> bool chmin(T& a, const T& b){if(a > b){a = b; return true;} return false;}
template<typename T> bool chmax(T& a, const T& b){if(a < b){a = b; return true;} return false;}



signed main(){
    int n, k, m;
    cin >> n >> k >> m;
    int score = 0;
    REP(i, n-1){
        int a;
        cin >> a;
        score += a;
    }
    int po = n*m - score;
    if(po > k){
        cout << -1 << endl;
    }else{
        cout << max(0, po) << endl;
    }
    return 0;
}
