#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/rope>
using namespace __gnu_pbds;
using namespace __gnu_cxx;
using namespace std;
typedef tree<int,null_type,less<int>,rb_tree_tag,
tree_order_statistics_node_update> indexed_set;
// order_of_key (val): returns the no. of values less than val
// find_by_order (k): returns the iterator to kth largest element.(0-based)
typedef long long int lli;
#define pb emplace_back
#define mp make_pair
#define ff first
#define ss second
#define pii pair<int,int>
#define vi vector<int>
#define vpii vector<pair<int,int>>
#define vc vector<char>
#define vs vector<string>
#define FOR(i,a,b) for (int i = a; i < b; i++)
#define FORD(i,a,b) for (int i = a; i >= b; i--)
#define fastio	ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
/*-------CONSTANTS------- */
const int MAXN = 1000005;
const int SQRTN = 1003;
const int LOGN = 22;
const double PI=acos(-1);
const int INF = 1000000000;
const int MOD = 1000000007;
const int FMOD = 998244353;
const double eps = 1e-9;
/*-----------------------------MATH STUFF----------------------------- */
template<typename T> T gcd(T a, T b){return(b?__gcd(a,b):a);}
template<typename T> T lcm(T a, T b){return(a*(b/gcd(a,b)));}
int mod_neg(int a, int b, int c){int res;if(abs(a-b)<c)res=a-b;else res=(a-b)%c;return(res<0?res+c:res);}
int mulmod(int a, int b, int c){lli res=(lli)a*b;return(res>=c?res%c:res);}
template<typename T>T power_mod(T e, T n, T m){T x=1,p=e;while(n){if(n&1)x=mulmod(x,p,m);p=mulmod(p,p,m);n>>=1;}return x;}
template<typename T>T extended_euclid(T a, T b, T &x, T &y){T xx=0,yy=1;y=0;x=1;while(b){T q=a/b,t=b;b=a%b;a=t;\
t=xx;xx=x-q*xx;x=t;t=yy;yy=y-q*yy;y=t;}return a;}
template<typename T>T mod_inverse(T a, T n){T x,y,z=0;T d=extended_euclid(a,n,x,y);return(d>1?-1:mod_neg(x,z,n));}
//Factorials upto 1e5%MOD,nCr%MOD,nPr%MOD
lli fact[100000+5],fact_modinv[100000+5];
void fact_init(){
    fact[0] = 1ll;
    fact_modinv[0] = mod_inverse(fact[0],1ll*MOD);
    for(int i = 1;i<=100000;i++){
        fact[i] = mulmod(fact[i-1],i,1ll*MOD);
        fact_modinv[i] = mod_inverse(fact[i],1ll*MOD);
    }
}
lli choose(int n,int r){
    return mulmod(fact_modinv[n-r],mulmod(fact[n],fact_modinv[r],MOD),MOD);
}
lli P(int n,int r){
    return mulmod(fact[n],fact_modinv[n-r],1ll*MOD);
}
/*-----------------------------START----------------------------- */

multiset<char> pq;
string s,t;

int main(){
    fastio;
    cin>>s>>t;
    for(auto x : t){
        pq.insert(x);
    }
    int cnt1 = 0,cnt2 = 0;

    for(auto x : s){
        char ch = x;
        if((x - 'A') >=0 && (x - 'A') < 26){
            ch += 32;
        }else{
            ch -= 32;
        }
        if(pq.find(x) != pq.end()){
            cnt1++;
            pq.erase(pq.find(x));
        }else if(pq.find(ch) != pq.end()){
            cnt2++;
        }
    }

    cout<<cnt1<<" "<<cnt2<<endl;

    return 0;
}


#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/rope>
using namespace __gnu_pbds;
using namespace __gnu_cxx;
using namespace std;
typedef tree<int,null_type,less<int>,rb_tree_tag,
tree_order_statistics_node_update> indexed_set;
// order_of_key (val): returns the no. of values less than val
// find_by_order (k): returns the iterator to kth largest element.(0-based)
typedef long long int lli;
#define pb emplace_back
#define mp make_pair
#define ff first
#define ss second
#define pii pair<int,int>
#define vi vector<int>
#define vpii vector<pair<int,int>>
#define vc vector<char>
#define vs vector<string>
#define FOR(i,a,b) for (int i = a; i < b; i++)
#define FORD(i,a,b) for (int i = a; i >= b; i--)
#define fastio	ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
/*-------CONSTANTS------- */
const int MAXN = 1000005;
const int SQRTN = 1003;
const int LOGN = 22;
const double PI=acos(-1);
const int INF = 1000000000;
const int MOD = 1000000007;
const int FMOD = 998244353;
const double eps = 1e-9;
/*-----------------------------MATH STUFF----------------------------- */
template<typename T> T gcd(T a, T b){return(b?__gcd(a,b):a);}
template<typename T> T lcm(T a, T b){return(a*(b/gcd(a,b)));}
int mod_neg(int a, int b, int c){int res;if(abs(a-b)<c)res=a-b;else res=(a-b)%c;return(res<0?res+c:res);}
int mulmod(int a, int b, int c){lli res=(lli)a*b;return(res>=c?res%c:res);}
template<typename T>T power_mod(T e, T n, T m){T x=1,p=e;while(n){if(n&1)x=mulmod(x,p,m);p=mulmod(p,p,m);n>>=1;}return x;}
template<typename T>T extended_euclid(T a, T b, T &x, T &y){T xx=0,yy=1;y=0;x=1;while(b){T q=a/b,t=b;b=a%b;a=t;\
t=xx;xx=x-q*xx;x=t;t=yy;yy=y-q*yy;y=t;}return a;}
template<typename T>T mod_inverse(T a, T n){T x,y,z=0;T d=extended_euclid(a,n,x,y);return(d>1?-1:mod_neg(x,z,n));}
//Factorials upto 1e5%MOD,nCr%MOD,nPr%MOD
lli fact[100000+5],fact_modinv[100000+5];
void fact_init(){
    fact[0] = 1ll;
    fact_modinv[0] = mod_inverse(fact[0],1ll*MOD);
    for(int i = 1;i<=100000;i++){
        fact[i] = mulmod(fact[i-1],i,1ll*MOD);
        fact_modinv[i] = mod_inverse(fact[i],1ll*MOD);
    }
}
lli choose(int n,int r){
    return mulmod(fact_modinv[n-r],mulmod(fact[n],fact_modinv[r],MOD),MOD);
}
lli P(int n,int r){
    return mulmod(fact[n],fact_modinv[n-r],1ll*MOD);
}
/*-----------------------------START----------------------------- */

multiset<char> pq;
string s,t;

int main(){
    fastio;
    cin>>s>>t;
    for(auto x : t){
        pq.insert(x);
    }
    int cnt1 = 0,cnt2 = 0;

    for(auto x : s){
        if(pq.find(x) != pq.end()){
            cnt1++;
            pq.erase(pq.find(x));
        }
    }

    for(auto x : s){
        char ch = x;
        if((x - 'A') >=0 && (x - 'A') < 26){
            ch += 32;
        }else{
            ch -= 32;
        }
        if(pq.find(ch) != pq.end()){
            cnt2++;
            pq.erase(pq.find(ch));
        }
    }

    cout<<cnt1<<" "<<cnt2<<endl;

    return 0;
}


/*
لا تقهر عبدا حتى لا يؤذيك دعاءه
*/
#include<bits/stdc++.h>
#include <stdlib.h>
#include<assert.h>
using namespace std;
#define PI 3.14159265359
#define OO 1e9
#define S second
#define F first
#define MP                  make_pair
int dx[] = { 0, 0, -1, 1, 1, 1, -1, -1 };
int dy[] = { -1, 1, 0, 0, 1, -1, 1, -1 };
#define sz(v) ( (int) (v.size()) )
#define all(v) v.begin(),v.end()
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

void fast()
{
	std::ios_base::sync_with_stdio(0);
	cin.tie(NULL);
	cout.tie(NULL);
}
int gcd(int a, int b) { return !b ? a : gcd(b, a % b); }
ll lcm(ll a, ll b) { return (a / gcd(a, b)) * b; }
int n, m, c = 0;
int cnt;
bool valid(int i, int j)
{
	return i >= 0 && i < n&&j >= 0 && j<m;
}
int fix(int y) {
	if (y < 0) return m - 1;
	if (y >= m) return 0;
	return y;
}
/*void itfunction_to_Calc_diver_from_1to_1000000()
{
long long div[1000001];
for (long long i = 1; i <= 1000000; i++)
{
for (int j = i; j <= 1000000; j += i)
div[j]++;
}
}*/
long long  mod(long long  a, long long b, long long c)
{
	if (b == 0) return 1;

	if (b % 2 == 0)
	{
		int x = mod(a, b / 2, c);
		return (x*x) % c;
	}
	else return (a%c * mod(a, b - 1, c)) % c;
}
int sumDigit(long long  x)
{
	int c = 0;
	while (x)
	{
		c += x % 10;
		x /= 10;
	}
	return c;
}
int main(){
	fast();
	int lt[26] = { 0 }, LT[26] = { 0 };
	int lt1[26] = { 0 }, LT1[26] = { 0 };
	string s, t;
	cin >> s >> t;
	for (int i = 0; i < sz(s); i++)
	{
		if (s[i] >= 'A'&&s[i] <= 'Z')
			LT[s[i] - 'A']++;
		else
			lt[s[i] - 'a']++;
	}
	for (int i = 0; i < sz(t); i++)
	{
		if (t[i] >= 'A'&&t[i] <= 'Z')
			LT1[t[i] - 'A']++;
		else
			lt1[t[i] - 'a']++;
	}
	int x = 0, y = 0;
	for (int i = 0; i < 26; i++)
	{

		{
			if (LT[i]>=LT1[i])
			{
				x += LT1[i];
				y += LT[i] - LT1[i];
			}
			else
			{
				x+= LT[i];

			}
		}
		{
		if (lt[i] >= lt1[i])
		{
			x += lt1[i];
			y += lt[i] - lt1[i];
		}
		else
		{
			x += lt[i];

		}
	}

	}
	cout << x << " " << y;
}


/*
لا تقهر عبدا حتى لا يؤذيك دعاءه
*/
#include<bits/stdc++.h>
#include <stdlib.h>
#include<assert.h>
using namespace std;
#define PI 3.14159265359
#define OO 1e9
#define S second
#define F first
#define MP                  make_pair
int dx[] = { 0, 0, -1, 1, 1, 1, -1, -1 };
int dy[] = { -1, 1, 0, 0, 1, -1, 1, -1 };
#define sz(v) ( (int) (v.size()) )
#define all(v) v.begin(),v.end()
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

void fast()
{
	std::ios_base::sync_with_stdio(0);
	cin.tie(NULL);
	cout.tie(NULL);
}
int gcd(int a, int b) { return !b ? a : gcd(b, a % b); }
ll lcm(ll a, ll b) { return (a / gcd(a, b)) * b; }
int n, m, c = 0;
int cnt;
bool valid(int i, int j)
{
	return i >= 0 && i < n&&j >= 0 && j<m;
}
int fix(int y) {
	if (y < 0) return m - 1;
	if (y >= m) return 0;
	return y;
}
/*void itfunction_to_Calc_diver_from_1to_1000000()
{
long long div[1000001];
for (long long i = 1; i <= 1000000; i++)
{
for (int j = i; j <= 1000000; j += i)
div[j]++;
}
}*/
long long  mod(long long  a, long long b, long long c)
{
	if (b == 0) return 1;

	if (b % 2 == 0)
	{
		int x = mod(a, b / 2, c);
		return (x*x) % c;
	}
	else return (a%c * mod(a, b - 1, c)) % c;
}
int sumDigit(long long  x)
{
	int c = 0;
	while (x)
	{
		c += x % 10;
		x /= 10;
	}
	return c;
}
int main(){
	fast();
	map<char, int>mp1;
	string s, t;
	cin >> s >> t;
	int x =0, y=0;
	for (int i = 0; i < sz(t); i++)
	{
			mp1[t[i]]++;
	}
	for (int i = 0; i < sz(s); i++)
	{
		if (mp1.find(s[i]) != mp1.end())
		{
			if (mp1[s[i]]>0)
			x++;
			mp1[t[i]]--;
			s[i] = '*';
		}

	}
	for (int i = 0; i < sz(s); i++)
	{
		if (s[i] != '*')
			y++;
	}
	cout << x << " ";
	if (y)
		cout << sz(t) - x;
	else
		cout << 0;
}


/*
لا تقهر عبدا حتى لا يؤذيك دعاءه
*/
#include<bits/stdc++.h>
#include <stdlib.h>
#include<assert.h>
using namespace std;
#define PI 3.14159265359
#define OO 1e9
#define S second
#define F first
#define MP                  make_pair
int dx[] = { 0, 0, -1, 1, 1, 1, -1, -1 };
int dy[] = { -1, 1, 0, 0, 1, -1, 1, -1 };
#define sz(v) ( (int) (v.size()) )
#define all(v) v.begin(),v.end()
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

void fast()
{
	std::ios_base::sync_with_stdio(0);
	cin.tie(NULL);
	cout.tie(NULL);
}
int gcd(int a, int b) { return !b ? a : gcd(b, a % b); }
ll lcm(ll a, ll b) { return (a / gcd(a, b)) * b; }
int n, m, c = 0;
int cnt;
bool valid(int i, int j)
{
	return i >= 0 && i < n&&j >= 0 && j<m;
}
int fix(int y) {
	if (y < 0) return m - 1;
	if (y >= m) return 0;
	return y;
}
/*void itfunction_to_Calc_diver_from_1to_1000000()
{
long long div[1000001];
for (long long i = 1; i <= 1000000; i++)
{
for (int j = i; j <= 1000000; j += i)
div[j]++;
}
}*/
long long  mod(long long  a, long long b, long long c)
{
	if (b == 0) return 1;

	if (b % 2 == 0)
	{
		int x = mod(a, b / 2, c);
		return (x*x) % c;
	}
	else return (a%c * mod(a, b - 1, c)) % c;
}
int sumDigit(long long  x)
{
	int c = 0;
	while (x)
	{
		c += x % 10;
		x /= 10;
	}
	return c;
}
int main(){
	fast();
	int lt[300] = { 0 };
	int lt1[300] = { 0 };
	string s, t;
	cin >> s >> t;
	for (int i = 0; i < sz(s); i++)
	{
			lt[s[i]]++;
	}
	for (int i = 0; i < sz(t); i++)
	{
			lt1[t[i] ]++;
	}
	int x = 0, y = 0;
	for (int i = 0; i < 300; i++)
	{

		if (lt[i] >= lt1[i])
		{
			x += lt1[i];
			y += lt[i] - lt1[i];
		}
		else
		{
			x += lt[i];

		}

	}
	cout << x << " " << y;
}


/*
لا تقهر عبدا حتى لا يؤذيك دعاءه
*/
#include<bits/stdc++.h>
#include <stdlib.h>
#include<assert.h>
using namespace std;
#define PI 3.14159265359
#define OO 1e9
#define S second
#define F first
#define MP                  make_pair
int dx[] = { 0, 0, -1, 1, 1, 1, -1, -1 };
int dy[] = { -1, 1, 0, 0, 1, -1, 1, -1 };
#define sz(v) ( (int) (v.size()) )
#define all(v) v.begin(),v.end()
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

