#include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for (int i = a; i < (b); ++i)
#define rrep(i, a, b) for (int i = a; i >= (b); --i)
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
template <typename T>
void update_max(T& a, T b) {
    if (b > a) a = b;
}
template <typename T>
void update_min(T& a, T b) {
    if (b < a) a = b;
}
struct Tree {
    typedef int T;
    static constexpr T unit = 0;
    T f(T a, T b) { return a ^ b; }  // (any associative fn )
    vector<T> s;
    int n;
    Tree(int n = 0, T def = unit) : s(2 * n, def), n(n) {}
    void update(int pos, T val) {
        for (s[pos += n] = val; pos /= 2;)
            s[pos] = f(s[pos * 2], s[pos * 2 + 1]);
    }
    T query(int b, int e) {  // query [ b , e)
        T ra = unit, rb = unit;
        for (b += n, e += n; b < e; b /= 2, e /= 2) {
            if (b % 2) ra = f(ra, s[b++]);
            if (e % 2) rb = f(s[--e], rb);
        }
        return f(ra, rb);
    }
};
int main() {
#ifdef LOCAL_PROJECT
    freopen("input.txt", "r", stdin);
#endif
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n, q, a;
    cin >> n >> q;
    Tree tree(n);
    rep(i, 0, n) {
        cin >> a;
        tree.update(i, a);
    }
    int t, x, y;
    rep(i, 0, q) {
        cin >> t >> x >> y;
        if (t == 1) {
            tree.update(x - 1, tree.s[x - 1 + tree.n] ^ y);
        } else {
            cout << tree.query(x - 1, y) << endl;
        }
    }
    return 0;
}
#include <bits/stdc++.h>
using ll = long long;
using namespace std;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);

    int n;
    cin >> n;

    string c;
    cin >> c;

    char a[] = "BWR";
    for (int i = 0; i < n; i++) {
        c[i] = c[i] == a[0] ? 0 : c[i] == a[1] ? 1 : 2;
    }

    int t = 0, s = 0, r = 1;
    for (int i = 0; i < n; i++) {
        //comb(n - 1, i) * c[i];
        if (i > 0) {
            int a0 = n - i;
            int a1 = i;
            while (a0 % 3 == 0) a0 /= 3, s++;
            while (a1 % 3 == 0) a1 /= 3, s--;
            r *= a0;
            r %= 3;
            r *= a1;
            r %= 3;
        }
        int x = s > 0 ? 0 : r;
        if (n % 2 == 0 && x != 0) x ^= 3;
        t += x * c[i];
    }

    cout << a[t % 3] << endl;

    return 0;
}