#pragma warning(disable : 4996)
#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<ll> vll;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pld;
typedef tuple<ll,ll,ll> tl3;
#define FOR(a, b, c) for (int(a) = (b); (a) < (c); ++(a))
#define FORN(a, b, c) for (int(a) = (b); (a) <= (c); ++(a))
#define rep(i, n) FOR(i, 0, n)
#define repn(i, n) FORN(i, 1, n)
#define tc(t) while (t--)
// https://atcoder.jp/contests/hhkb2020/tasks/hhkb2020_c
int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    ll n;
    cin >> n;
    vll v(n);
    map<ll,ll> isUsed;
    ll min = 0;
    rep(i,n){
        cin >> v[i];
        isUsed[v[i]]++;
        for(;;min++){
            if(isUsed[min] == 0){
                break;
            }
        }
        cout << min << "\n";
    }

    return 0;
}
#include <stdio.h>
#define MOD 3

int fact[400010],count[400010];
char x[400010];
int comb(int a, int b)
{
	if(count[a]>count[b]+count[a-b]) return 0;
	else return (fact[a]*fact[b]*fact[a-b])%MOD;
}
int main()
{
	fact[0] = 1;
	count[0] = 0;
	for(int i=1;i<=400000;i++)
	{
		int c = i;
		count[i] = count[i-1];
		while(c%MOD==0)
		{
			c/=MOD;
			count[i]++;
		}
		fact[i] = (fact[i-1]*c)%MOD;
	}
	
	int a;
	scanf("%d",&a);
	scanf("%s",x+1);
	
	int sum = 0;
	for(int i=1;i<=a;i++)
	{
		int c;
		if(x[i]=='W') c = 0;
		if(x[i]=='B') c = 1;
		if(x[i]=='R') c = 2;
		sum += comb(a-1,i-1)*c;
		sum %= MOD;
	}
	if(a%2==1)
	{
		if(sum==0) printf("W");
		if(sum==1) printf("B");
		if(sum==2) printf("R");
	}
	else
	{
		if(sum==0) printf("W");
		if(sum==1) printf("R");
		if(sum==2) printf("B");
	}
}