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

#define rep(i,n) for(int i = 0; i < n; i++)
#define Rep(i,n) for(int i = 1; i <= n; i++)
#define sz(a) int(a.size())
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define debug(a) { cerr << #a << ": " << a << endl; }
#define endl '\n'
#define fi first
#define se second
using lint = long long;
using P = pair<int,int>;
template<class T> using V = vector<T>;
template<class T> using priq     = priority_queue<T>;
template<class T> using priq_inv = priority_queue<T, vector<T>, greater<T>>;
const int dx[] = {0,1,0,-1,1,1,-1,-1};
const int dy[] = {1,0,-1,0,1,-1,-1,1};
template<class T> T ceil(const T &a, const T &b) { return (a+b-1)/b; }
template<class T> bool chmin(T &a, T b) { if(a > b) { a = b; return 1; } return 0; }
template<class T> bool chmax(T &a, T b) { if(a < b) { a = b; return 1; } return 0; }
struct INF { template<class T> operator T() { return numeric_limits<T>::max() / 2; } } INF;

template<class T, class U> istream& operator>>(istream &in, pair<T,U> &p) {
    return in >> p.first >> p.second;
}
template<class T, class U> ostream& operator<<(ostream &out, const pair<T,U> &p) {
    return out << p.first << ' ' << p.second;
}
template<class T> istream& operator>>(istream &in, vector<T> &v) {
    for(auto &&e: v) in >> e;
    return in;
}
template<class T> ostream& operator<<(ostream &out, const vector<T> &v) {
    for(const auto &e: v) out << e << ' ';
    return out;
}

/*----------------------------------------------------------------------------------------------------*/

long long Modpow(long long a, int n, long long mod){
    if(n == 0) return 1;
    if(n%2 == 0){
      long long res = Modpow(a, n/2, mod);
      return res * res % mod;
    }
    return a * Modpow(a, n-1, mod) % mod;
}

const int MX = 1e6+5;

int main() {
    int n;
    cin >> n;
    string s;
    cin >> s;
    V<int> a(n);
    rep(i,n) {
        if(s[i] == 'B') a[i] = 0;
        if(s[i] == 'W') a[i] = 1;
        if(s[i] == 'R') a[i] = 2;
    }

    V<int> fact(MX);
    V<int> cnt(MX);
    fact[0] = 1;
    Rep(i,MX-1) {
        fact[i] = fact[i-1];
        cnt[i] = cnt[i-1];
        if(i%3 == 0) {
            int j = i;
            while(j%3 == 0) cnt[i]++, j /= 3;
            fact[i] *= j, fact[i] %= 3;
        }
        else fact[i] *= i, fact[i] %= 3;
    }

    int d = n-1;
    lint tot = 0;
    rep(i,n) { // dCi % 3
        int cnt3 = cnt[d]-(cnt[i]+cnt[d-i]);
        if(cnt3) continue;
        tot += fact[d]*fact[i]*fact[d-i] % 3 * a[i];
        // cout << fact[d]*fact[i]*fact[d-i] % 3 << endl;
    }
    if(d % 2 == 1) tot = (3-tot) % 3;
    tot = ((tot % 3) + 3) % 3;
    if(tot == 0) cout << 'B' << endl;
    if(tot == 1) cout << 'W' << endl;
    if(tot == 2) cout << 'R' << endl;
}
#pragma GCC optimize ("O2")
#pragma GCC target ("avx2")
//#include<bits/stdc++.h>
//#include<atcoder/all>
//using namespace atcoder;
#include<iostream>

using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define Would
#define you
#define please

const int mod = 1e9 + 7;
int dp[2][100][100];
int AB[200], *A = AB, *B = AB + 100;
constexpr ll modpow(ll A, ll B) {
	ll kotae = 1;
	while (B > 0) {
		if (B & 1) kotae = kotae * A % mod;
		A = A * A % mod;
		B >>= 1;
	}
	return kotae;
}
int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);


	int N, M, K;
	cin >> N >> M >> K;
	rep(i, N) {
		cin >> A[i];
	}
	auto mae = dp[0], ato = dp[1];
	int are = modpow(2 * M, mod - 2);

	rep(i, M) {
		int x, y;
		cin >> x >> y;
		x--;
		y--;
		if (x < y) swap(x, y);
		mae[x][x]--;
		mae[x][y]++;
		mae[y][y]--;
	}
	rep(x, N) rep(y, x + 1) {
		mae[x][y] = (ll(mae[x][y] + mod) * are + (x == y)) % mod;
		mae[y][x] = mae[x][y];
	}

	const ll ma = (1ll << 32) - 1;

	rep(i, 30) {
		if (K >> i & 1) {
			rep(i, N) {
				ll t1 = 0, t2 = 0;
				rep(j, N) {
					auto tmp = (ll)mae[i][j] * A[j];
					t1 += tmp >> 32;
					t2 += tmp & ma;
				}
				B[i] = ((t1 % mod << 32) + t2) % mod;
			}
			swap(A, B);
		}
		if (!K | i >= 31 - __builtin_clz(K)) break;
		rep(x, N) rep(y, x + 1) {
			auto tmp1 = mae[x];
			auto tmp2 = mae[y];
			ll t1 = 0, t2 = 0;
			rep(z, N) {
				auto tmp = *tmp1++ * (ll)*tmp2++;
				t1 += tmp >> 32;
				t2 += tmp & ma;
			}
			ato[y][x] = (ato[x][y] = ((t1 % mod << 32) + t2) % mod);
		}
		swap(mae, ato);
	}

	rep(i, N) co(A[i]);


	Would you please return 0;
}