void fast()
{
	std::ios_base::sync_with_stdio(0);
	cin.tie(NULL);
	cout.tie(NULL);
}
int gcd(int a, int b) { return !b ? a : gcd(b, a % b); }
ll lcm(ll a, ll b) { return (a / gcd(a, b)) * b; }
int n, m, c = 0;
int cnt;
bool valid(int i, int j)
{
	return i >= 0 && i < n&&j >= 0 && j<m;
}
int fix(int y) {
	if (y < 0) return m - 1;
	if (y >= m) return 0;
	return y;
}
/*void itfunction_to_Calc_diver_from_1to_1000000()
{
long long div[1000001];
for (long long i = 1; i <= 1000000; i++)
{
for (int j = i; j <= 1000000; j += i)
div[j]++;
}
}*/
long long  mod(long long  a, long long b, long long c)
{
	if (b == 0) return 1;

	if (b % 2 == 0)
	{
		int x = mod(a, b / 2, c);
		return (x*x) % c;
	}
	else return (a%c * mod(a, b - 1, c)) % c;
}
int sumDigit(long long  x)
{
	int c = 0;
	while (x)
	{
		c += x % 10;
		x /= 10;
	}
	return c;
}
int main(){
	fast();
	map<char, int>mp1;
	string s, t;
	cin >> s >> t;
	int x =0, y=0;
	for (int i = 0; i < sz(t); i++)
	{
			mp1[t[i]]++;
	}
	for (int i = 0; i < sz(s); i++)
	{
		if (mp1.find(s[i]) != mp1.end())
		{
			if (mp1[s[i]]>0)
			x++;
			mp1[t[i]]--;
			s[i] = '*';
		}

	}
	for (int i = 0; i < sz(s); i++)
	{
		if (s[i] != '*')
			y++;
	}
	cout << x << " ";
	if (y)
		cout << sz(t) - x;
}


/*
لا تقهر عبدا حتى لا يؤذيك دعاءه
*/
#include<bits/stdc++.h>
#include <stdlib.h>
#include<assert.h>
using namespace std;
#define PI 3.14159265359
#define OO 1e9
#define S second
#define F first
#define MP                  make_pair
int dx[] = { 0, 0, -1, 1, 1, 1, -1, -1 };
int dy[] = { -1, 1, 0, 0, 1, -1, 1, -1 };
#define sz(v) ( (int) (v.size()) )
#define all(v) v.begin(),v.end()
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

void fast()
{
	std::ios_base::sync_with_stdio(0);
	cin.tie(NULL);
	cout.tie(NULL);
}
int gcd(int a, int b) { return !b ? a : gcd(b, a % b); }
ll lcm(ll a, ll b) { return (a / gcd(a, b)) * b; }
int n, m, c = 0;
int cnt;
bool valid(int i, int j)
{
	return i >= 0 && i < n&&j >= 0 && j<m;
}
int fix(int y) {
	if (y < 0) return m - 1;
	if (y >= m) return 0;
	return y;
}
/*void itfunction_to_Calc_diver_from_1to_1000000()
{
long long div[1000001];
for (long long i = 1; i <= 1000000; i++)
{
for (int j = i; j <= 1000000; j += i)
div[j]++;
}
}*/
long long  mod(long long  a, long long b, long long c)
{
	if (b == 0) return 1;

	if (b % 2 == 0)
	{
		int x = mod(a, b / 2, c);
		return (x*x) % c;
	}
	else return (a%c * mod(a, b - 1, c)) % c;
}
int sumDigit(long long  x)
{
	int c = 0;
	while (x)
	{
		c += x % 10;
		x /= 10;
	}
	return c;
}
int arr[100000];
int main(){
	fast();

	string s, t;
	cin >> s >> t;
	int x =0, y=0;
	for (int i = 0; i < sz(t); i++)
	{
			arr[t[i]]++;
	}

	for (int i = 0; i < sz(s); i++)
	{
		if (arr[s[i]]>0)
		{

				x++;
				arr[s[i]]--;
				s[i] = '*';

		}

	}
	for (int i = 0; i < sz(s); i++)
	{
		if (s[i] != '*')
		{
			if (arr[s[i] - 'a' + 'A'])
			{
				y++;
				arr[s[i] - 'a' + 'A']--;
				continue;
			}
			if (arr[s[i] - 'A' + 'a'])
			{
				y++;
				arr[s[i] - 'A' + 'a']--;
				continue;
			}
		}

	}
	cout << x << " ";

		cout << y;
}


/*
لا تقهر عبدا حتى لا يؤذيك دعاءه
*/
#include<bits/stdc++.h>
#include <stdlib.h>
#include<assert.h>
using namespace std;
#define PI 3.14159265359
#define OO 1e9
#define S second
#define F first
#define MP                  make_pair
int dx[] = { 0, 0, -1, 1, 1, 1, -1, -1 };
int dy[] = { -1, 1, 0, 0, 1, -1, 1, -1 };
#define sz(v) ( (int) (v.size()) )
#define all(v) v.begin(),v.end()
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

void fast()
{
	std::ios_base::sync_with_stdio(0);
	cin.tie(NULL);
	cout.tie(NULL);
}
int gcd(int a, int b) { return !b ? a : gcd(b, a % b); }
ll lcm(ll a, ll b) { return (a / gcd(a, b)) * b; }
int n, m, c = 0;
int cnt;
bool valid(int i, int j)
{
	return i >= 0 && i < n&&j >= 0 && j<m;
}
int fix(int y) {
	if (y < 0) return m - 1;
	if (y >= m) return 0;
	return y;
}
/*void itfunction_to_Calc_diver_from_1to_1000000()
{
long long div[1000001];
for (long long i = 1; i <= 1000000; i++)
{
for (int j = i; j <= 1000000; j += i)
div[j]++;
}
}*/
long long  mod(long long  a, long long b, long long c)
{
	if (b == 0) return 1;

	if (b % 2 == 0)
	{
		int x = mod(a, b / 2, c);
		return (x*x) % c;
	}
	else return (a%c * mod(a, b - 1, c)) % c;
}
int sumDigit(long long  x)
{
	int c = 0;
	while (x)
	{
		c += x % 10;
		x /= 10;
	}
	return c;
}
int main(){
	fast();
	map<char, int>mp1;
	string s, t;
	cin >> s >> t;
	int x =0, y=0;
	for (int i = 0; i < sz(t); i++)
	{
			mp1[t[i]]++;
	}

	for (int i = 0; i < sz(s); i++)
	{
		if (mp1.find(s[i]) != mp1.end())
		{
			if (mp1[s[i]]>0)
			{
				x++;
				mp1[s[i]]--;
				s[i] = '*';
			}
		}

	}
	for (int i = 0; i < sz(s); i++)
	{
		if (s[i] != '*')
			y++;
	}
	cout << x << " ";
	if (y)
		cout << sz(t) - x;
	else
		cout << 0;
}


#include<bits/stdc++.h>
#define ll long long int
#define pii pair<int,int>
#define mod 1000000007
#define eps 0.000000001
#define all(x) x.begin(), x.end()
#define allr(x) x.rbegin(), x.rend()
#define sz(x) ((int)x.size())
#define ln(x) ((int)x.length())
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define FASTIO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
const double PI = acos(-1.0);
using namespace std;

int main()
{
    FASTIO;
    string a, b;
    cin>>a>>b;
    map<char,int> ma, mb;
    for(char x: a)
    	ma[x]++;
    for(char x: b)
    	mb[x]++;
    int yay=0, whoops=0;
    for(char x: a)
    {
    	if(mb[x])
    		yay++, mb[x]--;
    	else
    		whoops++;
    }
    cout<<yay<<" "<<whoops<<endl;
    return 0;
}


#include<bits/stdc++.h>
#define ll long long int
#define pii pair<int,int>
#define mod 1000000007
#define eps 0.000000001
#define all(x) x.begin(), x.end()
#define allr(x) x.rbegin(), x.rend()
#define sz(x) ((int)x.size())
#define ln(x) ((int)x.length())
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define FASTIO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
const double PI = acos(-1.0);
using namespace std;

int main()
{
    FASTIO;
    string a, b;
    cin>>a>>b;
    map<char,int> ma, mb;
    for(char x: a)
    	ma[x]++;
    for(char x: b)
    	mb[x]++;
    int yay=0, whoops=0;
    for(char x: a)
    {
    	if(mb[x])
    		yay++, mb[x]--;
    	else
    	{
    		char y;
    		if(x >= 'a' && x<= 'z')
    			y = char(x-'a'+65);
    		else
    			y = char(x-'A'+97);
    		if(mb[y])
    			whoops++, mb[y]--;
    	}
    }
    cout<<yay<<" "<<whoops<<endl;
    return 0;
}


#include<bits/stdc++.h>
#define ll long long int
#define pii pair<int,int>
#define mod 1000000007
#define eps 0.000000001
#define all(x) x.begin(), x.end()
#define allr(x) x.rbegin(), x.rend()
#define sz(x) ((int)x.size())
#define ln(x) ((int)x.length())
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define FASTIO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
const double PI = acos(-1.0);
using namespace std;

int main()
{
    FASTIO;
    string a, b;
    cin>>a>>b;
    map<char,int> ma, mb;
    for(char x: a)
    	ma[x]++;
    for(char x: b)
    	mb[x]++;
    int yay=0, whoops=0;
    for(char x: a)
    {
    	if(x >= 'a' && x <= 'z')
    	{
    		if(mb[x])
    			yay++, mb[x]--;
    		char y = char((x-'a')+65);
    		if(mb[y])
    			whoops++, mb[y]--;
    	}
    	else
    	{
    		if(mb[x])
    			yay++, mb[x]--;
    		char y = char((x-'A')+97);
    		if(mb[y])
    			whoops++, mb[y]--;
    	}

    }
    cout<<yay<<" "<<whoops<<endl;
    return 0;
}


#include<bits/stdc++.h>
#define ll long long int
#define pii pair<int,int>
#define mod 1000000007
#define eps 0.000000001
#define all(x) x.begin(), x.end()
#define allr(x) x.rbegin(), x.rend()
#define sz(x) ((int)x.size())
#define ln(x) ((int)x.length())
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define FASTIO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
const double PI = acos(-1.0);
using namespace std;

int main()
{
    FASTIO;
    string a, b;
    cin>>a>>b;
    map<char,int> ma, mb;
    for(char x: a)
    	ma[x]++;
    for(char x: b)
    	mb[x]++;
    int yay=0, whoops=0;
    for(char x: a)
    {
    	if(mb[x])
    		yay++, mb[x]--;
    	else if(mb[tolower(x)])
    		whoops++, mb[tolower(x)]--;
    	else if(mb[toupper(x)])
    		whoops++, mb[toupper(x)]--;
    }
    cout<<yay<<" "<<whoops<<endl;
    return 0;
}


#include<bits/stdc++.h>
#define ll long long int
#define pii pair<int,int>
#define mod 1000000007
#define eps 0.000000001
#define all(x) x.begin(), x.end()
#define allr(x) x.rbegin(), x.rend()
#define sz(x) ((int)x.size())
#define ln(x) ((int)x.length())
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define FASTIO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
const double PI = acos(-1.0);
using namespace std;

int main()
{
    FASTIO;
    string a, b;
    cin >> a >> b;
    map<char, int> ma, mb;
    for(char x : a)
        ma[x]++;
    for(char x : b)
        mb[x]++;
    int yay = 0, whoops = 0;
    vector<bool> vis(ln(a), false);
    for(int i = 0; i < ln(a); i++)
    {
        char x = a[i];
        if(mb[x])
            yay++, mb[x]--, vis[i] = true;
    }
    for(int i = 0; i < ln(a); i++)
    {
        if(vis[i])
            continue;
        char x=a[i], y;
        if(x >= 'a' && x <= 'z')
            y = char(x - 'a' + 65);
        else
            y = char(x - 'A' + 97);
        if(mb[y])
            whoops++, mb[y]--;
    }
    cout << yay << " " << whoops << endl;
    return 0;
}


#include<bits/stdc++.h>

using namespace std;
typedef long long ll;
const int N = 1e5 + 5, MOD = 1e9 + 7;

string s, t;
int frT[200], YAY, WHOOPS;

