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

string dfs(int n,string s){
    if(n == 1)return s;
    while(n%3!=1){
        string t;
        for(int i=1;i<n;i++){
            if(s[i]==s[i-1])t+=s[i];
            else {
                int x = 'R'+'W'+'B';
                x -= s[i] + s[i-1];
                t += (char)x;
            }
        }
        swap(t,s);
        n--;
    }
    string t;
    for(int i=0;i<n;i+=3)t+=s[i];
    return dfs((int)t.size(),t);
}

int main(){
    int n;
    cin>>n;
    string s;
    cin>>s;
    cout << dfs(n,s) << endl;
}
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;

const LL mod = 998244353;

LL f[3010][6010], s[6010];
int n, k;

int main() {
	cin >> n >> k;
	f[0][0] = 1;
	s[0] = 1;
	for (int i = 1; i <= n; i++)
		for (int j = i; j >= 1; j--) {
			f[i][j] = s[i * 2 - j * 2];
			s[i * 2 - j] = (s[i * 2 - j] + f[i][j]) % mod;
		}
	cout << f[n][k] << endl;
	return 0;
}