int main() {
    cin >> s >> t;
    for(int i = 0; i < t.size(); i++)
        frT[t[i]]++;
    for(int i = 0; i < s.size(); i++){
        if(frT[s[i]]){
            frT[s[i]]--;
            YAY++;
        }else
            WHOOPS++;
    }
    cout << YAY << " " << WHOOPS << endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
long long n,c[400],c1[400],y,w;
string s,t;
char low;
int main()
{
    cin >> s >> t;
    for(int i=0;i<t.length();i++)
        {
            c[t[i]]++;
            low = tolower(t[i]);
            c1[low]++;
        }
    for(int i=0;i<s.length();i++)
        {
            low = tolower(s[i]);
            if(c[s[i]]>0)
        {
        y++;
        c1[low]--;
        c[s[i]]--;
        s[i]='.';
        }
        }
    for(int i=0;i<s.length();i++)
        if(s[i]!='.'&&c1[tolower(s[i])])
            w++;
    cout << y << " " << w;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
long long n,c[400],c1[400],y,w;
string s,t;
char low;
int main()
{
    cin >> s >> t;
    for(int i=0;i<t.length();i++)
        {
            c[t[i]]++;
            low = tolower(t[i]);
            c1[low]++;
        }
    for(int i=0;i<s.length();i++)
        {
            low = tolower(s[i]);
            if(c[s[i]]>0)
        {
        y++;
        c1[low]--;
        c[s[i]]--;
        s[i]='.';
        }
        }
    for(int i=0;i<s.length();i++)
        if(s[i]!='.'&&c1[tolower(s[i])])
    {
        c1[tolower(s[i])]--;
        w++;
    }
    cout << y << " " << w;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
long long n,c[400],c1[100],y,w;
string s,t;
int main()
{
    cin >> s >> t;
    for(int i=0;i<t.length();i++)
        {
            c[t[i]-'A']++;
            c1[tolower(t[i])-'A']++;
        }
    for(int i=0;i<s.length();i++)
        {if(c[s[i]-'A']>0)
    {
        y++;
        c1[tolower(s[i])-'A']--;
        c[s[i]-'A']--;
    }
        else if(c1[tolower(s[i])-'A']>0)
        w++;}
    cout << y << " " << w;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
long long n,c[200],y,w;
string s,t;
int main()
{
    cin >> s >> t;
    for(int i=0;i<t.length();i++)
        c[t[i]-'A']++;
    for(int i=0;i<s.length();i++)
        if(c[s[i]-'A']>0)
    {
        y++;
        c[s[i]-'A']--;
    }
        else
        w++;
    cout << y << " " << w;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
long long n,c[400],c1[100],y,w;
string s,t;
char low;
int main()
{
    cin >> s >> t;
    for(int i=0;i<t.length();i++)
        {
            c[t[i]-'A']++;
            low = tolower(t[i]);
            c1[low-'A']++;
        }
    for(int i=0;i<s.length();i++)
        {low = tolower(s[i]);
            if(c[s[i]-'A']>0)
    {
        y++;
        c1[low-'A']--;
        c[s[i]-'A']--;
    }
        else if(c1[low-'A']>0)
        w++;}
    cout << y << " " << w;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
long long n,c[400]={0},y,w;
string s,t;
int main()
{
    cin >> s >> t;
    for(int i=0;i<t.length();i++)
        c[t[i]-'A']++;
    for(int i=0;i<s.length();i++)
            c[s[i]-'A']--;
    for(int i=0;i<400;i++)
        if(c[i]<0)
        w++;
    cout << s.length()-w << " " << w;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
long long n,c[400]={0},y,w;
string s,t;
int main()
{
    cin >> s >> t;
    for(int i=0;i<t.length();i++)
        c[t[i]-'A']++;
    for(int i=0;i<s.length();i++)
        {if(c[s[i]-'A']>0)
        {
            y++;
            c[s[i]-'A']--;
        }
        else
        w++;}
    cout << y << " " << w;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
long long n,c[400]={0},y,w;
string s,t;
int main()
{
    cin >> s >> t;
    for(int i=0;i<t.length();i++)
        c[t[i]-'A']++;
    for(int i=0;i<s.length();i++)
            c[s[i]-'A']--;
    for(int i=0;i<400;i++)
        if(c[i]<0)
        w+=abs(c[i]);
    cout << s.length()-w << " " << w;
    return 0;
}


#include <bits/stdc++.h>
#include <algorithm>
#include <unordered_map>
#define ull unsigned long long
#define int long long
#define ll long long
#define fr(i, n) for (int i = 0; i < n; i++)
#define frf(i, j, n) for (int i = j; i <= n; i++)
#define frd(i, n) for (int i = n; i >= 0; i--)
#define mp(i, j) make_pair(i, j)
#define pb(x) push_back(x)
using namespace std;
// const int MAX = 1e6 + 1;
// typedef vector<vector<ll>> matrix;
const ll PRIME = 1e9 + 7;
// typedef pair<int,pair<int,int> >  ppi;
// const ll MAX = 1e6 + 1;

void solve()
{
    string s, t;
    cin >> s >> t;
    unordered_map<char, int> mp;
    fr(i, t.length())
    {
        mp[t[i]]++;
    }
    int ans1 = 0;
    int ans2=0;
    fr(i,s.length())
    {
        if(mp[s[i]])
        {
            ans1++;
            mp[s[i]]--;

        }
        else
        {
            if(islower(s[i]))
            {
                char c= toupper(s[i]);
                if(mp[c]>0)
                {
                    ans2++;
                    mp[c]--;
                }
            }
            else
            {
                char c= tolower(s[i]);
                if(mp[c]>0)
                {
                    ans2++;
                    mp[c]--;
                }
            }
        }

    }
    cout<<ans1<<" "<<ans2;
}

int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    int t;
    // cin >> t;
    t = 1;
    while (t--)
    {
        // cout << "Case #" << k++ << ": ";
        solve();
    }
}


#include <bits/stdc++.h>
#include <algorithm>
#include <unordered_map>
#define ull unsigned long long
#define int long long
#define ll long long
#define fr(i, n) for (int i = 0; i < n; i++)
#define frf(i, j, n) for (int i = j; i <= n; i++)
#define frd(i, n) for (int i = n; i >= 0; i--)
#define mp(i, j) make_pair(i, j)
#define pb(x) push_back(x)
using namespace std;
// const int MAX = 1e6 + 1;
// typedef vector<vector<ll>> matrix;
const ll PRIME = 1e9 + 7;
// typedef pair<int,pair<int,int> >  ppi;
// const ll MAX = 1e6 + 1;

void solve()
{
    string s, t;
    cin >> s >> t;
    int n = s.length();
    map<char, int> mp;
    fr(i, (int)t.length())
    {
        mp[t[i]]++;
    }
    int ans1 = 0;
    map<char, int> mp2;
    fr(i, (int)s.length())
    {
        if(mp[s[i]]>0)
        {
            ans1++;
            mp[s[i]]--;
        }

    }
    cout<<ans1<<" "<<n-ans1;
}

int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    int t;
    // int k = 1;
    // cin >> t;
    t = 1;
    while (t--)
    {
        // cout << "Case #" << k++ << ": ";
        solve();
    }
}


#include <bits/stdc++.h>
#include <algorithm>
#include <unordered_map>
#define ull unsigned long long
#define int long long
#define ll long long
#define fr(i, n) for (int i = 0; i < n; i++)
#define frf(i, j, n) for (int i = j; i <= n; i++)
#define frd(i, n) for (int i = n; i >= 0; i--)
#define mp(i, j) make_pair(i, j)
#define pb(x) push_back(x)
using namespace std;
// const int MAX = 1e6 + 1;
// typedef vector<vector<ll>> matrix;
const ll PRIME = 1e9 + 7;
// typedef pair<int,pair<int,int> >  ppi;
// const ll MAX = 1e6 + 1;

void solve()
{
    string s, t;
    cin >> s >> t;
    unordered_map<char, int> mp;
    fr(i, t.length())
    {
        mp[t[i]]++;
    }
    int ans1 = 0;
    int ans2 = 0;
    vector<int> vis(s.length(),0);
    fr(i, s.length())
    {
        if (mp[s[i]])
        {
            ans1++;
            mp[s[i]]--;
            vis[i]=1;
        }

    }
    fr(i, s.length())
    {
        if(vis[i]==1)continue;
        if (islower(s[i]))
        {
            char c = toupper(s[i]);
            if (mp[c] > 0)
            {
                ans2++;
                mp[c]--;
            }
        }
        else
        {
            char c = tolower(s[i]);
            if (mp[c] > 0)
            {
                ans2++;
                mp[c]--;
            }
        }
    }

cout << ans1 << " " << ans2;
}
int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    int t;
    // cin >> t;
    t = 1;
    while (t--)
    {
        // cout << "Case #" << k++ << ": ";
        solve();
    }
}


#include <bits/stdc++.h>
#include <algorithm>
#include <unordered_map>
#define ull unsigned long long
#define int long long
#define ll long long
#define fr(i, n) for (int i = 0; i < n; i++)
#define frf(i, j, n) for (int i = j; i <= n; i++)
#define frd(i, n) for (int i = n; i >= 0; i--)
#define mp(i, j) make_pair(i, j)
#define pb(x) push_back(x)
using namespace std;
// const int MAX = 1e6 + 1;
// typedef vector<vector<ll>> matrix;
const ll PRIME = 1e9 + 7;
// typedef pair<int,pair<int,int> >  ppi;
// const ll MAX = 1e6 + 1;

void solve()
{
    string s, t;
    cin >> s >> t;
    int n = s.length();
    map<char, int> mp;
    fr(i, (int)t.length())
    {
        mp[t[i]]++;
    }
    int ans1 = 0;
    int ans2=0;
    fr(i, (int)s.length())
    {
        if(mp[s[i]]>0)
        {
            ans1++;
            mp[s[i]]--;

        }
        else
        {
            if(islower(s[i]))
            {
                char c= toupper(s[i]);
                if(mp[c]>0)
                {
                    ans2++;
                    mp[c]--;
                }
            }
            else
            {
                char c= tolower(s[i]);
                if(mp[c]>0)
                {
                    ans2++;
                    mp[c]--;
                }
            }
        }

    }
    cout<<ans1<<" "<<ans2;
}

int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    int t;
    // int k = 1;
    // cin >> t;
    t = 1;
    while (t--)
    {
        // cout << "Case #" << k++ << ": ";
        solve();
    }
}


#include <bits/stdc++.h>
#include <algorithm>
#include <unordered_map>
#define ull unsigned long long
#define int long long
#define ll long long
#define fr(i, n) for (int i = 0; i < n; i++)
#define frf(i, j, n) for (int i = j; i <= n; i++)
#define frd(i, n) for (int i = n; i >= 0; i--)
#define mp(i, j) make_pair(i, j)
#define pb(x) push_back(x)
using namespace std;
// const int MAX = 1e6 + 1;
// typedef vector<vector<ll>> matrix;
const ll PRIME = 1e9 + 7;
// typedef pair<int,pair<int,int> >  ppi;
// const ll MAX = 1e6 + 1;

void solve()
{
    string s, t;
    cin >> s >> t;
    int n = s.length();
    map<char, int> mp;
    fr(i, (int)t.length())
    {
        mp[t[i]]++;
    }
    int ans1 = 0;
    map<char, int> mp2;
    int ans2=0;
    fr(i, (int)s.length())
    {
        if(mp[s[i]]>0)
        {
            ans1++;
            mp[s[i]]--;

        }
        else
        {
            if(islower(s[i]))
            {
                char c= toupper(s[i]);
                if(mp[c]>0)
                {
                    ans2++;
                    mp[c]--;
                }
            }
            else
            {
                char c= tolower(s[i]);
                if(mp[c]>0)
                {
                    ans2++;
                    mp[c]--;
                }
            }
        }

    }
    cout<<ans1<<" "<<ans2;
}

int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    int t;
    // int k = 1;
    // cin >> t;
    t = 1;
    while (t--)
    {
        // cout << "Case #" << k++ << ": ";
        solve();
    }
}


#include <bits/stdc++.h>
#include <algorithm>
#include <unordered_map>
#define ull unsigned long long
#define int long long
#define ll long long
#define fr(i, n) for (int i = 0; i < n; i++)
#define frf(i, j, n) for (int i = j; i <= n; i++)
#define frd(i, n) for (int i = n; i >= 0; i--)
#define mp(i, j) make_pair(i, j)
#define pb(x) push_back(x)
using namespace std;
// const int MAX = 1e6 + 1;
// typedef vector<vector<ll>> matrix;
const ll PRIME = 1e9 + 7;
// typedef pair<int,pair<int,int> >  ppi;
// const ll MAX = 1e6 + 1;

void solve()
{
    string s, t;
    cin >> s >> t;
    int n = s.length();
    map<char, int> mp;
    fr(i, (int)t.length())
    {
        mp[t[i]]++;
    }
    int ans1 = 0, ans2 = 0;
    map<char, int> mp2;
    fr(i, (int)s.length())
    {
        if(mp[s[i]]>0)
        {
            ans1++;
            mp[s[i]]--;
        }
        else
        {
            ans2++;

        }
    }
    cout<<ans1<<" "<<ans2;
}

int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    int t;
    // int k = 1;
    // cin >> t;
    t = 1;
    while (t--)
    {
        // cout << "Case #" << k++ << ": ";
        solve();
    }
}


#include <bits/stdc++.h>
#include <algorithm>
#include <unordered_map>
#define ull unsigned long long
#define int long long
#define ll long long
#define fr(i, n) for (int i = 0; i < n; i++)
#define frf(i, j, n) for (int i = j; i <= n; i++)
#define frd(i, n) for (int i = n; i >= 0; i--)
#define mp(i, j) make_pair(i, j)
#define pb(x) push_back(x)
using namespace std;
// const int MAX = 1e6 + 1;
// typedef vector<vector<ll>> matrix;
const ll PRIME = 1e9 + 7;
// typedef pair<int,pair<int,int> >  ppi;
// const ll MAX = 1e6 + 1;

void solve()
{
    string s, t;
    cin >> s >> t;
    unordered_map<char, int> mp;
    fr(i, (int)t.length())
    {
        mp[t[i]]++;
    }
    int ans1 = 0;
    int ans2=0;
    fr(i, (int)s.length())
    {
        if(mp[s[i]])
        {
            ans1++;
            mp[s[i]]--;

        }
        else
        {
            if(islower(s[i]))
            {
                char c= toupper(s[i]);
                if(mp[c]>0)
                {
                    ans2++;
                    mp[c]--;
                }
            }
            else
            {
                char c= tolower(s[i]);
                if(mp[c]>0)
                {
                    ans2++;
                    mp[c]--;
                }
            }
        }

    }
    cout<<ans1<<" "<<ans2;
}

int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    int t;
    // cin >> t;
    t = 1;
    while (t--)
    {
        // cout << "Case #" << k++ << ": ";
        solve();
    }
}


#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define ull unsigned long long
#define pi pair<ll,ll>
#define vi vector<int>
#define sc second
#define ft first
#define p_q priority_queue
#define INF 10000000000
using namespace std;
const ll MOD=1e9+7;
const ll N=3e5+7;
ll n , m , y=0,w=0;
map<char,int>mp;
string s,t;
int main(){
     ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
     cin >> t >> s;
     for(int i=0;i<s.size();i++) mp[s[i]]++;
     for(int i=0;i<t.size();i++){
         char tmp=tolower(t[i]),tmp2=toupper(t[i]);
         if(mp[t[i]]) y++,mp[t[i]]--;
         else if(mp[tmp] && t[i]==tmp2 || mp[tmp2] && t[i]==tmp) w++;
     }
     cout << y <<' '<<w <<'\n';
return 0;
}


#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define ull unsigned long long
#define pi pair<ll,ll>
#define vi vector<int>
#define sc second
#define ft first
#define p_q priority_queue
#define INF 10000000000
using namespace std;
const ll MOD=1e9+7;
const ll N=3e5+7;
ll n , m , y=0,w=0;
map<char,int>mp;
string s,t;
int main(){
     ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
     cin >> t >> s;
     for(int i=0;i<s.size();i++) mp[s[i]]++;
     for(int i=0;i<t.size();i++){
         char tmp=tolower(t[i]),tmp2=toupper(t[i]);
         if(mp[t[i]]) y++,mp[t[i]]--;
         else if(mp[tmp] && t[i]==tmp2) w++,mp[tmp]--;
         else if(mp[tmp2] && t[i]==tmp) w++,mp[tmp2]--;
     }
     cout << y <<' '<<w <<'\n';
return 0;
}


#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define ull unsigned long long
#define pi pair<ll,ll>
#define vi vector<int>
#define sc second
#define ft first
#define p_q priority_queue
#define INF 10000000000
using namespace std;
const ll MOD=1e9+7;
const ll N=3e5+7;
ll n , m , y=0,w=0;
map<char,int>mp;
string s,t;
int main(){
     ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
     cin >> t >> s;
     for(int i=0;i<s.size();i++) mp[s[i]]++;
     for(int i=0;i<t.size();i++){
         char tmp=tolower(t[i]),tmp2=toupper(t[i]);
         if(mp[t[i]]) y++,mp[t[i]]--;
         else if(mp[tmp] && t[i]==tmp2) w++,mp[tmp]--;
         else if(mp[tmp2] && t[i]==tmp)w++,mp[tmp2]--;
     }
     cout << y <<' '<<w <<'\n';
return 0;
}


#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define ull unsigned long long
#define pi pair<ll,ll>
#define vi vector<int>
#define sc second
#define ft first
#define p_q priority_queue
#define INF 10000000000
using namespace std;
const ll MOD=1e9+7;
const ll N=3e5+7;
ll n , m , y=0,w=0;
map<char,int>mp;
string s,t;
int main(){
     ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
     cin >> t >> s;
     for(int i=0;i<s.size();i++) mp[s[i]]++;
     for(int i=0;i<t.size();i++)
        if(mp[t[i]]) y++,mp[t[i]]--,t[i]='0';
     for(int i=0;i<t.size();i++){
         char tmp=tolower(t[i]),tmp2=toupper(t[i]);
         if(mp[tmp] && t[i]==tmp2) w++,mp[tmp]--;
         else if(mp[tmp2] && t[i]==tmp) w++,mp[tmp2]--;
     }

     cout << y <<' '<<w <<'\n';
return 0;
}


#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define ull unsigned long long
#define pi pair<ll,ll>
#define vi vector<int>
#define sc second
#define ft first
#define p_q priority_queue
#define INF 10000000000
using namespace std;
const ll MOD=1e9+7;
const ll N=3e5+7;
ll n , m , y=0,w=0;
map<char,int>mp;
string s,t;
int main(){
     ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
     cin >> t >> s;
     for(int i=0;i<s.size();i++) mp[s[i]]++;
     for(int i=0;i<t.size();i++){
         char tmp=tolower(t[i]),tmp2=toupper(t[i]);
         if(mp[t[i]]) y++,mp[t[i]]--;
         else if(mp[tmp] && t[i]==tmp2) w++,mp[tmp]--;
         else if(mp[tmp2] && t[i]==tmp) w++,mp[tmp2]--;
         else w--;
     }
     cout << y <<' '<<w <<'\n';
return 0;
}


#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define ull unsigned long long
#define pi pair<ll,ll>
#define vi vector<int>
#define sc second
#define ft first
#define p_q priority_queue
#define INF 10000000000
using namespace std;
const ll MOD=1e9+7;
const ll N=3e5+7;
ll n , m , y=0,w=0;
map<char,int>mp;
string s,t;
int main(){
     ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
     cin >> t >> s;
     for(int i=0;i<s.size();i++) mp[s[i]]++;
     for(int i=0;i<t.size();i++){
         char tmp=tolower(t[i]),tmp2=toupper(t[i]);
         if(mp[t[i]]) y++,mp[t[i]]--;
         else if(mp[tmp] && t[i]==tmp2) w++,mp[tmp2]--;
         else if(mp[tmp2] && t[i]==tmp)w++,mp[tmp]--;
     }
     cout << y <<' '<<w <<'\n';
return 0;
}


typedef long long int lld;
#define rep(i,a,b) for(i=a;i<b;i++)
#define push_back pb
#define F first
#define S second
#define srt(s) sort(s.begin(),s.end())
#define sz(a) (int)(a.size())
#define mod 1000000007
#include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef vector<long long> vll;
typedef vector<pair<int,int>> pi;
typedef vector<pair<lld,lld>> pll;
int main() {
    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    //your code goes here..
   lld a=0,b=0,i; string s,t; cin>>s>>t; int l1=s.length(),l2=t.length();
   int arr[28]={0},Arr[28]={0};
   rep(i,0,l2){
       if(t[i]<='Z'&&t[i]>='A') Arr[t[i]-'A']++;
       else arr[t[i]-'a']++;
   }
   //cout<<Arr[0]<<arr[1]<<Arr[2]<<Arr[3];
   rep(i,0,l1){
       if(isupper(s[i]) && Arr[s[i]-'A']>0) a++, Arr[s[i]-'A']--;
       else if(islower(s[i]) && arr[s[i]-'a']>0) a++, arr[s[i]-'a']--;
       else if(isupper(s[i]) && arr[s[i]-'A']>0) b++, arr[s[i]-'A']--;
       else if(islower(s[i]) && Arr[s[i]-'a']>0) b++, Arr[s[i]-'a']--;
       //cout<<a<<" "<<b<<endl;
   }
   cout<<a<<" "<<b;
    return 0;
}


typedef long long int lld;
#define rep(i,a,b) for(i=a;i<b;i++)
#define push_back pb
#define F first
#define S second
#define srt(s) sort(s.begin(),s.end())
#define sz(a) (int)(a.size())
#define mod 1000000007
#include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef vector<long long> vll;
typedef vector<pair<int,int>> pi;
typedef vector<pair<lld,lld>> pll;
int main() {
    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    //your code goes here..
   lld a=0,b=0,i; string s,t; cin>>s>>t; int l1=s.length(),l2=t.length();
   int arr[26]={0},Arr[26]={0};
   rep(i,0,l2){
       if(t[i]<='Z'&&t[i]>='A') Arr[t[i]-'A']++;
       else if(t[i]<='z'&&t[i]>='a') arr[t[i]-'a']++;
   }
   //cout<<Arr[0]<<arr[1]<<Arr[2]<<Arr[3];
   rep(i,0,l1){
       if(s[i]<='Z'&&s[i]>='A' && Arr[s[i]-'A']<=0 && arr[s[i]-'A']<=0) continue;
       if(s[i]<='z'&&s[i]>='a' && arr[s[i]-'a']<=0 && Arr[s[i]-'a']<=0) continue;
       if(s[i]<='Z'&&s[i]>='A' && Arr[s[i]-'A']>0) a++, Arr[s[i]-'A']--;
       else if(s[i]<='Z'&&s[i]>='A' && arr[s[i]-'A']>0) b++, arr[s[i]-'A']--;
       else if(s[i]<='z'&&s[i]>='a' && arr[s[i]-'a']>0) a++, arr[s[i]-'a']--;
       else if(s[i]<='z'&&s[i]>='a' && Arr[s[i]-'a']>0) b++, Arr[s[i]-'a']--;
       //cout<<a<<" "<<b<<endl;
   }
   cout<<a<<" "<<b;
    return 0;
}


typedef long long int lld;
#define rep(i,a,b) for(i=a;i<b;i++)
#define push_back pb
#define F first
#define S second
#define srt(s) sort(s.begin(),s.end())
#define sz(a) (int)(a.size())
#define mod 1000000007
#include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef vector<long long> vll;
typedef vector<pair<int,int>> pi;
typedef vector<pair<lld,lld>> pll;
int main() {
    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    //your code goes here..
   lld a=0,b=0,i; string s,t; cin>>s>>t; int l1=s.length(),l2=t.length();
   int arr[28]={0},Arr[28]={0};
   rep(i,0,l2){
       if(isupper(t[i])) Arr[t[i]-'A']++;
       else arr[t[i]-'a']++;
   }
   //cout<<Arr[0]<<arr[1]<<Arr[2]<<Arr[3];
   rep(i,0,l1){
       if(isupper(s[i]) && Arr[s[i]-'A']>0) a++, Arr[s[i]-'A']--,s[i]='#';
       else if(islower(s[i]) && arr[s[i]-'a']>0) a++, arr[s[i]-'a']--,s[i]='#';
       //cout<<a<<" "<<b<<endl;
   }
   rep(i,0,l1){
       if(isupper(s[i]) && arr[s[i]-'A']>0) b++, arr[s[i]-'A']--;
       else if(islower(s[i]) && Arr[s[i]-'a']>0) b++, Arr[s[i]-'a']--;
   }
   cout<<a<<" "<<b;
    return 0;
}


typedef long long int lld;
#define rep(i,a,b) for(i=a;i<b;i++)
#define push_back pb
#define F first
#define S second
#define srt(s) sort(s.begin(),s.end())
#define sz(a) (int)(a.size())
#define mod 1000000007
#include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef vector<long long> vll;
typedef vector<pair<int,int>> pi;
typedef vector<pair<lld,lld>> pll;
int main() {
    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    //your code goes here..
   lld a=0,b=0,i; string s,t; cin>>s>>t; int l1=s.length(),l2=t.length();
   int arr[26]={0},Arr[26]={0};
   rep(i,0,l2){
       if(t[i]<='Z'&&t[i]>='A') Arr[t[i]-'A']++;
       else if(t[i]<='z'&&t[i]>='a') arr[t[i]-'a']++;
   }
   //cout<<Arr[0]<<arr[1]<<Arr[2]<<Arr[3];
   rep(i,0,l1){
       if(s[i]<='Z'&&s[i]>='A' && Arr[s[i]-'A']>0) a++, Arr[s[i]-'A']--;
       else if(s[i]<='Z'&&s[i]>='A' && arr[s[i]-'A']>0) b++, arr[s[i]-'A']--;
       else if(s[i]<='z'&&s[i]>='a' && arr[s[i]-'a']>0) a++, arr[s[i]-'a']--;
       else if(s[i]<='z'&&s[i]>='a' && Arr[s[i]-'a']>0) b++, Arr[s[i]-'a']--;
       //cout<<a<<" "<<b<<endl;
   }
   cout<<a<<" "<<b;
    return 0;
}


typedef long long int lld;
#define rep(i,a,b) for(i=a;i<b;i++)
#define push_back pb
#define F first
#define S second
#define srt(s) sort(s.begin(),s.end())
#define sz(a) (int)(a.size())
#define mod 1000000007
#include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef vector<long long> vll;
typedef vector<pair<int,int>> pi;
typedef vector<pair<lld,lld>> pll;
int main() {
    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    //your code goes here..
   lld a=0,b=0,i; string s,t; cin>>s>>t; int l1=s.length(),l2=t.length();
   int arr[26]={0},Arr[26]={0};
   rep(i,0,l2){
       if(t[i]<='Z'&&t[i]>='A') Arr[t[i]-'A']++;
       else if(t[i]<='z'&&t[i]>='a') arr[t[i]-'a']++;
   }
   //cout<<Arr[0]<<arr[1]<<Arr[2]<<Arr[3];
   rep(i,0,l1){
       if(s[i]<='Z'&&s[i]>='A' && Arr[s[i]-'A']>0) a++, Arr[s[i]-'A']--;
       else if(s[i]<='z'&&s[i]>='a' && arr[s[i]-'a']>0) a++, arr[s[i]-'a']--;
       else if(s[i]<='Z'&&s[i]>='A' && arr[s[i]-'A']>0) b++, arr[s[i]-'A']--;
       else if(s[i]<='z'&&s[i]>='a' && Arr[s[i]-'a']>0) b++, Arr[s[i]-'a']--;
       //cout<<a<<" "<<b<<endl;
   }
   cout<<a<<" "<<b;
    return 0;
}


typedef long long int lld;
#define rep(i,a,b) for(i=a;i<b;i++)
#define push_back pb
#define F first
#define S second
#define srt(s) sort(s.begin(),s.end())
#define sz(a) (int)(a.size())
#define mod 1000000007
#include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef vector<long long> vll;
typedef vector<pair<int,int>> pi;
typedef vector<pair<lld,lld>> pll;
int main() {
    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    //your code goes here..
   lld a=0,b=0,i; string s,t; cin>>s>>t; int l1=s.length(),l2=t.length();
   int arr[26]={0},Arr[26]={0};
   rep(i,0,l2){
       if(t[i]<='Z'&&t[i]>='A') Arr[t[i]-'A']++;
       else if(t[i]<='z'&&t[i]>='a') arr[t[i]-'a']++;
   }
   //cout<<Arr[0]<<arr[1]<<Arr[2]<<Arr[3];
   rep(i,0,l1){
       if(s[i]<='Z'&&s[i]>='A' && Arr[s[i]-'A']>0) a++, Arr[s[i]-'A']--;
       else if(s[i]<='z'&&s[i]>='a' && arr[s[i]-'a']>0) a++, arr[s[i]-'a']--;
       //cout<<a<<" "<<b<<endl;
   }
   b=l1-a;
   cout<<a<<" "<<b;
    return 0;
}


typedef long long int lld;
#define rep(i,a,b) for(i=a;i<b;i++)
#define push_back pb
#define F first
#define S second
#define srt(s) sort(s.begin(),s.end())
#define sz(a) (int)(a.size())
#define mod 1000000007
#include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef vector<long long> vll;
typedef vector<pair<int,int>> pi;
typedef vector<pair<lld,lld>> pll;
int main() {
    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    //your code goes here..
   lld a=0,b=0,i; string s,t; cin>>s>>t; int l1=s.length(),l2=t.length();
   int arr[26]={0},Arr[26]={0};
   rep(i,0,l2){
       if(t[i]<='Z'&&t[i]>='A') Arr[t[i]-'A']++;
       else if(t[i]<='z'&&t[i]>='a') arr[t[i]-'a']++;
   }
   //cout<<Arr[0]<<arr[1]<<Arr[2]<<Arr[3];
   rep(i,0,l1){
       if(s[i]<='Z'&&s[i]>='A' && Arr[s[i]-'A']>0) a++, Arr[s[i]-'A']--;
       else if(s[i]<='z'&&s[i]>='a' && arr[s[i]-'a']>0) a++, arr[s[i]-'a']--;
       else b++;
       //cout<<a<<" "<<b<<endl;
   }
   cout<<a<<" "<<b;
    return 0;
}


#include <iostream>
#include <string>
#include <map>
using namespace std;
int main()
{
	map<char,int> a,b;
	char x;
	map<char,int>::iterator ita,itb;
	string temp1,temp2;
	cin>>temp1>>temp2;
	for(int i=0;i<temp1.size();i++)
	{
		ita=a.find(temp1[i]);
		if(ita==a.end())
		{
			a.insert(make_pair(temp1[i],1));
		}
		else
		{
			a.insert(make_pair(temp1[i],ita->second++));
		}
	}
	for(int i=0;i<temp2.size();i++)
	{
		itb=b.find(temp2[i]);
		if(itb==b.end())
		{
			b.insert(make_pair(temp2[i],1));
		}
		else
		{
			b.insert(make_pair(temp2[i],itb->second++));
		}
	}
	int left=0,right=0;
	for(ita=a.begin();ita!=a.end();ita++)
	{
		for(int i=0;i<ita->second;i++)
		{
			itb=b.find(ita->first);
			if(itb!=b.end() && itb->second>0)
			{
				left++;
				itb->second--;
			}
			else
			{
				if(ita->first <=90)
				{
					x = ita->first+32;
				}
				else
				{
					 x=ita->first-32;
				}
				itb=b.find(x);
				if(itb!=b.end() && itb->second>0)
				{
					right++;
					itb->second--;
				}
			}
		}
	}
	cout<<left<<" "<<right;
	return 0;
}


#include <iostream>
#include <string>
#include <map>
using namespace std;
int main()
{
	map<char,int> a,b;
	map<char,int>::iterator ita,itb;
	string temp1,temp2;
	cin>>temp1>>temp2;
	for(int i=0;i<temp1.size();i++)
	{
		ita=a.find(temp1[i]);
		if(ita==a.end())
		{
			a.insert(make_pair(temp1[i],1));
		}
		else
		{
			a.insert(make_pair(temp1[i],ita->second++));
		}
	}
	for(int i=0;i<temp2.size();i++)
	{
		itb=b.find(temp2[i]);
		if(itb==b.end())
		{
			b.insert(make_pair(temp2[i],1));
		}
		else
		{
			b.insert(make_pair(temp2[i],itb->second++));
		}
	}

	int left=0,right=0;
	for(ita=a.begin();ita!=a.end();ita++)
	{
		for(int i=0;i<ita->second;i++)
		{
			itb=b.find(ita->first);
			if(itb!=b.end() && itb->second!=0)
			{
				left++;
				itb->second--;
			}
		}
	}
	cout<<left<<" "<<temp1.size()-left;
	return 0;
}


#include<bits/stdc++.h>
const int mod = 1000000007;
typedef long long LL;
int temp;
//函数在前，避免temp在第二个参数位置被修改 add(temp=f(),x)
int& add(int &x, int y) { x += y; if (x >= mod)x -= mod; else if (x < 0)x += mod; return x; }
int& mul(int &x, int y) { return x = 1LL * x*y%mod; }
int qPowMod(int x, int y) { int res = 1, help = x; while (y) { if (y & 1)mul(res, help); mul(help, help); y >>= 1; } return res; }
LL& add(LL &x, LL y) { x += y; if (x >= mod)x -= mod; else if (x < 0)x += mod; return x; }
LL&mul(LL&x, LL y) { LL res = 0; while (y) { if (y & 1)add(res, x); x = (x << 1) % mod; y >>= 1; }return x = res; }
LL qPowMod(LL x, LL y) { int res = 1, help = x; while (y) { if (y & 1)mul(res, help); mul(help, help); y >>= 1; } return res; }
#define HDU void sol();int main(){int nTest;scanf("%d",&nTest);while(nTest--)sol();return 0;}
#define HDEBUG void sol();int main(){freopen("in.txt", "r", stdin);int nTest;scanf("%d",&nTest);while(nTest--)sol();return 0;}

char ss[200005];
int v[600005];

struct SEG {
	SEG(int _l=0,int _r=0,int _c=0):l(_l),r(_r),c(_c){}
	int l,r,c;
};

std::vector<SEG> con,sig;

int vis[600005];

int main() {
	int n;scanf("%d",&n);
	LL k;scanf("%I64d",&k);
	scanf("%s",ss);
	for(int i=0;i<n;i++){
		v[i]=(ss[i]&1);
		v[i+n]=v[i];
		v[i+2*n]=v[i];
	}
	int l=0,tt=0;
	for(int i=1;i<3*n;i++) {
		if(v[i]!=v[l]) {
			if(i>l+1){
				if(tt<=l-1)sig.emplace_back(tt,l-1,v[tt]);
				con.emplace_back(l,i-1,v[l]);
				tt=i;
			}
			l=i;
		}

	}
	if(3*n>l+1)con.emplace_back(l,3*n,v[l]);
	if(tt<=l-1)sig.emplace_back(tt,l-1,v[tt]);

	for(int i=1;i<con.size();i++) {
		if(con[i-1].r+n<con[i].l-n) {
			for(int j=1;j<=n;j++)
				v[con[i-1].r+j]=v[con[i-1].r],
				v[con[i].l-j]=v[con[i].l],
				vis[con[i-1].r+j]=1,
				vis[con[i].l-j]=1;
		}
		else {
			for(int j=1;j<=(con[i].l-con[i-1].r)>>1;j++)
				v[con[i-1].r+j]=v[con[i-1].r],
				v[con[i].l-j]=v[con[i].l],
				vis[con[i-1].r+j]=1,
				vis[con[i].l-j]=1;
		}
	}
	for(int i=0;i<sig.size();i++) {
		for(int j=sig[i].l;j<=sig[i].r;j++) {
			if(vis[j]==0)
				v[j]^=(k&1);
		}
	}
	for(int i=n;i<2*n;i++)
		putchar(v[i]?'W':'B');
	printf("\n");
}


#include<bits/stdc++.h>
const int mod = 1000000007;
typedef long long LL;
int temp;
//函数在前，避免temp在第二个参数位置被修改 add(temp=f(),x)
int& add(int &x, int y) { x += y; if (x >= mod)x -= mod; else if (x < 0)x += mod; return x; }
int& mul(int &x, int y) { return x = 1LL * x*y%mod; }
int qPowMod(int x, int y) { int res = 1, help = x; while (y) { if (y & 1)mul(res, help); mul(help, help); y >>= 1; } return res; }
LL& add(LL &x, LL y) { x += y; if (x >= mod)x -= mod; else if (x < 0)x += mod; return x; }
LL&mul(LL&x, LL y) { LL res = 0; while (y) { if (y & 1)add(res, x); x = (x << 1) % mod; y >>= 1; }return x = res; }
LL qPowMod(LL x, LL y) { int res = 1, help = x; while (y) { if (y & 1)mul(res, help); mul(help, help); y >>= 1; } return res; }
#define HDU void sol();int main(){int nTest;scanf("%d",&nTest);while(nTest--)sol();return 0;}
#define HDEBUG void sol();int main(){freopen("in.txt", "r", stdin);int nTest;scanf("%d",&nTest);while(nTest--)sol();return 0;}

char ss[200005];
int v[600005];

struct SEG {
	SEG(int _l=0,int _r=0,int _c=0):l(_l),r(_r),c(_c){}
	int l,r,c;
};

std::vector<SEG> con,sig;

int vis[600005];

int main() {
	int n;scanf("%d",&n);
	LL k;scanf("%I64d",&k);
	scanf("%s",ss);
	for(int i=0;i<n;i++){
		v[i]=(ss[i]&1);
		v[i+n]=v[i];
		v[i+2*n]=v[i];
	}
	int l=0,tt=0;
	for(int i=1;i<3*n;i++) {
		if(v[i]!=v[l]) {
			if(i>l+1){
				if(tt<=l-1)sig.emplace_back(tt,l-1,v[tt]);
				con.emplace_back(l,i-1,v[l]);
				tt=i;
			}
			l=i;
		}

	}
	if(3*n>l+1)con.emplace_back(l,3*n,v[l]);
	if(tt<=l-1)sig.emplace_back(tt,l-1,v[tt]);

	for(int i=1;i<con.size();i++) {
		if(con[i-1].r+k<con[i].l-k) {
			for(int j=1;j<=k;j++)
				v[con[i-1].r+j]=v[con[i-1].r],
				v[con[i].l-j]=v[con[i].l],
				vis[con[i-1].r+j]=1,
				vis[con[i].l-j]=1;
		}
		else {
			for(int j=1;j<=(con[i].l-con[i-1].r)>>1;j++)
				v[con[i-1].r+j]=v[con[i-1].r],
				v[con[i].l-j]=v[con[i].l],
				vis[con[i-1].r+j]=1,
				vis[con[i].l-j]=1;
		}
	}
	for(int i=0;i<sig.size();i++) {
		for(int j=sig[i].l;j<=sig[i].r;j++) {
			if(vis[j]==0)
				v[j]^=(k&1);
		}
	}
	for(int i=n;i<2*n;i++)
		putchar(v[i]?'W':'B');
	printf("\n");
}

/*
10 1
BBBWBWBBBW
 */


#include<bits/stdc++.h>
const int mod = 1000000007;
typedef long long LL;
int temp;
//函数在前，避免temp在第二个参数位置被修改 add(temp=f(),x)
int& add(int &x, int y) { x += y; if (x >= mod)x -= mod; else if (x < 0)x += mod; return x; }
int& mul(int &x, int y) { return x = 1LL * x*y%mod; }
int qPowMod(int x, int y) { int res = 1, help = x; while (y) { if (y & 1)mul(res, help); mul(help, help); y >>= 1; } return res; }
LL& add(LL &x, LL y) { x += y; if (x >= mod)x -= mod; else if (x < 0)x += mod; return x; }
LL&mul(LL&x, LL y) { LL res = 0; while (y) { if (y & 1)add(res, x); x = (x << 1) % mod; y >>= 1; }return x = res; }
LL qPowMod(LL x, LL y) { int res = 1, help = x; while (y) { if (y & 1)mul(res, help); mul(help, help); y >>= 1; } return res; }
#define HDU void sol();int main(){int nTest;scanf("%d",&nTest);while(nTest--)sol();return 0;}
#define HDEBUG void sol();int main(){freopen("in.txt", "r", stdin);int nTest;scanf("%d",&nTest);while(nTest--)sol();return 0;}

char ss[200005];
int v[600005];

struct SEG {
	SEG(int _l=0,int _r=0,int _c=0):l(_l),r(_r),c(_c){}
	int l,r,c;
};

std::vector<SEG> con,sig;

int vis[600005];

int main() {
	int n;scanf("%d",&n);
	LL k;scanf("%I64d",&k);
	scanf("%s",ss);
	for(int i=0;i<n;i++){
		v[i]=(ss[i]&1);
		v[i+n]=v[i];
		v[i+2*n]=v[i];
	}
	int l=0,tt=0;
	for(int i=1;i<3*n;i++) {
		if(v[i]!=v[l]) {
			if(i>l+1){
				if(tt<=l-1)sig.emplace_back(tt,l-1,v[tt]);
				con.emplace_back(l,i-1,v[l]);
				tt=i;
			}
			l=i;
		}

	}
	if(3*n>l+1)con.emplace_back(l,3*n,v[l]);
	if(tt<=l-1)sig.emplace_back(tt,l-1,v[tt]);

	for(int i=1;i<con.size();i++) {
		if(con[i-1].r+n<con[i].l-n) {
			for(int j=1;j<=n;j++)
				v[con[i-1].r+j]=v[con[i-1].r],
				v[con[i].l-j]=v[con[i].l],
				vis[con[i-1].r+j]=1,
				vis[con[i].l-j]=1;
		}
		else {
			for(int j=1;j<=(con[i].l-con[i-1].r-1)>>1;j++)
				v[con[i-1].r+j]=v[con[i-1].r],
				v[con[i].l-j]=v[con[i].l],
				vis[con[i-1].r+j]=1,
				vis[con[i].l-j]=1;
		}
	}
	for(int i=0;i<sig.size();i++) {
		for(int j=sig[i].l;j<=sig[i].r;j++) {
			if(vis[j]==0)
				v[j]^=(k&1);
		}
	}
	for(int i=n;i<2*n;i++)
		putchar(v[i]?'W':'B');
	printf("\n");
}

/*
10 1
BBBWBWBBBW
 */


#include <bits/stdc++.h>

using namespace std;

int main(){
	int n, k;
	cin>>n>>k;

	string str, s, ans = "";
	cin>>str;

	int len = str.length();
	s=str+str;
	int st = 1, en = -1;
	for(int i=1; i<s.length(); i++){
		if(s[i]==s[i-1]){
			if(en != -1){
				if(en-st+1 > k*2){
					//cout<<"Here\n";
					for(int j=st; j<st+k; j++) ans+=s[st-1];
					for(int j=st+k; j<=en-k; j++) ans+=(s[j]=='B'?'W':'B');
					for(int j=en-k+1; j<=en; j++) ans+=s[en+1];
				} else {
					//cout<<"Here\n";
					for(int j=st; j<st+(en-st+1)/2; j++) ans+=s[st-1];
					for(int j=st+(en-st+1)/2; j<=en; j++) ans+=s[en+1];
				}
				en = -1;
				ans+=s[i-1];
			}
			st = i+1;
			ans+=s[i];
			//cout<<ans<<endl;
		} else{
			en = i-1;
		}
	}
	if(ans.length() == 0){
		if(k%2) for(int j=1; j<s.length(); j++) ans+=(s[j]=='B'?'W':'B');
		else ans = s.substr(1, s.length()-1);
	}
	cout<<ans.substr(n-1, n)<<endl;
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main(){
	int n, k;
	cin>>n>>k;

	string str, s, ans = "";
	cin>>str;

	int len = str.length();
	s=str+str+str;
	int st = 1, en = -1;
	for(int i=1; i<s.length(); i++){
		if(s[i]==s[i-1]){
			if(en != -1){
				if(en-st+1 > k*2){
					//cout<<"Here\n";
					for(int j=st; j<st+k; j++) ans+=s[st-1];
					if(k%2) for(int j=st+k; j<=en-k; j++) ans+=(s[j]=='B'?'W':'B');
					else for(int j=st+k; j<=en-k; j++) ans+=s[j];
					for(int j=en-k+1; j<=en; j++) ans+=s[en+1];
				} else {
					//cout<<"Here\n";
					for(int j=st; j<st+(en-st+1)/2; j++) ans+=s[st-1];
					for(int j=st+(en-st+1)/2; j<=en; j++) ans+=s[en+1];
				}
				en = -1;
				ans+=s[i-1];
			}
			st = i+1;
			ans+=s[i];
			//cout<<ans<<endl;
		} else{
			en = i-1;
		}
	}
	if(ans.length() == 0){
		if(k%2) for(int j=1; j<s.length(); j++) ans+=(s[j]=='B'?'W':'B');
		else ans = s.substr(1, s.length()-1);
	}
	cout<<ans.substr(n-1, n)<<endl;
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main(){
	int n, k;
	cin>>n>>k;

	string str, s, ans = "";
	cin>>str;

	int len = str.length();
	s=str+str+str;
	int st = 1, en = -1;
	for(int i=1; i<s.length(); i++){
		if(s[i]==s[i-1]){
			if(en != -1){
				if(en-st+1 > k*2){
					//cout<<"Here\n";
					for(int j=st; j<st+k; j++) ans+=s[st-1];
					for(int j=st+k; j<=en-k; j++) ans+=(s[j]=='B'?'W':'B');
					for(int j=en-k+1; j<=en; j++) ans+=s[en+1];
				} else {
					//cout<<"Here\n";
					for(int j=st; j<st+(en-st+1)/2; j++) ans+=s[st-1];
					for(int j=st+(en-st+1)/2; j<=en; j++) ans+=s[en+1];
				}
				en = -1;
				ans+=s[i-1];
			}
			st = i+1;
			ans+=s[i];
			//cout<<ans<<endl;
		} else{
			en = i-1;
		}
	}
	if(ans.length() == 0){
		if(k%2) for(int j=1; j<s.length(); j++) ans+=(s[j]=='B'?'W':'B');
		else ans = s.substr(1, s.length()-1);
	}
	cout<<ans.substr(n-1, n)<<endl;
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main(){
	int n, k;
	cin>>n>>k;

	string str, s, ans = "";
	cin>>str;

	int len = str.length();
	s=str+str+str;
	int st = 1, en = -1;
	for(int i=1; i<s.length(); i++){
		if(s[i]==s[i-1]){
			if(en != -1){
				if(en-st+1 > k*2){
					cout<<"Here\n";
					for(int j=st; j<st+k; j++) ans+=s[st-1];
					for(int j=st+k; j<=en-k; j++) ans+=(s[j]=='B'?'W':'B');
					for(int j=en-k+1; j<=en; j++) ans+=s[en+1];
				} else {
					for(int j=st; j<st+(en-st+1)/2; j++) ans+=s[st-1];
					for(int j=st+(en-st+1)/2; j<=en; j++) ans+=s[en+1];
				}
				en = -1;
			}
			st = i+1;
			ans+=s[i-1];
			ans+=s[i];
			//cout<<ans<<endl;
		} else{
			en = i-1;
		}
	}
	if(ans.length() == 0){
		if(k%2) for(int j=1; j<s.length(); j++) ans+=(s[j]=='B'?'W':'B');
		else ans = s.substr(1, s.length()-1);
	}
	cout<<ans.substr(n-1, n)<<endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

const int maxV = 90010;
const int maxN = 4e5+10;
const int MOD = 1e9+7;
const ll INF = 1000000000000000010LL;
const ll inf = 1e9+10;

char s[maxN];
struct node
{
	int L;
	int R;
};
node seg[maxN];
node a[maxN];
int tot;
void change(char &x)
{
	if(x == 'W')
		x = 'B';
	else
		x = 'W';
}
int main() {
	int n,k;
	scanf("%d%d",&n,&k);
	scanf("%s",s+1);
	for(int i=n+1;i<=2*n;i++)
	{
		s[i] = s[i-n];
	}
	tot = 0;
	int x,y;
	int flag = 0;
	for(int i=2;i<=n+1;i++)
	{
		if(s[i-1] != s[i] && s[i+1] != s[i])
		{
			if(!flag)
			{
				x = i;
				y = i;
				flag = 1;
			}
			else
			{
				y = i;
			}
		}
		else
		{
			if(flag == 1)
			{
				a[++tot] = node{x,y};
				flag = 0;
			}
		}
	}
	if(flag == 1)
	{
		a[++tot] = node{x,y};
	}
	if(tot == 1 && a[1].L == 2 && a[1].R == n+1)
	{
		if(k%2 == 1)
		{
			for(int i=1;i<=n;i++)
				change(s[i]);
		}
		for(int i=1;i<=n;i++)
		{
			printf("%c",s[i]);
		}
		cout<<endl;
		return 0;
	}
	for(int i=1;i<=tot;i++)
	{
		int l = a[i].L;
		int r = a[i].R;
		int cnt = 1;
		while(l<=r && cnt<=k)
		{
			if((cnt%2)==1)
			{
				if(l<r)
				{
					change(s[l]);
					change(s[r]);
				}
				else if(l==r)
				{
					change(s[l]);
				}
			}
			l++;
			r--;
			cnt++;
		}
	}
	s[1] = s[n+1];
	for(int i=1;i<=n;i++)
	{
		printf("%c",s[i]);
	}
	cout<<endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

const int maxV = 90010;
const int maxN = 4e5+10;
const int MOD = 1e9+7;
const ll INF = 1000000000000000010LL;
const ll inf = 1e9+10;

char s[maxN];
struct node
{
	int L;
	int R;
};
node seg[maxN];
node a[maxN];
int tot;
void change(char &x)
{
	if(x == 'W')
		x = 'B';
	else
		x = 'W';
}
int main() {
	int n,k;
	scanf("%d%d",&n,&k);
	scanf("%s",s+1);
	for(int i=n+1;i<=2*n;i++)
	{
		s[i] = s[i-n];
	}
	tot = 0;
	int x,y;
	int flag = 0;
	for(int i=2;i<=n+1;i++)
	{
		if(s[i-1] != s[i] && s[i+1] != s[i])
		{
			if(!flag)
			{
				x = i;
				y = i;
				flag = 1;
			}
			else
			{
				y = i;
			}
		}
		else
		{
			if(flag == 1)
			{
				a[++tot] = node{x,y};
				flag = 0;
			}
		}
	}
	if(flag == 1)
	{
		a[++tot] = node{x,y};
	}
	if(tot == 1 && a[1].L == 2 && a[1].R == n+1)
	{
		if(k%2 == 1)
		{
			for(int i=1;i<=n;i++)
				change(s[i]);
		}
		for(int i=1;i<=n;i++)
		{
			printf("%c",s[i]);
		}
		cout<<endl;
		return 0;
	}
	for(int i=1;i<=tot;i++)
	{
		int l = a[i].L;
		int r = a[i].R;
		int cnt = 1;
		while(l<=r && cnt<=k)
		{
			s[l] = s[l-1];
			s[r] = s[r+1];
			l++;
			r--;
			cnt++;
		}
		for (int x = l; x <= r; ++ x)
			if (k%2 == 1) change(s[x]);
	}
	s[1] = s[n+1];
	for(int i=1;i<=n;i++)
	{
		printf("%c",s[i]);
	}
	cout<<endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

const int maxV = 90010;
const int maxN = 4e5+10;
const int MOD = 1e9+7;
const ll INF = 1000000000000000010LL;
const ll inf = 1e9+10;

char s[maxN];
struct node
{
	int L;
	int R;
};
node seg[maxN];
node a[maxN];
int tot;
void change(char &x)
{
	if(x == 'W')
		x = 'B';
	else
		x = 'W';
}
int main() {
	int n,k;
	scanf("%d%d",&n,&k);
	scanf("%s",s+1);
	for(int i=n+1;i<=2*n;i++)
	{
		s[i] = s[i-n];
	}
	tot = 0;
	int x,y;
	int flag = 0;
	for(int i=2;i<=n+1;i++)
	{
		if(s[i-1] != s[i] && s[i+1] != s[i])
		{
			if(!flag)
			{
				x = i;
				y = i;
				flag = 1;
			}
			else
			{
				y = i;
			}
		}
		else
		{
			if(flag == 1)
			{
				a[++tot] = node{x,y};
				flag = 0;
			}
		}
	}
	if(flag == 1)
	{
		a[++tot] = node{x,y};
	}
	if(tot == 1 && a[1].L == 2 && a[1].R == n+1)
	{
		if(k%2 == 1)
		{
			for(int i=1;i<=n;i++)
				change(s[i]);
		}
		for(int i=1;i<=n;i++)
		{
			printf("%c",s[i]);
		}
		cout<<endl;
		return 0;
	}
	for(int i=1;i<=tot;i++)
	{
		int l = a[i].L;
		int r = a[i].R;
		int cnt = k;
		while(l<r && cnt>= 0)
		{
			if((cnt%2)==1)
			{
				change(s[l]);
				change(s[r]);
			}
			l++;
			r--;
			cnt--;
		}
		if(k%2 == 1)
		{
			for(int i=l;i<=r;i++)
			{
				change(s[i]);
			}
		}
	}
	s[1] = s[n+1];
	for(int i=1;i<=n;i++)
	{
		printf("%c",s[i]);
	}
	cout<<endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

const int maxV = 90010;
const int maxN = 2e5+10;
const int MOD = 1e9+7;
const ll INF = 1000000000000000010LL;
const int inf = 1e9+10;
#define X first;
#define Y second;

vector<int> p;

int a[maxN];
int u[maxN];
char s[maxN];
int n,k;
int main() {
	scanf("%d %d\n",&n,&k);
	scanf("%s",s);
	for(int i=0;i<n;i++)
	{
		if(s[i] == 'B')
			a[i] = 1;
	}
	int cnt = 0;
	for(int i=0;i<n;i++)
	{
		if(a[i] == a[(i-1+n)%n] || a[i] == a[(i+1)%n])
		{
			u[i] = 1;
			p.push_back(i);
			cnt++;
		}
	}
	if(cnt == 0)
	{
		for(int i=0;i<n;i++)
		{
			a[i] ^= (k%2);
		}
	}
	else
	{
		for(int i=0;i<n;i++)
		{
			if(u[i])continue;
			int pos = lower_bound(p.begin(),p.end(),i) - p.begin();
			int R = (pos == p.size())?p[0]:p[pos];
			int L = (pos == 0)?p.back():p[pos-1];

			int Rlen = (R-i+n)%n;
			int Llen = (i-L+n)%n;
			if(Rlen > k && Llen > k)
			{
				a[i] ^= (k%2);
			}
			else if(Llen < Rlen)
			{
				a[i] = a[L];
			}
			else
			{
				a[i] = a[R];
			}
		}
	}
	for(int i=0;i<n;i++)
	{
		if(a[i])
		{
			putchar('B');
		}
		else
		{
			putchar('W');
		}
	}
	cout<<endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
int c[N], n, k, mark[N], cnt;
void getAns(int l, int r, int ll, int rr) {
	int len;
	if (r < l)
		len = (n - l) + (r + 1);
	else
		len = r - l + 1;
	int mx = (len + 1) / 2;
	for (int i = l; i < l + min(mx, k); i = (i + 1) % n) {
		mark[i] = ll;
		c[i] = ll;
	}
	int nd = min(mx, k), en = r;
	while (nd > 0) {
		mark[en] = rr;
		c[en] = rr;
		en = (en - 1 + n) % n;
		nd--;
	}
	for (int i = l; i <= r; i = (i + 1) % n) {
		if (mark[i] == 0) {
			if (k % 2) {
				c[i] = -c[i];
				mark[i] = c[i];
			}
			else
				mark[i] = c[i];
		}
	}
	cnt += len;
	return;
}
int main() {
	ios_base::sync_with_stdio (false);
	cin.tie(0);
	cout.tie(0);
	cin >> n >> k;
	string s;
	cin >> s;
	for (int i = 0; i < n; i++)
		if (s[i] == 'W')
			c[i] = -1;
		else
			c[i] = 1;
	int st = -1, en = -1;
	for (int i = 0; i < n; i++) {
		if (c[i] == c[(i + 1) % n] || c[i] == c[(i + n - 1) % n]) {
			mark[i] = c[i];
			st = i;
			cnt++;
		}
	}
	if (st == -1) {
		if (k % 2 == 0) {
			for (int i = 0; i < n; i++) {
				if (c[i] == 1)
					cout << 'B';
				else
					cout << 'W';
			}
			return 0;
		}
		else {
			for (int i = 0; i < n; i++) {
				if (c[i] == 1)
					cout << 'W';
				else
					cout << 'B';
			}
			return 0;
		}
		return 0;
	}
//	for (int i = 0; i < n; i++) {
//		cout << mark[i] << " ";
//	}
//	cout << endl;
//	cout << "st = " << st << endl;
	if (k == 99071)
		cout << "HO" << endl;
	while (cnt < n) {
		if (k == 99071) {
			cout << cnt << endl;
		}
		while (mark[st] != 0)
			st = (st + 1) % n;
		en = (st + 1) % n;
		while (mark[en] == 0)
			en = (en + 1) % n;
		en = (en - 1 + n) % n;
//		cout << "st = " << st << " en = " << en << endl;
		getAns(st, en, c[(st - 1 + n) % n], c[(en + 1) % n]);
	}
	for (int i = 0; i < n; i++) {
		if (c[i] == 1)
			cout << 'B';
		else
			cout << 'W';
	}
//	cout << endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
int c[N], n, k, mark[N], cnt;
void getAns(int l, int r, int ll, int rr) {
	int len;
	if (r < l)
		len = (n - l) + (r + 1);
	else
		len = r - l + 1;
	int mx = (len + 1) / 2;
	for (int i = l; i < l + min(mx, k); i = (i + 1) % n) {
		mark[i] = ll;
		c[i] = ll;
	}
	int nd = min(mx, k), en = r;
	while (nd > 0) {
		mark[en] = rr;
		c[en] = rr;
		en = (en - 1 + n) % n;
		nd--;
	}
	for (int i = l; i <= r; i = (i + 1) % n) {
		if (mark[i] == 0) {
			if (k % 2) {
				c[i] = -c[i];
				mark[i] = c[i];
			}
			else
				mark[i] = c[i];
		}
	}
	cnt += len;
	return;
}
int main() {
	ios_base::sync_with_stdio (false);
	cin.tie(0);
	cout.tie(0);
	cin >> n >> k;
	string s;
	cin >> s;
	for (int i = 0; i < n; i++)
		if (s[i] == 'W')
			c[i] = -1;
		else
			c[i] = 1;
	int st = -1, en = -1;
	for (int i = 0; i < n; i++) {
		if (c[i] == c[(i + 1) % n] || c[i] == c[(i + n - 1) % n]) {
			mark[i] = c[i];
			st = i;
			cnt++;
		}
	}
	if (st == -1) {
		if (k % 2 == 0) {
			for (int i = 0; i < n; i++) {
				if (c[i] == 1)
					cout << 'B';
				else
					cout << 'W';
			}
			return 0;
		}
		else {
			for (int i = 0; i < n; i++) {
				if (c[i] == 1)
					cout << 'W';
				else
					cout << 'B';
			}
			return 0;
		}
		return 0;
	}
//	for (int i = 0; i < n; i++) {
//		cout << mark[i] << " ";
//	}
//	cout << endl;
//	cout << "st = " << st << endl;
	if (k == 99071)
		cout << "HO" << endl;
	while (cnt < n) {
		if (k == 99071) {
			cout << cnt << endl;
		}
		while (mark[st] != 0)
			st = (st + 1) % n;
		en = (st + 1) % n;
		while (mark[en] == 0)
			en = (en + 1) % n;
		en = (en - 1 + n) % n;
		if (k == 99071)
			cout << "st = " << st << " en = " << en << endl;
		getAns(st, en, c[(st - 1 + n) % n], c[(en + 1) % n]);
	}
	for (int i = 0; i < n; i++) {
		if (c[i] == 1)
			cout << 'B';
		else
			cout << 'W';
	}
//	cout << endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
int c[N], n, k, mark[N], cnt;
void getAns(int l, int r, int ll, int rr) {
	int len;
	if (r < l)
		len = (n - l) + (r + 1);
	else
		len = r - l + 1;
	int mx = (len + 1) / 2;
	for (int i = l; i != (l + min(mx, k)) % n; i = (i + 1) % n) {
		mark[i] = ll;
		c[i] = ll;
	}
	int nd = min(mx, k), en = r;
	while (nd > 0) {
		mark[en] = rr;
		c[en] = rr;
		en = (en - 1 + n) % n;
		nd--;
	}
	for (int i = l; i <= r; i = (i + 1) % n) {
		if (mark[i] == 0) {
			if (k % 2) {
				c[i] = -c[i];
				mark[i] = c[i];
			}
			else
				mark[i] = c[i];
		}
	}
	cnt += len;
	return;
}
int main() {
	ios_base::sync_with_stdio (false);
	cin.tie(0);
	cout.tie(0);
	cin >> n >> k;
	string s;
	cin >> s;
	for (int i = 0; i < n; i++)
		if (s[i] == 'W')
			c[i] = -1;
		else
			c[i] = 1;
	int st = -1, en = -1;
	for (int i = 0; i < n; i++) {
		if (c[i] == c[(i + 1) % n] || c[i] == c[(i + n - 1) % n]) {
			mark[i] = c[i];
			st = i;
			cnt++;
		}
	}
	if (st == -1) {
		if (k % 2 == 0) {
			for (int i = 0; i < n; i++) {
				if (c[i] == 1)
					cout << 'B';
				else
					cout << 'W';
			}
			return 0;
		}
		else {
			for (int i = 0; i < n; i++) {
				if (c[i] == 1)
					cout << 'W';
				else
					cout << 'B';
			}
			return 0;
		}
		return 0;
	}
//	for (int i = 0; i < n; i++) {
//		cout << mark[i] << " ";
//	}
//	cout << endl;
//	cout << "st = " << st << endl;
//	if (k == 99071)
//		cout << "HO" << endl;
	while (cnt < n) {
//		if (k == 99071) {
//			cout << cnt << endl;
//		}
		while (mark[st] != 0)
			st = (st + 1) % n;
		en = (st + 1) % n;
		while (mark[en] == 0)
			en = (en + 1) % n;
		en = (en - 1 + n) % n;
//		if (k == 99071)
//			cout << "st = " << st << " en = " << en << endl;
		getAns(st, en, c[(st - 1 + n) % n], c[(en + 1) % n]);
	}
	for (int i = 0; i < n; i++) {
		if (c[i] == 1)
			cout << 'B';
		else
			cout << 'W';
	}
//	cout << endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
int c[N], n, k, mark[N], cnt;
void getAns(int l, int r, int ll, int rr) {
	int len;
	if (r < l)
		len = (n - l) + (r + 1);
	else
		len = r - l + 1;
	int mx = (len + 1) / 2;
	for (int i = l; i < l + min(mx, k); i = (i + 1) % n) {
		mark[i] = ll;
		c[i] = ll;
	}
	int nd = min(mx, k), en = r;
	while (nd > 0) {
		mark[en] = rr;
		c[en] = rr;
		en = (en - 1 + n) % n;
		nd--;
	}
	for (int i = l; i <= r; i = (i + 1) % n) {
		if (mark[i] == 0) {
			if (k % 2) {
				c[i] = -c[i];
				mark[i] = c[i];
			}
			else
				mark[i] = c[i];
		}
	}
	cnt += len;
	return;
}
int main() {
	ios_base::sync_with_stdio (false);
	cin.tie(0);
	cout.tie(0);
	cin >> n >> k;
	string s;
	cin >> s;
	for (int i = 0; i < n; i++)
		if (s[i] == 'W')
			c[i] = -1;
		else
			c[i] = 1;
	int st = -1, en = -1;
	for (int i = 0; i < n; i++) {
		if (c[i] == c[(i + 1) % n] || c[i] == c[(i + n - 1) % n]) {
			mark[i] = c[i];
			st = i;
			cnt++;
		}
	}
	if (st == -1) {
		if (k % 2 == 0) {
			for (int i = 0; i < n; i++) {
				if (c[i] == 1)
					cout << 'B';
				else
					cout << 'W';
			}
			return 0;
		}
		else {
			for (int i = 0; i < n; i++) {
				if (c[i] == 1)
					cout << 'W';
				else
					cout << 'B';
			}
			return 0;
		}
		return 0;
	}
//	for (int i = 0; i < n; i++) {
//		cout << mark[i] << " ";
//	}
//	cout << endl;
//	cout << "st = " << st << endl;
	while (cnt < n) {
		if (k == 9971) {
			cout << cnt << "\n";
		}
		while (mark[st] != 0)
			st = (st + 1) % n;
		en = (st + 1) % n;
		while (mark[en] == 0)
			en = (en + 1) % n;
		en = (en - 1 + n) % n;
//		cout << "st = " << st << " en = " << en << endl;
		getAns(st, en, c[(st - 1 + n) % n], c[(en + 1) % n]);
	}
	for (int i = 0; i < n; i++) {
		if (c[i] == 1)
			cout << 'B';
		else
			cout << 'W';
	}
//	cout << endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
int c[N], n, k, mark[N], cnt;
void getAns(int l, int r, int ll, int rr) {
	int len;
	if (r < l)
		len = (n - l) + (r + 1);
	else
		len = r - l + 1;
	int mx = (len + 1) / 2;
	for (int i = l; i != (l + min(mx, k)) % n; i = (i + 1) % n) {
//		cout << "i = " << i << endl;
		mark[i] = ll;
		c[i] = ll;
	}
	int nd = min(mx, k), en = r;
	while (nd > 0) {
		mark[en] = rr;
		c[en] = rr;
		en = (en - 1 + n) % n;
		nd--;
	}
	for (int i = l; i != (r + 1) % n; i = (i + 1) % n) {
		if (mark[i] == 0) {
			if (k % 2) {
				c[i] = -c[i];
				mark[i] = c[i];
			}
			else
				mark[i] = c[i];
		}
	}
	cnt += len;
	return;
}
int main() {
	ios_base::sync_with_stdio (false);
	cin.tie(0);
	cout.tie(0);
	cin >> n >> k;
	string s;
	cin >> s;
	for (int i = 0; i < n; i++)
		if (s[i] == 'W')
			c[i] = -1;
		else
			c[i] = 1;
	int st = -1, en = -1;
	for (int i = 0; i < n; i++) {
		if (c[i] == c[(i + 1) % n] || c[i] == c[(i + n - 1) % n]) {
			mark[i] = c[i];
			st = i;
			cnt++;
		}
	}
	if (st == -1) {
		if (k % 2 == 0) {
			for (int i = 0; i < n; i++) {
				if (c[i] == 1)
					cout << 'B';
				else
					cout << 'W';
			}
			return 0;
		}
		else {
			for (int i = 0; i < n; i++) {
				if (c[i] == 1)
					cout << 'W';
				else
					cout << 'B';
			}
			return 0;
		}
		return 0;
	}
//	for (int i = 0; i < n; i++) {
//		cout << mark[i] << " ";
//	}
//	cout << endl;
//	cout << "st = " << st << endl;
	while (cnt < n) {
		while (mark[st] != 0)
			st = (st + 1) % n;
		en = (st + 1) % n;
		while (mark[en] == 0)
			en = (en + 1) % n;
		en = (en - 1 + n) % n;
//		cout << "st = " << st << " en = " << en << endl;
		getAns(st, en, c[(st - 1 + n) % n], c[(en + 1) % n]);
	}
	for (int i = 0; i < n; i++) {
		if (c[i] == 1)
			cout << 'B';
		else
			cout << 'W';
	}
//	cout << endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
int c[N], n, k, mark[N], cnt;
void getAns(int l, int r, int ll, int rr) {
	int len;
	if (r < l)
		len = (n - l) + (r + 1);
	else
		len = r - l + 1;
	int mx = (len + 1) / 2;
	for (int i = l; i < l + min(mx, k); i = (i + 1) % n) {
		mark[i] = ll;
		c[i] = ll;
	}
	int nd = min(mx, k), en = r;
	while (nd > 0) {
		mark[en] = rr;
		c[en] = rr;
		en = (en - 1 + n) % n;
		nd--;
	}
	for (int i = l; i <= r; i = (i + 1) % n) {
		if (mark[i] == 0) {
			if (k % 2) {
				c[i] = -c[i];
				mark[i] = c[i];
			}
			else
				mark[i] = c[i];
		}
	}
	cnt += len;
	return;
}
int main() {
	cin >> n >> k;
	string s;
	cin >> s;
	for (int i = 0; i < n; i++)
		if (s[i] == 'W')
			c[i] = -1;
		else
			c[i] = 1;
	int st = -1, en = -1;
	for (int i = 0; i < n; i++) {
		if (c[i] == c[(i + 1) % n] || c[i] == c[(i + n - 1) % n]) {
			mark[i] = c[i];
			st = i;
			cnt++;
		}
	}
	if (st == -1) {
		if (k % 2 == 0) {
			for (int i = 0; i < n; i++) {
				if (c[i] == 1)
					cout << 'B';
				else
					cout << 'W';
			}
			return 0;
		}
		else {
			for (int i = 0; i < n; i++) {
				if (c[i] == 1)
					cout << 'W';
				else
					cout << 'B';
			}
			return 0;
		}
	}
//	for (int i = 0; i < n; i++) {
//		cout << mark[i] << " ";
//	}
//	cout << endl;
//	cout << "st = " << st << endl;
	while (cnt < n) {
		while (mark[st] != 0)
			st = (st + 1) % n;
		en = (st + 1) % n;
		while (mark[en] == 0)
			en = (en + 1) % n;
		en = (en - 1 + n) % n;
//		cout << "st = " << st << " en = " << en << endl;
		getAns(st, en, c[(st - 1 + n) % n], c[(en + 1) % n]);
	}
	for (int i = 0; i < n; i++) {
		if (c[i] == 1)
			cout << 'B';
		else
			cout << 'W';
	}
//	cout << endl;
	return 0;
}


#include<bits/stdc++.h>
#define ll long long int
#define pii pair<ll,ll>
#define mp make_pair
#define pb push_back
#define all(v) v.begin(),v.end()
#define ff first
#define ss second
#define M 500005
#define mod 1000000007
#define inf LLONG_MAX
using namespace std;
vector<ll> v;
int main()
{
//	ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	ll t,n,m,q,i,j,k,x,y,z;
	string s;
	x=-1;
	cin>>n>>k;
	cin>>s;
	v.assign(n,-1);
	for(i=0;i<n;i++){
		if(s[i]==s[(i+1)%n]){
			v[i]=0;
		}
		else if(s[i]==s[(i-1+n)%n]){
			v[i]=0;
			x = i;
		}
	}
//	cout<<x<<"\n";
	if(x==-1){
		if(k&1){
			for(i=0;i<n;i++){
				if(s[i]=='W')
				cout<<'B';
				else
				cout<<'W';
			}
		}
		else{
			cout<<s<<"\n";
		}
	}
	else{
		y=x;
		for(i=0;i<n;i++){
			if(v[x]!=0){
				v[x]=(v[(x-1+n)%n])+1;
			}

			x++;
			x%=n;
		}
		x=y;
		for(i=0;i<n;i++){
			if(v[x]!=0){
				v[x]=min(v[x],v[(x+1)%n]+1);
			}
//			cout<<x<<" "<<v[x]<<" "<<(x+1)%n<<" "<<v[(x+1)%n]<<"\n";
			x--;
			if(x<0)
			x=n-1;
		}
//		for(i=0;i<n;i++){
//			cout<<v[i]<<" ";
//		}
//		cout<<"\n";
		for(i=0;i<n;i++){
			x = min(k+1,v[i]);
			if(x&1){
				if(s[i]=='W')
				cout<<"B";
				else
				cout<<"W";
			}
			else{
				cout<<s[i];
			}
		}
		cout<<"\n";
	}

}

// Name - Hemant Chowdhury
// Arise, Awake And Stop Not Till The Goal Is Reached!
// If I fail,I will stand again;If I win,I will move farther


#include<bits/stdc++.h>
#define ll long long int
#define pii pair<ll,ll>
#define mp make_pair
#define pb push_back
#define all(v) v.begin(),v.end()
#define ff first
#define ss second
#define M 500005
#define mod 1000000007
#define inf LLONG_MAX
using namespace std;
vector<ll> v;
int main()
{
//	ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	ll t,n,m,q,i,j,k,x,y,z;
	string s;
	x=-1;
	cin>>n>>k;
	cin>>s;
	v.assign(n,-1);
	for(i=0;i<n;i++){
		if(s[i]==s[(i+1)%n]){
			v[i]=0;
			x = i;
		}
		else if(s[i]==s[(i-1+n)%n]){
			v[i]=0;
			x = i;
		}
	}
//	cout<<x<<"\n";
	if(x==-1){
		if(k&1){
			for(i=0;i<n;i++){
				if(s[i]=='W')
				cout<<'B';
				else
				cout<<'W';
			}
		}
		else{
			cout<<s<<"\n";
		}
	}
	else{
		y=x;
		for(i=0;i<n;i++){
			if(v[x]!=0){
				v[x]=(v[(x-1+n)%n])+1;
			}

			x++;
			x%=n;
		}
		x=y;
		for(i=0;i<n;i++){
			if(v[x]!=0){
				v[x]=min(v[x],v[(x+1)%n]+1);
			}
//			cout<<x<<" "<<v[x]<<" "<<(x+1)%n<<" "<<v[(x+1)%n]<<"\n";
			x--;
			if(x<0)
			x=n-1;
		}
//		for(i=0;i<n;i++){
//			cout<<v[i]<<" ";
//		}
//		cout<<"\n";
		for(i=0;i<n;i++){
			x = min(k,v[i]);
			if(x&1){
				if(s[i]=='W')
				cout<<"B";
				else
				cout<<"W";
			}
			else{
				cout<<s[i];
			}
		}
		cout<<"\n";
	}

}

// Name - Hemant Chowdhury
// Arise, Awake And Stop Not Till The Goal Is Reached!
// If I fail,I will stand again;If I win,I will move farther


#include<bits/stdc++.h>
#define ll long long int
#define pii pair<ll,ll>
#define mp make_pair
#define pb push_back
#define all(v) v.begin(),v.end()
#define ff first
#define ss second
#define M 500005
#define mod 1000000007
#define inf LLONG_MAX
using namespace std;
vector<ll> v;
int main()
{
//	ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	ll t,n,m,q,i,j,k,x,y,z;
	string s;
	x=-1;
	cin>>n>>k;
	cin>>s;
	v.assign(n,-1);
	for(i=0;i<n;i++){
		if(s[i]==s[(i+1)%n]){
			v[i]=0;
		}
		else if(s[i]==s[(i-1+n)%n]){
			v[i]=0;
			x = i;
		}
	}
//	cout<<x<<"\n";
	if(x==-1){
		if(k&1){
			for(i=0;i<n;i++){
				if(s[i]=='W')
				cout<<'B';
				else
				cout<<'W';
			}
		}
		else{
			cout<<s<<"\n";
		}
	}
	else{
		y=x;
		for(i=0;i<n;i++){
			if(v[x]!=0){
				v[x]=(v[(x-1+n)%n])+1;
			}

			x++;
			x%=n;
		}
		x=y;
		for(i=0;i<n;i++){
			if(v[x]!=0){
				v[x]=min(v[x],v[(x+1)%n]+1);
			}
//			cout<<x<<" "<<v[x]<<" "<<(x+1)%n<<" "<<v[(x+1)%n]<<"\n";
			x--;
			if(x<0)
			x=n-1;
		}
//		for(i=0;i<n;i++){
//			cout<<v[i]<<" ";
//		}
//		cout<<"\n";
		for(i=0;i<n;i++){
			x = min(k,v[i]);
			if(x&1){
				if(s[i]=='W')
				cout<<"B";
				else
				cout<<"W";
			}
			else{
				cout<<s[i];
			}
		}
		cout<<"\n";
	}

}

// Name - Hemant Chowdhury
// Arise, Awake And Stop Not Till The Goal Is Reached!
// If I fail,I will stand again;If I win,I will move farther


#pragma GCC optimize("O3")
#include<bits/stdc++.h>
using namespace std;
#define int long long
//#define d long double
#define pii pair<int,int>
#define pb push_back
#define ff first
#define ss second
#define N 200003
#define inf (int)1e18
#define Arena ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
int mod=1e9+7;

signed main()
{
    Arena

    int n,k;
    cin>>n>>k;
    string s,s1,s2;
    cin>>s;
    s2=s;
    int i,j;
    while((s!=s1) and (k--))
    {
        s1=s;
        j=((s[n-1]=='W') + (s[0]=='W') + (s[1]=='W'));
        s2[0]=(j>1 ? 'W':'B');
        for(i=1;i<=n-2;++i)
            j=((s[i-1]=='W') + (s[i]=='W') + (s[i+1]=='W')),
            s2[i]=(j>1 ? 'W':'B');
        j=((s[n-2]=='W') + (s[n-1]=='W') + (s[0]=='W'));
        s2[n-1]=(j>1 ? 'W':'B');
        s=s2;
    }

    cout<<s;

    return 0;
}
//Just trying


#pragma GCC optimize("O3")
#include<bits/stdc++.h>
using namespace std;
#define int long long
//#define d long double
#define pii pair<int,int>
#define pb push_back
#define N 200003
#define inf (int)1e18
#define Arena ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
int mod=1e9+7;

signed main()
{
    Arena

    int n,k;
    cin>>n>>k;
    string s(""),s1,s3("");
    cin>>s1;
    s+=s1[n-1];
    s+=s1;
    s+=s1[0];
    bool f=0;
    int i,j, ind;

    while(k--)
    {
        f=0;
        for(i=1;i<=n;++i)
        {
            if((s[i-1]==s[i] or s[i+1]==s[i]) and f)
            {
                for(j=ind;j<i;++j)
                    s[j]=s[j+1];
                f=0;
            }
            else if(s[i-1]!=s[i] and s[i+1]!=s[i] and f==0)
                f=1, ind=i;
        }
        if(f)
        {
            if(ind==1)
            {
                if(k%2==0)
                    for(j=ind;j<i;++j)
                        s[j]=('B'+'W'-s[j]);
                return cout<<s.substr(1,n), 0;
            }
            else
                for(j=ind;j<i;++j)
                    s[j]=s[j+1];
        }
        s1=s.substr(1,n);
        if(s1==s3)
            break;
        s3=s1;
    }
    cout<<s1;

    return 0;
}


#pragma GCC optimize("O3")
#include<bits/stdc++.h>
using namespace std;
#define int long long
//#define d long double
#define pii pair<int,int>
#define pb push_back
#define N 200003
#define inf (int)1e18
#define Arena ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
int mod=1e9+7;
string s;
int n,k,k1;
bool f;

void doit(int l,int r,int i,int j)
{
    while(l<r and k1--)
    {
        s[l++]=s[j];
        s[r--]=s[i];
    }
    if(l==r and k1)
        s[l]=s[l-1];
    else if(!k1)
    {
        while(l<=r)
            s[l]='B'+'W'-s[l-1], ++l;
    }
    f=0;
}

signed main()
{
    Arena

    cin>>n>>k;
    string s1;
    cin>>s1;
    s+=s1[n-1];
    s+=s1;
    s+=s1[0];
    f=0;
    int i,j,l,r, ind;

    for(i=1;i<=n;++i)
    {
        if(s[i-1]!=s[i] and s[i+1]!=s[i] and !f)
            f=1, ind=i;
        else if((s[i-1]==s[i] or s[i+1]==s[i]) and f)
        {
            l=ind, r=i-1;
            j=ind-1;
            k1=k;
            doit(l,r,i,j);
        }
    }
    if(f)
    {
        if(ind==1)
        {
            if(k%2)
                for(j=1;j<=n;++j)
                    s[j]='B'+'W'-s[j];
        }
        else
        {
            l=ind;
            r=i-1;
            j=ind-1;
            k1=k;
            doit(l,r,i,j);
        }
    }
    cout<<s.substr(1,n);

    return 0;
}


#pragma GCC optimize("O3")
#include<bits/stdc++.h>
using namespace std;
#define int long long
//#define d long double
#define pii pair<int,int>
#define pb push_back
#define N 200003
#define inf (int)1e18
#define Arena ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
int mod=1e9+7;
string s;
int n,k,k1;
bool f;

void doit(int l,int r,int i,int j)
{
    while(l<r and k1--)
    {
        s[l++]=s[j];
        s[r--]=s[i];
    }
    if(l==r and k1)
        s[l]=s[l-1];
    else if(k1<0)
        while(l<=r)
            s[l]='B'+'W'-s[l-1], ++l;

    f=0;
}

signed main()
{
    Arena

    cin>>n>>k;
    string s1;
    cin>>s1;
    s+=s1[n-1];
    s+=s1;
    s+=s1[0];
    f=0;
    int i,j,l,r, ind;

    for(i=1;i<=n;++i)
    {
        if(s[i-1]!=s[i] and s[i+1]!=s[i] and !f)
            f=1, ind=i;
        else if((s[i-1]==s[i] or s[i+1]==s[i]) and f)
        {
            l=ind, r=i-1, j=ind-1, k1=k;
            doit(l,r,i,j);
        }
    }
    if(f)
    {
        if(ind==1)
        {
            if(k%2)
                for(j=1;j<=n;++j)
                    s[j]='B'+'W'-s[j];
        }
        else
        {
            l=ind, r=i-1, j=ind-1, k1=k;
            doit(l,r,i,j);
        }
    }
    cout<<s.substr(1,n);

    return 0;
}


#pragma GCC optimize("O3")
#include<bits/stdc++.h>
using namespace std;
#define int long long
//#define d long double
#define pii pair<int,int>
#define pb push_back
#define N 200003
#define inf (int)1e18
#define Arena ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
int mod=1e9+7;

signed main()
{
    Arena

    int n,k,k1;
    cin>>n>>k;
    string s(""),s1;
    cin>>s1;
    s+=s1[n-1];
    s+=s1;
    s+=s1[0];
    bool f=0;
    int i,j,l,r, ind;

    for(i=1;i<=n;++i)
    {
        if(s[i-1]!=s[i] and s[i+1]!=s[i] and !f)
            f=1, ind=i;
        else if((s[i-1]==s[i] or s[i+1]==s[i]) and f)
        {
            l=ind, r=i-1;
            j=ind-1;
            k1=k;
            while(l<r and k1--)
            {
                s[l]=s[j];
                s[r]=s[i];
                ++l;
                --r;
       //         cout<<l<<' '<<r<<' '<<k1<<'\n';
            }
            if(l==r and k1)
                s[l]=s[l-1];
            else if(!k1)
            {
                while(l<=r)
                    s[l]='B'+'W'-s[l-1], ++l;
            }

            f=0;
        }
    }
    cout<<s.substr(1,n);

    return 0;
}


#pragma GCC optimize("O3")
#include<bits/stdc++.h>
using namespace std;
#define int long long
//#define d long double
#define pii pair<int,int>
#define pb push_back
#define N 200003
#define inf (int)1e18
#define Arena ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
int mod=1e9+7;
string s;
int n,k,k1;
bool f;

void doit(int l,int r,int i,int j)
{
    while(l<r and k1--)
    {
        s[l++]=s[j];
        s[r--]=s[i];
    }
    if(l==r and k1)
        s[l]=s[l-1];
    else if(k1<=0)
        while(l<=r)
            s[l]='B'+'W'-s[l-1], ++l;

    f=0;
}

signed main()
{
    Arena

    cin>>n>>k;
    string s1;
    cin>>s1;
    s+=s1[n-1];
    s+=s1;
    s+=s1[0];
    f=0;
    int i,j,l,r, ind;

    for(i=1;i<=n;++i)
    {
        if(s[i-1]!=s[i] and s[i+1]!=s[i] and !f)
            f=1, ind=i;
        else if((s[i-1]==s[i] or s[i+1]==s[i]) and f)
        {
            l=ind, r=i-1, j=ind-1, k1=k;
            doit(l,r,i,j);
        }
    }
    if(f)
    {
        if(ind==1)
        {
            if(k%2)
                for(j=1;j<=n;++j)
                    s[j]='B'+'W'-s[j];
        }
        else
        {
            l=ind, r=i-1, j=ind-1, k1=k;
            doit(l,r,i,j);
        }
    }
    cout<<s.substr(1,n);

    return 0;
}


#pragma GCC optimize("O3")
#include<bits/stdc++.h>
using namespace std;
#define int long long
//#define d long double
#define pii pair<int,int>
#define pb push_back
#define N 200003
#define inf (int)1e18
#define Arena ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
int mod=1e9+7;
string s;
int n,k,k1;
bool f,f2;

void doit(int l,int r,int i,int j)
{
    while(l<r and k1--)
    {
        s[l++]=s[j];
        s[r--]=s[i];
    }
    if(l==r and k1)
        s[l]=s[l-1];
    else if(k1<=0)
        while(l<=r)
            s[l]='B'+'W'-s[l-1], ++l;

    f=0;
}

signed main()
{
    Arena

    cin>>n>>k;
    string s1;
    cin>>s1;
    s=s1[n-1];
    s+=s1;
    s+=s1;
    f=0;
    f2=0;
    int i,j,l,r,cnt, ind,ind2, mainind;
    for(i=1;i<=n;++i)
    {
        if(s[i]==s[i-1] or s[i]==s[i+1])
            f=1;
        else
        {
            if(f)
                break;
            if(!f2)
                f2=1,ind2=i;
        }
    }
    if(i>n and !f2)
        return cout<<s.substr(1,n), 0;
    if(f)
        mainind=i;
    else if(f2)
        mainind=ind2;
    else
        mainind=i;

    f=0;
    for(i=mainind,cnt=1;cnt<=n;++i,++cnt)
    {
        if(s[i-1]!=s[i] and s[i+1]!=s[i] and !f)
            f=1, ind=i;
        else if((s[i-1]==s[i] or s[i+1]==s[i]) and f)
        {
            l=ind, r=i-1, j=ind-1, k1=k;
            doit(l,r,i,j);
        }
    }

    if(f)
    {
        if(ind==mainind)
        {
            string ans("");
            int sz=mainind-1;
            ans+=s.substr(n+1,sz);
            ans+=s.substr(mainind,n-sz);
            if(k%2)
                for(j=0;j<n;++j)
                    ans[j]='B'+'W'-ans[j];

            return cout<<ans, 0;
        }
        else
        {
            l=ind, r=i-1, j=ind-1, k1=k;
            doit(l,r,i,j);
        }
    }
    string ans("");
    int sz=mainind-1;
    ans+=s.substr(n+1,sz);
    ans+=s.substr(mainind,n-sz);
    cout<<ans;

    return 0;
}


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

const int N = 1e6 + 100;

int main() {
    // freopen("in.txt", "r", stdin);
    ios::sync_with_stdio(0);
    cin.tie(0);

    int n;
    long long K;
    cin >> n >> K;
    string s;
    cin >> s;
    string t = s;
    s = s + s + s;
    vector<int> left_border, right_border;
    for(int i = 0; i+1 < s.size(); i++) {
        if(s[i] == s[i+1]) {
            left_border.push_back(i+1);
            right_border.push_back(i);
        }
    }
    if(left_border.size() == 0) {
        cout << t << endl;
        return 0;
    }
    string res(n, 'W');
    for(int i = n; i < n + n; i++) {
        if(s[i] == s[i+1] or s[i] == s[i-1]) {
            res[i-n] = s[i];
            continue;
        }
        auto it = lower_bound(left_border.begin(), left_border.end(), i);
//        assert(it != left_border.begin());
        it--;
        int l = *it;
        it = upper_bound(right_border.begin(), right_border.end(), i);
        int r = *it;
//        assert(r < s.size());
        int d = min(r-i, i-l);
        if(d <= K) {
            if(r-i < i-l) res[i-n] = s[r];
            else res[i-n] = s[l];
        }
        else {
            if(s[i] == 'W') res[i-n] = 'B';
            else res[i-n] = 'W';
        }
    }
    cout << res << endl;
    return 0;
}


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

const int N = 1e6 + 100;

bool vis[N];
int dis[N];

int main() {
    // freopen("in.txt", "r", stdin);
    ios::sync_with_stdio(0);
    cin.tie(0);

    int n;
    int K;
    cin >> n >> K;
    string s;
    cin >> s;
    string res = s;
    queue<int> que;
    for(int i = 0; i < n; i++) {
        if(s[i] == s[(i+n-1)%n] or s[i] == s[(i+1)%n]) que.push(i), vis[i] = 1;
    }
    while(que.size() > 0) {
        int u = que.front();
        que.pop();
        if(vis[u] == K) continue;
        int v = (u+1)%n;
        int w = (u+n-1)%n;
        if(vis[v] == 0) {
            vis[v] = 1;
            dis[v] = dis[u] + 1;
            que.push(v);
            res[v] = res[u];
        }
        if(vis[w] == 0) {
            vis[w] = 1;
            dis[w] = dis[u] + 1;
            que.push(w);
            res[w] = res[u];
        }
    }
    for(int i = 0; i < n; i++) {
        if(vis[i] == 0) {
            if(K&1) {
                if(res[i] == 'W') res[i] = 'B';
                else res[i] = 'W';
            }
        }
    }
    cout << res << endl;
    return 0;
}


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

const int N = 1e6 + 100;

bool vis[N];
int dis[N];

int main() {
    // freopen("in.txt", "r", stdin);
    ios::sync_with_stdio(0);
    cin.tie(0);

    int n;
    int K;
    cin >> n >> K;
    string s;
    cin >> s;
    string res = s;
    queue<int> que;
    for(int i = 0; i < n; i++) {
        if(s[i] == s[(i+n-1)%n] or s[i] == s[(i+1)%n]) que.push(i), vis[i] = 1;
    }
    while(que.size() > 0) {
        int u = que.front();
        que.pop();
        int v = (u+1)%n;
        int w = (u+n-1)%n;
        if(vis[v] == 0) {
            vis[v] = 1;
            dis[v] = dis[u] + 1;
            que.push(v);
            res[v] = res[u];
        }
        if(vis[w] == 0) {
            vis[w] = 1;
            dis[w] = dis[u] + 1;
            que.push(w);
            res[w] = res[u];
        }
    }
    for(int i = 0; i < n; i++) {
        if(vis[i] == 0) {
            if(K&1) {
                if(res[i] == 'W') res[i] = 'B';
                else res[i] = 'W';
            }
        }
    }
    cout << res << endl;
    return 0;
}


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

const int N = 1e6 + 100;

int main() {
    // freopen("in.txt", "r", stdin);
    ios::sync_with_stdio(0);
    cin.tie(0);

    int n;
    long long K;
    cin >> n >> K;
    string s;
    cin >> s;
    string t = s;
    s = s + s + s;
    vector<int> left_border, right_border;
    for(int i = 0; i+1 < s.size(); i++) {
        if(s[i] == s[i+1]) {
            left_border.push_back(i+1);
            right_border.push_back(i);
        }
    }
    if(left_border.size() == 0) {
        cout << t << endl;
        return 0;
    }
    string res(n, 'W');
    for(int i = n; i < n + n; i++) {
        if(s[i] == s[i+1] or s[i] == s[i-1]) {
            res[i-n] = s[i];
            continue;
        }
        auto it = lower_bound(left_border.begin(), left_border.end(), i);
        assert(it != left_border.begin());
        it--;
        int l = *it;
        it = upper_bound(right_border.begin(), right_border.end(), i);
        int r = *it;
        assert(r < s.size());
        int d = min(r-i, i-l);
        if(d <= K) {
            if(r-i < i-l) res[i-n] = s[r];
            else res[i-n] = s[l];
        }
        else {
            if(s[i] == 'W') res[i-n] = 'B';
            else res[i-n] = 'W';
        }
    }
    cout << res << endl;
    return 0;
}


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

const int N = 1e6 + 100;

bool vis[N];
int dis[N];

int main() {
    // freopen("in.txt", "r", stdin);
    ios::sync_with_stdio(0);
    cin.tie(0);

    int n;
    int K;
    cin >> n >> K;
    string s;
    cin >> s;
    string res = s;
    queue<int> que;
    for(int i = 0; i < n; i++) {
        if(s[i] == s[(i+n-1)%n] or s[i] == s[(i+1)%n]) que.push(i), vis[i] = 1;
    }
    while(que.size() > 0) {
        int u = que.front();
        que.pop();
        if(dis[u] == K) continue;
        int v = (u+1)%n;
        int w = (u+n-1)%n;
        if(vis[v] == 0) {
            vis[v] = 1;
            dis[v] = dis[u] + 1;
            que.push(v);
            res[v] = res[u];
        }
        if(vis[w] == 0) {
            vis[w] = 1;
            dis[w] = dis[u] + 1;
            que.push(w);
            res[w] = res[u];
        }
    }
    cout << res << endl;
    return 0;
}


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

const int N = 1e6 + 100;

bool vis[N];
int dis[N];

int main() {
    // freopen("in.txt", "r", stdin);
    ios::sync_with_stdio(0);
    cin.tie(0);
//
    int n;
    int K;
    cin >> n >> K;
    string s;
    cin >> s;
    string res = s;
    queue<int> que;
    for(int i = 0; i < n; i++) {
        if(s[i] == s[(i+n-1)%n] or s[i] == s[(i+1)%n]) que.push(i), vis[i] = 1;
    }
    while(que.size() > 0) {
        int u = que.front();
        que.pop();
        if(dis[u] == K) continue;
        int v = (u+1)%n;
        int w = (u+n-1)%n;
        if(vis[v] == 0) {
            vis[v] = 1;
            dis[v] = dis[u] + 1;
            que.push(v);
            res[v] = res[u];
        }
        if(vis[w] == 0) {
            vis[w] = 1;
            dis[w] = dis[u] + 1;
            que.push(w);
            res[w] = res[u];
        }
    }
    for(int i = 0; i < n; i++) {
        if(vis[i] == 0) {
            if(K&1) {
                if(res[i] == 'W') res[i] = 'B';
                else res[i] = 'W';
            }
        }
    }
    cout << res << endl;
    return 0;
}


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

const int N = 1e6 + 100;

int main() {
    // freopen("in.txt", "r", stdin);
    ios::sync_with_stdio(0);
    cin.tie(0);

    int n;
    long long K;
    cin >> n >> K;
    string s;
    cin >> s;
    string t = s;
    s = s + s + s;
    vector<int> left_border, right_border;
    for(int i = 0; i+1 < s.size(); i++) {
        if(s[i] == s[i+1]) {
            left_border.push_back(i+1);
            right_border.push_back(i);
        }
    }
    if(left_border.size() == 0) {
        cout << t << endl;
        return 0;
    }
    string res(n, 'W');
    for(int i = n; i < n + n; i++) {
        if(s[i] == s[i+1] or s[i] == s[i-1]) {
            res[i-n] = s[i];
            continue;
        }
        auto it = lower_bound(left_border.begin(), left_border.end(), i);
//        assert(it != left_border.begin());
        it--;
        int l = *it;
        it = upper_bound(right_border.begin(), right_border.end(), i);
        int r = *it;
//        assert(r < s.size());
        int d = min(r-i, i-l);
        if(d <= K) {
            if(r-i < i-l) res[i-n] = s[r];
            else res[i-n] = s[l];
        }
    }
    cout << res << endl;
    return 0;
}