#include<bits/stdc++.h>
using namespace std;
//#include<ext/pb_ds/assoc_container.hpp>
//#include<ext/pb_ds/tree_policy.hpp>
////
//    #pragma GCC optimize("unroll-loops")
//    #pragma GCC optimize("Ofast")
//    #pragma GCC optimize("-O3")
//    #pragma GCC optimize("no-stack-protector")
//    #pragma GCC optimize("fast-math")
//////#define LOCAL
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cout << *x, 0);
sim > char dud(...);
struct debug {
#ifndef LOCAL
~debug() { cout << endl; }
eni(!=) cout << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
	*this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
#define fi first
#define f first
#define se second
#define s second
#define vi_a vector<int>a;
#define p_b push_back
////////////////////////////////???????????????CHECK THIS OUT???????????????//////////////////////////////
#define ll long long
//#define ull unsigned long long
typedef unsigned long long ull;
////////////////////////////////???????????????CHECK THIS OUT???????????????//////////////////////////////
#define ld long double
#define pll pair<ll,ll>
#define pii pair<int,int>
#define m_p make_pair
#define fast_io cin.tie(0);cout.tie(0);ios_base::sync_with_stdio(0);
#define all(x) x.begin(),x.end()
#define getfiles    ifstream cin("input.txt");ofstream cout("output.txt");
#define pw(x) (1ll << x)
#define sz(x) (ll)x.size()
#define endl "\n"
#define rall(x) x.rbegin(),x.rend()
#define len(a) (ll)a.size()
#define rep(x,l,r) for(ll x=l;x<r;x++)

//using namespace __gnu_pbds;
ld eps = (ld)1 / 1e6;
const ld pi=3.14159265359;
ll inf = 1e18,mod1=1e9+7;
ll sqr(ll a) { return a * a; }
ll qb(ll a) { return a * a * a; }
ll gcd(ll a, ll b) { return !a ? b : gcd(b % a, a); }
void binary(ll val,int to) {for(int i=0;i<to;i++) cerr<<(pw(i) & val ? 1 : 0); cerr<<endl;}
ll binpow(ll a, ll b, ll mod) { return b ? (b % 2 ? (a * (sqr(binpow(a, b / 2, mod)) % mod)) % mod : sqr(binpow(a, b / 2, mod)) % mod) : 1; }
ll binmult(ll a, ll b, ll mod) { return b ? (b % 2 ? (2 * binmult(a, b / 2, mod) + a) % mod : (2 * binmult(a, b / 2, mod)) % mod) : 0; }
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
const ll R=1e4;
const ll tx[4]={1,0,-1,0};
const ll ty[4]={0,1,0,-1};
const char rev_to[4]={'E','W','N','S'};
const int N=1e3+1;
const int M=1e9+7;
//typedef tree<pii,null_type,less<pii>,rb_tree_tag,tree_order_statistics_node_update> st;
void bad(){
    cout<<-1;
    exit(0);
}
bool dp[N][2*N];
char p[N][2*N];
signed main()
{
    fast_io;
//    freopen("in.txt","r",stdin);
//    freopen("out.txt","w",stdout);
    int n,k;
    cin>>n>>k;
    string s;
    cin>>s;
    dp[0][k]=1;
    for(int i=0;i<=n;i++){
        if(s[i]=='?'){
            for(int j=-k+1;j<k;j++){
                if(dp[i][j+k]){
                    dp[i+1][j+k]=1;
                    p[i+1][j+k]='D';
                }
            }
            for(int j=-k+(i!=n-1)+1;j<k;j++){
                if(dp[i][j+k]){
                    dp[i+1][j+k-1]=1;
                    p[i+1][j+k-1]='L';
                }
            }
            for(int j=-k;j<k;j++){
                if(dp[i][j+k]){
                    dp[i+1][j+k+1]=1;
                    p[i+1][j+k+1]='W';
                }
            }
        }
        else{
            if(s[i]=='D'){
                for(int j=-k+1;j<k;j++){
                    if(dp[i][j+k]){
                        dp[i+1][j+k]=1;
                        p[i+1][j+k]=s[i];
                    }
                }
            }
            else if(s[i]=='L'){
                for(int j=-k+(i!=n-1)+1;j<k;j++){
                    if(dp[i][j+k]){
                        dp[i+1][j+k-1]=1;
                        p[i+1][j+k-1]=s[i];
                    }
                }
            }
            else if(s[i]=='W'){
                for(int j=-k;j<k;j++){
                    if(dp[i][j+k]){
                        dp[i+1][j+k+1]=1;
                        p[i+1][j+k+1]=s[i];
                    }
                }
            }
        }
//        for(int j=-k;j<=k;j++){
//            debug()<<imie(dp[i][j+k])<<imie(i)<<imie(j);
//        }
    }
    int t=-1,x=-1;
    if(dp[n][2*k]){
        t=n,x=2*k;
    }
    else if(dp[n][0]){
        t=n,x=0;
    }
    if(t==-1 ) cout<<"NO";
    else{
        string ans;
        while(t){
            if(p[t][x]=='W'){
                ans+='W';
                x--;
            }
            else if(p[t][x]=='L'){
                x++;
                ans+='L';
            }
            else ans+='D';
            t--;
        }
        reverse(all(ans));
        cout<<ans;
    }
    return 0;
}
/*

*/


#include<bits/stdc++.h>
using namespace std;
//#include<ext/pb_ds/assoc_container.hpp>
//#include<ext/pb_ds/tree_policy.hpp>
////
//    #pragma GCC optimize("unroll-loops")
//    #pragma GCC optimize("Ofast")
//    #pragma GCC optimize("-O3")
//    #pragma GCC optimize("no-stack-protector")
//    #pragma GCC optimize("fast-math")
//////#define LOCAL
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cout << *x, 0);
sim > char dud(...);
struct debug {
#ifndef LOCAL
~debug() { cout << endl; }
eni(!=) cout << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
	*this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
#define fi first
#define f first
#define se second
#define s second
#define vi_a vector<int>a;
#define p_b push_back
////////////////////////////////???????????????CHECK THIS OUT???????????????//////////////////////////////
#define ll long long
//#define ull unsigned long long
typedef unsigned long long ull;
////////////////////////////////???????????????CHECK THIS OUT???????????????//////////////////////////////
#define ld long double
#define pll pair<ll,ll>
#define pii pair<int,int>
#define m_p make_pair
#define fast_io cin.tie(0);cout.tie(0);ios_base::sync_with_stdio(0);
#define all(x) x.begin(),x.end()
#define getfiles    ifstream cin("input.txt");ofstream cout("output.txt");
#define pw(x) (1ll << x)
#define sz(x) (ll)x.size()
#define endl "\n"
#define rall(x) x.rbegin(),x.rend()
#define len(a) (ll)a.size()
#define rep(x,l,r) for(ll x=l;x<r;x++)

//using namespace __gnu_pbds;
ld eps = (ld)1 / 1e6;
const ld pi=3.14159265359;
ll inf = 1e18,mod1=1e9+7;
ll sqr(ll a) { return a * a; }
ll qb(ll a) { return a * a * a; }
ll gcd(ll a, ll b) { return !a ? b : gcd(b % a, a); }
void binary(ll val,int to) {for(int i=0;i<to;i++) cerr<<(pw(i) & val ? 1 : 0); cerr<<endl;}
ll binpow(ll a, ll b, ll mod) { return b ? (b % 2 ? (a * (sqr(binpow(a, b / 2, mod)) % mod)) % mod : sqr(binpow(a, b / 2, mod)) % mod) : 1; }
ll binmult(ll a, ll b, ll mod) { return b ? (b % 2 ? (2 * binmult(a, b / 2, mod) + a) % mod : (2 * binmult(a, b / 2, mod)) % mod) : 0; }
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
const ll R=1e4;
const ll tx[4]={1,0,-1,0};
const ll ty[4]={0,1,0,-1};
const char rev_to[4]={'E','W','N','S'};
const int N=1e3+1;
const int M=1e9+7;
//typedef tree<pii,null_type,less<pii>,rb_tree_tag,tree_order_statistics_node_update> st;
void bad(){
    cout<<-1;
    exit(0);
}
bool dp[N][2*N];
char p[N][2*N];
signed main()
{
    fast_io;
//    freopen("in.txt","r",stdin);
//    freopen("out.txt","w",stdout);
    int n,k;
    cin>>n>>k;
    string s;
    cin>>s;
    dp[0][k]=1;
    for(int i=0;i<=n;i++){
        if(s[i]=='?'){
            for(int j=-k+1;j<k;j++){
                if(dp[i][j+k]){
                    dp[i+1][j+k]=1;
                    p[i+1][j+k]='D';
                }
            }
            for(int j=-k+(i!=n-1);j<k;j++){
                if(dp[i][j+k]){
                    dp[i+1][j+k-1]=1;
                    p[i+1][j+k-1]='L';
                }
            }
            for(int j=-k;j<k;j++){
                if(dp[i][j+k]){
                    dp[i+1][j+k+1]=1;
                    p[i+1][j+k+1]='W';
                }
            }
        }
        else{
            if(s[i]=='D'){
                for(int j=-k+1;j<k;j++){
                    if(dp[i][j+k]){
                        dp[i+1][j+k]=1;
                        p[i+1][j+k]=s[i];
                    }
                }
            }
            else if(s[i]=='L'){
                for(int j=-k+(i!=n-1);j<k;j++){
                    if(dp[i][j+k]){
                        dp[i+1][j+k-1]=1;
                        p[i+1][j+k-1]=s[i];
                    }
                }
            }
            else if(s[i]=='W'){
                for(int j=-k;j<k;j++){
                    if(dp[i][j+k]){
                        dp[i+1][j+k+1]=1;
                        p[i+1][j+k+1]=s[i];
                    }
                }
            }
        }
//        for(int j=-k;j<=k;j++){
//            debug()<<imie(dp[i][j+k])<<imie(i)<<imie(j);
//        }
    }
    int t=-1,x=-1;
    if(dp[n][2*k]){
        t=n,x=2*k;
    }
    else if(dp[n][0]){
        t=n,x=0;
    }
    if(t==-1 ) cout<<"NO";
    else{
        string ans;
        while(t){
            if(p[t][x]=='W'){
                ans+='W';
                x--;
            }
            else if(p[t][x]=='L'){
                x++;
                ans+='L';
            }
            else ans+='D';
            t--;
        }
        reverse(all(ans));
        cout<<ans;
    }
    return 0;
}
/*

*/


#include<bits/stdc++.h>
#define ll long long
#define ld long double
using namespace std;
const int N = 1000;
string s;
int n,k,sum,add[N+10],addSum;
void fail(){
	cout<<"NO";
	exit(0);
}
void solve(){
	string s1;
	s1.clear();
	for(int i=0; i<n; ++i)s1+=s[i];
	int change=0,res=0;
	for(int i=n-1; i>=0; --i){
		change+=add[i];
		if(s[i]=='?'){
			if(change<0){
				s1[i]='L';
				change++;
			}
			else if(change>0){
				s1[i]='W';
				change--;
			}
			else s1[i]='D';
		}
	}
	for(int i=0; i<n; ++i){
		if(s1[i]=='W')res++;
		if(s1[i]=='L')res--;
		if(res==k || res==-k)return;
	}
	if(change==0 && (res==k || res==-k) ){
		cout<<s1;
		exit(0);
	}
}
int main()
{
	ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	cin>>n>>k>>s;
	for(int i=0; i<n; ++i){
		if(s[i]=='W')sum++;
		if(s[i]=='L')sum--;
		if(i<n-1 && sum>=k){
			add[i]=k-1-sum-addSum;
			addSum+=add[i];
		}
		if(i<n-1 && sum<=-k){
			add[i]=1-k-sum-addSum;
			addSum+=add[i];
		}
	}
	add[n-1]=k-sum-addSum;
	solve();
	add[n-1]=-k-sum-addSum;
	solve();
	cout<<"NO";
}


#include<bits/stdc++.h>
#define ll long long
#define ld long double
using namespace std;
const int N = 1000;
string s;
int n,k,sum,add[N+10],last;
void fail(){
	cout<<"NO";
	exit(0);
}
void solve(){
	string s1;
	s1.clear();
	for(int i=0; i<n; ++i)s1+=s[i];
	int change=0;
	for(int i=n-1; i>=0; --i){
		change+=add[i];
		if(s[i]=='?'){
			if(change<0){
				s1[i]='L';
				change++;
			}
			else if(change>0){
				s1[i]='W';
				change--;
			}
			else s1[i]='D';
		}
	}
	if(change==0){
		cout<<s1;
		exit(0);
	}
}
int main()
{
	ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	cin>>n>>k>>s;
	for(int i=0; i<n; ++i){
		if(s[i]=='W')sum++;
		if(s[i]=='L')sum--;
		if(i<n-1 && sum>=k){
			add[i]=k-1-sum-add[last];
			last=i;
		}
		if(i<n-1 && sum<=-k){
			add[i]=1-k-sum-add[last];
			last=i;
		}
	}
	add[n-1]=k-sum-add[last];
	solve();
	add[n-1]=-k-sum-add[last];
	solve();
	cout<<"NO";
}


#include<bits/stdc++.h>
#define ll long long
#define ld long double
using namespace std;
const int N = 1000;
string s;
int n,k,sum,add[N+10],addSum;
void fail(){
	cout<<"NO";
	exit(0);
}
void solve(){
	string s1;
	s1.clear();
	for(int i=0; i<n; ++i)s1+=s[i];
	int change=0,res=0;
	for(int i=n-1; i>=0; --i){
		change+=add[i];
		if(s[i]=='?'){
			if(change<0){
				s1[i]='L';
				change++;
			}
			else if(change>0){
				s1[i]='W';
				change--;
			}
			else s1[i]='D';
		}
	}
	for(int i=0; i<n; ++i){
		if(s1[i]=='W')res++;
		if(s1[i]=='L')res--;
		if(i<n-1 && (res==k || res==-k)){
			return;
		}
	}
	if(change==0 && (res==k || res==-k) ){
		cout<<s1;
		exit(0);
	}
}
int main()
{
	ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	cin>>n>>k>>s;
	for(int i=0; i<n; ++i){
		if(s[i]=='W')sum++;
		if(s[i]=='L')sum--;
		if(i<n-1 && sum>=k){
			add[i]=k-1-sum-addSum;
			addSum+=add[i];
		}
		if(i<n-1 && sum<=-k){
			add[i]=1-k-sum-addSum;
			addSum+=add[i];
		}
	}
	add[n-1]=k-sum-addSum;
	solve();
	add[n-1]=-k-sum-addSum;
	solve();
	cout<<"NO";
}


#include<bits/stdc++.h>
#define ll long long
#define ld long double
using namespace std;
const int N = 1000;
string s;
int n,k,sum,maxi,mini,high[N+10],low[N+10],val;
bool L[N+10],D[N+10],W[N+10];
void fail(){
	cout<<"NO";
	exit(0);
}
void solve(){
	for(int i=n-1; i>=0; --i){
			if(s[i]=='W')val--;
			if(s[i]=='L')val++;
			if(s[i]=='?'){
				if(high[i-1]>=val-1 && low[i-1]<val){
					s[i]='W';
					val--;
				}
				else if(high[i-1]>=val && low[i-1]<=val){
					s[i]='D';
				}
				else if(high[i-1]>val && low[i-1]<=val+1){
					s[i]='L';
					val++;
				}
			}
		}
}
int main()
{
	ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	cin>>n>>k>>s;
	for(int i=0; i<n; ++i){
		high[i]=high[i-1];
		low[i]=low[i-1];
		if(s[i]=='W'){
			sum++;
			high[i]++;
			low[i]++;
		}
		if(s[i]=='L'){
			sum--;
			high[i]--;
			low[i]--;
		}
		if(s[i]=='?'){
			high[i]++;
			low[i]--;
		}
		if(i<n-1){
			high[i]=min(high[i],k-1);
			low[i]=max(low[i],1-k);
		}
		if(high[i]<low[i])fail();
	}
	val=k;
	if(high[n-1]==k){
		solve();
		cout<<s;
	}
	else if(low[n-1]==-k){
		val=-k;
		solve();
		cout<<s;
	}
	else cout<<"NO";
}


#include<bits/stdc++.h>
#define ll long long
#define ld long double
using namespace std;
const int N = 1000;
string s;
int n,k,sum,add[N+10],addSum;
void fail(){
	cout<<"NO";
	exit(0);
}
void solve(){
	string s1;
	s1.clear();
	for(int i=0; i<n; ++i)s1+=s[i];
	int change=0;
	for(int i=n-1; i>=0; --i){
		change+=add[i];
		if(s[i]=='?'){
			if(change<0){
				s1[i]='L';
				change++;
			}
			else if(change>0){
				s1[i]='W';
				change--;
			}
			else s1[i]='D';
		}
	}
	if(change==0){
		cout<<s1;
		exit(0);
	}
}
int main()
{
	ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	cin>>n>>k>>s;
	for(int i=0; i<n; ++i){
		if(s[i]=='W')sum++;
		if(s[i]=='L')sum--;
		if(i<n-1 && sum>=k){
			add[i]=k-1-sum-addSum;
			addSum+=add[i];
		}
		if(i<n-1 && sum<=-k){
			add[i]=1-k-sum-addSum;
			addSum+=add[i];
		}
	}
	add[n-1]=k-sum-addSum;
	solve();
	add[n-1]=-k-sum-addSum;
	solve();
	cout<<"NO";
}


#include <bits/stdc++.h>

#define ll long long
#define pb push_back
#define pii pair<int,int>
#define pll pair<ll,ll>
#define ff first
#define ss second

using namespace std;

const double pi=acos(-1);
const int N=1e6+6,mod=1000000007,M=2e9;
const ll MAX=5e18;

int n,k,dp[1002][1002];
string s;

int slv(int i=0,int c=0){
    if(i==n)
        return abs(c)==k;
    if(abs(c)>=k)
        return 0;
    int& ret=dp[i][c];
    if(~ret)
        return ret;
    if(s[i]=='W')
        return ret=slv(i+1,c+1);
    if(s[i]=='L')
        return ret=slv(i+1,c-1);
    if(s[i]=='D')
        return ret=slv(i+1,c);
    return ret=slv(i+1,c+1)||slv(i+1,c-1)||slv(i+1,c);
}

void trace(int i=0,int c=0){
    if(s[i]=='W'||(s[i]=='?'&&slv(i+1,c+1))){
        printf("W");
        trace(i+1,c+1);
        return ;
    }
    if(s[i]=='L'||(s[i]=='?'&&slv(i+1,c-1))){
        printf("L");
        trace(i+1,c-1);
        return ;
    }
    if(s[i]=='D'||(s[i]=='?'&&slv(i+1,c))){
        printf("D");
        trace(i+1,c);
        return ;
    }
}

int main()
{
    memset(dp,-1,sizeof dp);
    cin>>n>>k>>s;
    bool res=slv();
    if(!res)
        return puts("NO");
    puts("YES");
    trace();
    return 0;
}


#include <bits/stdc++.h>

#define ll long long
#define pb push_back
#define pii pair<int,int>
#define pll pair<ll,ll>
#define ff first
#define ss second

using namespace std;

const double pi=acos(-1);
const int N=1e6+6,mod=1000000007,M=2e9;
const ll MAX=5e18;

int n,k,dp[1002][1002];
string s;

int slv(int i=0,int c=0){
    if(i==n)
        return abs(c)==k;
    if(abs(c)>=k)
        return 0;
    int& ret=dp[i][c];
    if(~ret)
        return ret;
    if(s[i]=='W')
        return ret=slv(i+1,c+1);
    if(s[i]=='L')
        return ret=slv(i+1,c-1);
    if(s[i]=='D')
        return ret=slv(i+1,c);
    return ret=slv(i+1,c+1)||slv(i+1,c-1)||slv(i+1,c);
}

void trace(int i=0,int c=0){
    if(s[i]=='W'||(s[i]=='?'&&slv(i+1,c+1))){
        printf("W");
        trace(i+1,c+1);
        return ;
    }
    if(s[i]=='L'||(s[i]=='?'&&slv(i+1,c-1))){
        printf("L");
        trace(i+1,c-1);
        return ;
    }
    if(s[i]=='D'||(s[i]=='?'&&slv(i+1,c))){
        printf("D");
        trace(i+1,c);
        return ;
    }
}

int main()
{
    memset(dp,-1,sizeof dp);
    cin>>n>>k>>s;
    bool res=slv();
    if(!res)
        return puts("NO");
    trace();
    return 0;
}


#include<bits/stdc++.h>
#define FIO ios_base::sync_with_stdio(0);cin.tie(0);
using namespace std;
typedef long long ll;

int const N=1e3+5, M=2e3+5, OO=0x3f3f3f3f, MOD=1e8;

int n,k;
string s;

string mem[N][N];
string solve1(int i, int tot)
{
    if(i==n)
    {
        if(abs(tot)==k)
            return "";
        else
            return "!";
    }
    if(abs(tot)==k)
        return "!";
    if(mem[i][tot]!="")
        return mem[i][tot];
    string ret="";
    if(s[i]=='L')
        ret=ret+"L"+solve1(i+1,tot-1);
    else if(s[i]=='W')
        ret=ret+"W"+solve1(i+1,tot+1);
    else if(s[i]=='D')
        ret=ret+"D"+solve1(i+1,tot);
    else
    {
        string op1="",op2="",op3="";
        op1="W"+solve1(i+1,tot+1);
        op2="D"+solve1(i+1,tot);
        op3="L"+solve1(i+1,tot-1);
        if(op1[(int)op1.size()-1]!='!')
            ret=ret+op1;
        else if(op2[(int)op1.size()-1]!='!')
            ret=ret+op2;
        else if(op3[(int)op1.size()-1]!='!')
            ret=ret+op3;
        else
            ret=ret+"!";
    }
    return mem[i][tot]=ret;
}

int main()
{
    FIO
//    freopen("input.txt","rt",stdin);
//    freopen("output.txt","wt",stdout);
    cin>>n>>k>>s;
    string ans=solve1(0,0);
    if(ans[(int)ans.size()-1]!='!')
        cout<<ans<<"\n";
    else
        cout<<"NO\n";

}


#include<bits/stdc++.h>
#define FIO ios_base::sync_with_stdio(0);cin.tie(0);
using namespace std;
typedef long long ll;

int const N=1e3+5, M=2e3+5, OO=0x3f3f3f3f, MOD=1e8;

int n,k;
string s;

string mem[N][N];
string solve1(int i, int tot)
{
    if(i==n)
    {
        if(abs(tot)==k)
            return "";
        else
            return "!";
    }
    if(abs(tot)==k)
        return "!";
    if(mem[i][tot]!="")
        return mem[i][tot];
    string ret="";
    if(s[i]=='L')
        ret=ret+"L"+solve1(i+1,tot-1);
    else if(s[i]=='W')
        ret=ret+"W"+solve1(i+1,tot+1);
    else if(s[i]=='D')
        ret=ret+"D"+solve1(i+1,tot);
    else
    {
        string op1="",op2="",op3="";
        op1="W"+solve1(i+1,tot+1);
        op2="D"+solve1(i+1,tot);
        op3="L"+solve1(i+1,tot-1);
        if(op1[max((int)op1.size()-1,0)]!='!')
            ret=ret+op1;
        else if(op2[max((int)op2.size()-1,0)]!='!')
            ret=ret+op2;
        else if(op3[max((int)op3.size()-1,0)]!='!')
            ret=ret+op3;
        else
            ret=ret+"!";
    }
    return mem[i][tot]=ret;
}

int main()
{
    FIO
//    freopen("input.txt","rt",stdin);
//    freopen("output.txt","wt",stdout);
    cin>>n>>k>>s;
    string ans=solve1(0,0);
    if(ans[max((int)ans.size()-1,0)]!='!')
        cout<<ans<<"\n";
    else
        cout<<"NO\n";

}


#include<bits/stdc++.h>
#define FIO ios_base::sync_with_stdio(0);cin.tie(0);
using namespace std;
typedef long long ll;

int const N=1e3+5, M=2e3+5, OO=0x3f3f3f3f, MOD=1e8;

int n,k;
string s;

string mem[N][N];
string solve1(int i, int tot)
{
    if(i==n)
    {
        if(abs(tot)==k)
            return "";
        else
            return "!";
    }
    if(abs(tot)==k)
        return "!";
    if(mem[i][tot]!="")
        return mem[i][tot];
    string ret="";
    if(s[i]=='L')
        ret=ret+"L"+solve1(i+1,tot-1);
    else if(s[i]=='W')
        ret=ret+"W"+solve1(i+1,tot+1);
    else if(s[i]=='D')
        ret=ret+"D"+solve1(i+1,tot);
    else
    {
        string op1="",op2="",op3="";
        op1="W"+solve1(i+1,tot+1);
        op2="D"+solve1(i+1,tot);
        op3="L"+solve1(i+1,tot-1);
        if(op1[(int)op1.size()-1]!='!')
            ret=ret+op1;
        else if(op2[(int)op1.size()-1]!='!')
            ret=ret+op2;
        else if(op3[(int)op1.size()-1]!='!')
            ret=ret+op3;
        else
            ret=ret+"!";
    }
    return ret;
}

int main()
{
    FIO
//    freopen("input.txt","rt",stdin);
//    freopen("output.txt","wt",stdout);
    cin>>n>>k>>s;
    string ans=solve1(0,0);
    if(ans[(int)ans.size()-1]!='!')
        cout<<ans<<"\n";
    else
        cout<<"NO\n";

}


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

const int maxn = 1e3 + 10;
const int offset = 1e3;

int dp[maxn][3 * maxn];

int idx(const int &x)
{
    return x + offset;
}

int n, k;
int solve(const int &pos, const int &money)
{
    if (pos == n)
    {
        // cout << pos << " -> " << money << endl;
        return abs(money) == k;
    }
    else if (abs(money) == k)
        return 0;

    int &valid = dp[pos][idx(money)];
    if (valid != -1)
        return valid;

    valid = 0;
    if (s[pos] == '?')
    {
        valid |= solve(pos + 1, money + 1); //W
        valid |= solve(pos + 1, money);     //D
        valid |= solve(pos + 1, money - 1); //L
    }
    else if (s[pos] == 'W')
    {
        valid |= solve(pos + 1, money + 1);
    }
    else if (s[pos] == 'D')
    {
        valid |= solve(pos + 1, money);
    }
    else
    {
        valid |= solve(pos + 1, money - 1);
    }
    return valid;
}

string opSeq = "";

void recover(const int &pos, const int &money)
{
    if (pos == n)
        return ;
    else if (abs(money) == k)
        return ;
    int &valid = dp[pos][idx(money)];
    if(s[pos] == '?')
    {
        if(valid == solve(pos + 1, money + 1))
        {
            opSeq += 'W';
            recover(pos+1, money+1);
        }
        else if(valid == solve(pos + 1, money))
        {
            opSeq += 'D';
            recover(pos+1, money);
        }
        else
        {
            opSeq += 'L';
            recover(pos+1, money-1);
        }
    }
    else if(s[pos] == 'W')
    {
        opSeq += 'W';
        recover(pos+1, money+1);
    }
    else if(s[pos] == 'D')
    {
        opSeq += 'D';
        recover(pos+1, money);
    }
    else
    {
        opSeq += 'L';
        recover(pos+1, money-1);
    }
}

int main()
{
    ios::sync_with_stdio(false);
    memset(dp, -1, sizeof(dp));
    cin >> n >> k;
    cin >> s;
    if(solve(0, 0) == 0)
    {
        cout << "NO" << endl;
        return 0;
    }
    recover(0,0);
    cout << opSeq << endl;
    return 0;
}


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

const int maxn = 1e4 + 10;
const int offset = 1e4;

int dp[maxn][2 * maxn];

int idx(const int &x)
{
    return x + offset;
}

int n, k;
int solve(const int &pos, const int &money)
{
    if (pos == n)
    {
        // cout << pos << " -> " << money << endl;
        return abs(money) == k;
    }
    else if (abs(money) == k)
        return 0;

    int &valid = dp[pos][idx(money)];
    if (valid != -1)
        return valid;

    valid = 0;
    if (s[pos] == '?')
    {
        valid |= solve(pos + 1, money + 1); //W
        valid |= solve(pos + 1, money);     //D
        valid |= solve(pos + 1, money - 1); //L
    }
    else if (s[pos] == 'W')
    {
        valid |= solve(pos + 1, money + 1);
    }
    else if (s[pos] == 'D')
    {
        valid |= solve(pos + 1, money);
    }
    else
    {
        valid |= solve(pos + 1, money - 1);
    }
    return valid;
}

string opSeq = "";

void recover(const int &pos, const int &money)
{
    if (pos == n)
        return ;
    else if (abs(money) == k)
        return ;
    int &valid = dp[pos][idx(money)];
    if(s[pos] == '?')
    {
        if(valid == solve(pos + 1, money + 1))
        {
            opSeq += 'W';
            recover(pos+1, money+1);
        }
        else if(valid == solve(pos + 1, money))
        {
            opSeq += 'D';
            recover(pos+1, money);
        }
        else
        {
            opSeq += 'L';
            recover(pos+1, money-1);
        }
    }
    else if(s[pos] == 'W')
    {
        opSeq += 'W';
        recover(pos+1, money+1);
    }
    else if(s[pos] == 'D')
    {
        opSeq += 'D';
        recover(pos+1, money);
    }
    else
    {
        opSeq += 'L';
        recover(pos+1, money-1);
    }
}

int main()
{
    ios::sync_with_stdio(false);
    memset(dp, -1, sizeof(dp));
    cin >> n >> k;
    cin >> s;
    if(solve(0, 0) == 0)
    {
        cout << "NO" << endl;
        return 0;
    }
    recover(0,0);
    cout << opSeq << endl;
    return 0;
}


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

const int maxn = 1e4 + 100;
const int offset = 1e4;

int dp[maxn][3 * maxn];

int idx(const int &x)
{
    return x + offset;
}

int n, k;
int solve(const int &pos, const int &money)
{
    if (pos == n)
    {
        // cout << pos << " -> " << money << endl;
        return abs(money) == k;
    }
    else if (abs(money) == k)
        return 0;

    int &valid = dp[pos][idx(money)];
    if (valid != -1)
        return valid;

    valid = 0;
    if (s[pos] == '?')
    {
        valid |= solve(pos + 1, money + 1); //W
        valid |= solve(pos + 1, money);     //D
        valid |= solve(pos + 1, money - 1); //L
    }
    else if (s[pos] == 'W')
    {
        valid |= solve(pos + 1, money + 1);
    }
    else if (s[pos] == 'D')
    {
        valid |= solve(pos + 1, money);
    }
    else
    {
        valid |= solve(pos + 1, money - 1);
    }
    return valid;
}

string opSeq = "";

void recover(const int &pos, const int &money)
{
    if (pos == n)
        return ;
    else if (abs(money) == k)
        return ;
    int &valid = dp[pos][idx(money)];
    if(s[pos] == '?')
    {
        if(valid == solve(pos + 1, money + 1))
        {
            opSeq += 'W';
            recover(pos+1, money+1);
        }
        else if(valid == solve(pos + 1, money))
        {
            opSeq += 'D';
            recover(pos+1, money);
        }
        else
        {
            opSeq += 'L';
            recover(pos+1, money-1);
        }
    }
    else if(s[pos] == 'W')
    {
        opSeq += 'W';
        recover(pos+1, money+1);
    }
    else if(s[pos] == 'D')
    {
        opSeq += 'D';
        recover(pos+1, money);
    }
    else
    {
        opSeq += 'L';
        recover(pos+1, money-1);
    }
}

int main()
{
    ios::sync_with_stdio(false);
    memset(dp, -1, sizeof(dp));
    cin >> n >> k;
    cin >> s;
    if(solve(0, 0) == 0)
    {
        cout << "NO" << endl;
        return 0;
    }
    recover(0,0);
    cout << opSeq << endl;
    return 0;
}


#include <iostream>
#include <algorithm>
#include <vector>
#include <deque>
using namespace std;
int main() {
    int n, k, x = 0;
    string s;
    cin >> n >> k >> s;
    deque<int> q;
    for (int i = 0; i < n; ++i) {
        if (s[i] == '?') q.push_back(i);
        else if (s[i] == 'W') ++x;
        else if (s[i] == 'L') --x;
        if (x == k && i < n - 1) {
            if (q.empty()) return cout << "NO", 0;
            s[q.back()] = 'L', --x;
            q.pop_back();
        }
        if (x == -k && i < n - 1) {
            if (q.empty()) return cout << "NO", 0;
            s[q.back()] = 'W', ++x;
            q.pop_back();
        }
    }
    bool bb = s.back() == '?';
    if (bb) s.back() = 'W', ++x, q.pop_back();
    if (k - x <= q.size() && s.back() == 'W') {
        for (int i = 0; i < k - x; ++i) s[q[q.size() - 1 - i]] = 'W';
        for (int i : q) if (s[i] == '?') s[i] = 'D'; else break;
        int y = 0;
        bool fail = false;
        for (char c : s) {
            if (abs(y) == k) fail = true;
            if (c == 'W') ++y;
            else if (c == 'L') --y;
        }
        if (!fail && y == k) return cout << s, 0;
        for (int i = 0; i < k - x; ++i) s[q[q.size() - 1 - i]] = '?';
        for (int i : q) if (s[i] == 'D') s[i] = '?'; else break;
    }
    if (bb) s.back() = 'L', x -= 2;
    if (k + x <= q.size() && s.back() == 'L') {
        for (int i = 0; i < k + x; ++i) s[q[q.size() - 1 - i]] = 'L';
        for (int i : q) if (s[i] == '?') s[i] = 'D'; else break;
        int y = 0;
        bool fail = false;
        for (char c : s) {
            if (abs(y) == k) fail = true;
            if (c == 'W') ++y;
            else if (c == 'L') --y;
        }
        if (!fail && y == -k) return cout << s, 0;
    }
    cout << "NO";
}


#include <iostream>
#include <algorithm>
#include <vector>
#include <deque>
using namespace std;
int main() {
    int n, k, x = 0;
    string s;
    cin >> n >> k >> s;
    deque<int> q;
    for (int i = 0; i < n; ++i) {
        if (s[i] == '?') q.push_back(i);
        else if (s[i] == 'W') ++x;
        else if (s[i] == 'L') --x;
        if (x == k && i < n - 1) {
            if (q.empty()) return cout << "NO", 0;
            s[q.back()] = 'L', --x;
            q.pop_back();
        }
        if (x == -k && i < n - 1) {
            if (q.empty()) return cout << "NO", 0;
            s[q.back()] = 'W', ++x;
            q.pop_back();
        }
    }
    bool bb = s.back() == '?';
    if (bb) s.back() = 'W', ++x, q.pop_back();
    if (abs(k - x) <= q.size() && (q.size() - abs(k - x)) % 2 == 0 && s.back() == 'W') {
        for (int i = 0; i < abs(k - x); ++i) s[q[q.size() - 1 - i]] = (x < k ? 'W' : 'L');
        for (int i : q) if (s[i] == '?') s[i] = 'D'; else break;
        int y = 0;
        bool fail = false;
        for (char c : s) {
            if (abs(y) == k) fail = true;
            if (c == 'W') ++y;
            else if (c == 'L') --y;
        }
        if (!fail && y == k) return cout << s, 0;
        for (int i = 0; i < k - x; ++i) s[q[q.size() - 1 - i]] = '?';
        for (int i : q) if (s[i] == 'D') s[i] = '?'; else break;
    }
    if (bb) s.back() = 'L', x -= 2;
    if (abs(-k - x) <= q.size() && (q.size() - abs(-k - x)) % 2 == 0 && (s.back() == '?' || s.back() == 'L')) {
        for (int i = 0; i < abs(-k - x); ++i) s[q[q.size() - 1 - i]] = (x < k ? 'W' : 'L');
        for (int i : q) if (s[i] == '?') s[i] = 'D'; else break;
        int y = 0;
        bool fail = false;
        for (char c : s) {
            if (abs(y) == k) fail = true;
            if (c == 'W') ++y;
            else if (c == 'L') --y;
        }
        if (!fail && y == -k) return cout << s, 0;
    }
    cout << "NO";
}


#include <iostream>
#include <algorithm>
#include <vector>
#include <deque>
using namespace std;
int main() {
    int n, k, x = 0;
    string s;
    cin >> n >> k >> s;
    deque<int> q;
    for (int i = 0; i < n; ++i) {
        if (s[i] == '?') q.push_back(i);
        else if (s[i] == 'W') ++x;
        else if (s[i] == 'L') --x;
        if (x == k && i < n - 1) {
            if (q.empty()) return cout << "NO", 0;
            s[q.back()] = 'L', --x;
            q.pop_back();
        }
        if (x == -k && i < n - 1) {
            if (q.empty()) return cout << "NO", 0;
            s[q.back()] = 'W', ++x;
            q.pop_back();
        }
    }
    bool bb = s.back() == '?';
    if (bb) s.back() = 'W', ++x, q.pop_back();
    if (abs(k - x) <= q.size() && s.back() == 'W') {
        for (int i = 0; i < abs(k - x); ++i) s[q[q.size() - 1 - i]] = (x < k ? 'W' : 'L');
        for (int i : q) if (s[i] == '?') s[i] = 'D'; else break;
        int y = 0;
        bool fail = false;
        for (char c : s) {
            if (abs(y) == k) fail = true;
            if (c == 'W') ++y;
            else if (c == 'L') --y;
        }
        if (!fail && y == k) return cout << s, 0;
        for (int i = 0; i < k - x; ++i) s[q[q.size() - 1 - i]] = '?';
        for (int i : q) if (s[i] == 'D') s[i] = '?'; else break;
    }
    if (bb) s.back() = 'L', x -= 2;
    if (abs(-k - x) <= q.size() && (s.back() == '?' || s.back() == 'L')) {
        for (int i = 0; i < abs(-k - x); ++i) s[q[q.size() - 1 - i]] = (x < k ? 'W' : 'L');
        for (int i : q) if (s[i] == '?') s[i] = 'D'; else break;
        int y = 0;
        bool fail = false;
        for (char c : s) {
            if (abs(y) == k) fail = true;
            if (c == 'W') ++y;
            else if (c == 'L') --y;
        }
        if (!fail && y == -k) return cout << s, 0;
    }
    cout << "NO";
}


#include <cstdlib>
#include <cstdio>
#include <climits>
#include <utility>
#include <algorithm>

#define assert(check) if (!(check)) { printf("CHECK FAILED %s\n", #check); abort(); }

struct el {
    bool unk;
    int start;
    int min = 0, max = 0;
    int end;
};
struct rest {
    int max, min;
};

char buf[1007];
char ans[1007];
el els[1007];
rest res[1007][2];

int main() {
    int n, k;
    scanf("%i %i %s", &n, &k, buf);
    int i = 0;
    int eln = 0;
    while (i < n) {
        bool iniunk = els[eln].unk = (buf[i] == '?');
        int j = i;
        els[eln].start = i;
        while (j < n) {
            if ((buf[j] == '?') != iniunk)
                break;
            if (buf[j] == '?' || buf[j] == 'W')
                els[eln].end++;
            if (buf[j] == 'L')
                els[eln].end--;
            if (j != n) {
                if (els[eln].min > els[eln].end)
                    els[eln].min = els[eln].end;
                if (els[eln].max < els[eln].end)
                    els[eln].max = els[eln].end;
            }
            j++;
        }
        i = j;
        if (iniunk) {
            els[eln].min = 0; //-els[eln].end;
            els[eln].max = 0; //els[eln].end;
        }
        eln++;
    }
    els[eln].start = i;
    /*
    for (int i = 0; i < eln; i++) {
        if (els[i].unk)
            printf("UNK %i\n", els[i].end);
        else
            printf("VAL %i min=%i max=%i\n", els[i].end, els[i].min, els[i].max);
    }
    */
    res[eln][0] = {-k, -k};
    res[eln][1] = {k, k};
    bool rinv[2] = {false, false};
    for (i = eln - 1; i >= 0; --i) {
        res[i][0] = res[i + 1][0];
        res[i][1] = res[i + 1][1];
        if (els[i].unk) {
            for (auto &re : res[i]) {
                re.min = re.min - els[i].end;
                re.max = re.max + els[i].end;
            }
        } else {
            for (auto &re : res[i]) {
                re.min = re.min - els[i].end;
                re.max = re.max - els[i].end;
            }
        }
        int sub = i != eln - 1 ? 1 : 0;
        for (auto &re : res[i]) {
            if (re.min < -k + sub - els[i].min)
                re.min = -k + sub - els[i].min;
            if (re.max > k - sub - els[i].max)
                re.max = k - sub - els[i].max;
        }

        for (auto &re : res[i]) {
            if (re.min <= -k)
                re.min = -k + 1;
            if (re.max >= k)
                re.max = k - 1;
        }

        if (res[i][0].max < res[i][0].min)
            rinv[0] = true;
        if (res[i][1].max < res[i][1].min)
            rinv[1] = true;
    }
    for (i = 0; i < eln; i++) {
        for (auto &re : res[i]) {
            //if (re.max < re.min)
            //    continue;
            printf("%i min=%i max=%i\n", i, re.min, re.max);
        }
    }
    for (int j = 0; j < 2; j++) {
        if (res[0][j].min > 0 || res[0][j].max < 0 || rinv[j])
            continue;
        int cn = 0;
        for (i = 0; i < eln; i++) {
            assert(cn >= res[i][j].min && cn <= res[i][j].max);
            if (!els[i].unk) {
                cn += els[i].end;
                assert(cn > -k && cn < k);
                for (int k = els[i].start; k < els[i + 1].start; k++)
                    putchar(buf[k]);
                continue;
            }
            int r = els[i].end;
            int rw = std::max(res[i + 1][j].min - cn, 0);
            int rl = std::max(cn - res[i + 1][j].max, 0);
            assert(rw + rl <= r);
            cn += rw - rl;
            for (int k = 0; k < r - rw - rl; k++)
                putchar('D');
            while (rw--)
                putchar('W');
            while (rl--)
                putchar('L');
        }
        return 0;
    }
    printf("NO\n");
    return 0;
}


#include <cstdlib>
#include <cstdio>
#include <climits>
#include <utility>
#include <algorithm>

#define assert(check) if (!(check)) { printf("CHECK FAILED %s\n", #check); abort(); }

struct el {
    bool unk;
    int start;
    int min = 0, max = 0;
    int end;
};
struct rest {
    int max, min;
};

char buf[1007];
el els[1007];
rest res[1007][2];
bool rinv[1007];

void maybe_invalidate(int i) {
    if (res[i][0].max < res[i][0].min)
        rinv[0] = true;
    if (res[i][1].max < res[i][1].min)
        rinv[1] = true;
}

int main() {
    int n, k;
    scanf("%i %i %s", &n, &k, buf);
    int i = 0;
    int eln = 0;
    while (i < n) {
        bool iniunk = els[eln].unk = (buf[i] == '?');
        int j = i;
        els[eln].start = i;
        while (j < n) {
            if ((buf[j] == '?') != iniunk)
                break;
            if (buf[j] == '?' || buf[j] == 'W')
                els[eln].end++;
            if (buf[j] == 'L')
                els[eln].end--;
            if (j != n) {
                if (els[eln].min > els[eln].end)
                    els[eln].min = els[eln].end;
                if (els[eln].max < els[eln].end)
                    els[eln].max = els[eln].end;
            }
            j++;
        }
        i = j;
        if (iniunk) {
            els[eln].min = 0; //-els[eln].end;
            els[eln].max = 0; //els[eln].end;
        }
        eln++;
    }
    els[eln].start = i;
    /*
    for (int i = 0; i < eln; i++) {
        if (els[i].unk)
            printf("UNK %i\n", els[i].end);
        else
            printf("VAL %i min=%i max=%i\n", els[i].end, els[i].min, els[i].max);
    }
    */
    res[eln][0] = {-k, -k};
    res[eln][1] = {k, k};
    for (i = eln - 1; i >= 0; --i) {
        res[i][0] = res[i + 1][0];
        res[i][1] = res[i + 1][1];
        if (els[i].unk) {
            for (auto &re : res[i]) {
                re.min = re.min - els[i].end;
                re.max = re.max + els[i].end;
            }
        } else {
            for (auto &re : res[i]) {
                re.min = re.min - els[i].end;
                re.max = re.max - els[i].end;
            }
        }
        maybe_invalidate(i);

        int sub = i != eln - 1 ? 1 : 0;
        for (auto &re : res[i]) {
            if (re.min < -k + sub - els[i].min)
                re.min = -k + sub - els[i].min;
            if (re.max > k - sub - els[i].max)
                re.max = k - sub - els[i].max;
        }
        maybe_invalidate(i);

        for (auto &re : res[i]) {
            if (re.min <= -k)
                re.min = -k + 1;
            if (re.max >= k)
                re.max = k - 1;
        }
        maybe_invalidate(i);
    }
    /*for (i = 0; i < eln; i++) {
        for (auto &re : res[i]) {
            //if (re.max < re.min)
            //    continue;
            printf("%i min=%i max=%i\n", i, re.min, re.max);
        }
    }*/
    for (int j = 0; j < 2; j++) {
        if (res[0][j].min > 0 || res[0][j].max < 0 || rinv[j])
            continue;
        int cn = 0;
        for (i = 0; i < eln; i++) {
            assert(cn >= res[i][j].min && cn <= res[i][j].max);
            if (!els[i].unk) {
                cn += els[i].end;
                assert(i != eln - 1 ? (cn > -k && cn < k) : (cn == -k || cn == k));
                for (int k = els[i].start; k < els[i + 1].start; k++)
                    putchar(buf[k]);
                continue;
            }
            int r = els[i].end;
            int rw = std::max(res[i + 1][j].min - cn, 0);
            int rl = std::max(cn - res[i + 1][j].max, 0);
            assert(rw + rl <= r);
            cn += rw - rl;
            for (int k = 0; k < r - rw - rl; k++)
                putchar('D');
            while (rw--)
                putchar('W');
            while (rl--)
                putchar('L');
        }
        return 0;
    }
    printf("NO\n");
    return 0;
}


#include <cstdlib>
#include <cstdio>
#include <climits>
#include <utility>
#include <algorithm>

#define assert(check) if (!(check)) { printf("CHECK FAILED %s\n", #check); abort(); }

struct el {
    bool unk;
    int start;
    int min = 0, max = 0;
    int end;
};
struct rest {
    int max, min;
};

char buf[1007];
char ans[1007];
el els[1007];
rest res[1007][2];

int main() {
    int n, k;
    scanf("%i %i %s", &n, &k, buf);
    int i = 0;
    int eln = 0;
    while (i < n) {
        bool iniunk = els[eln].unk = (buf[i] == '?');
        int j = i;
        els[eln].start = i;
        while (j < n) {
            if ((buf[j] == '?') != iniunk)
                break;
            if (buf[j] == '?' || buf[j] == 'W')
                els[eln].end++;
            if (buf[j] == 'L')
                els[eln].end--;
            if (j != n) {
                if (els[eln].min > els[eln].end)
                    els[eln].min = els[eln].end;
                if (els[eln].max < els[eln].end)
                    els[eln].max = els[eln].end;
            }
            j++;
        }
        i = j;
        if (iniunk) {
            els[eln].min = 0; //-els[eln].end;
            els[eln].max = 0; //els[eln].end;
        }
        eln++;
    }
    els[eln].start = i;
    /*
    for (int i = 0; i < eln; i++) {
        if (els[i].unk)
            printf("UNK %i\n", els[i].end);
        else
            printf("VAL %i min=%i max=%i\n", els[i].end, els[i].min, els[i].max);
    }
    */
    res[eln][0] = {-k, -k};
    res[eln][1] = {k, k};
    bool rinv[2] = {false, false};
    for (i = eln - 1; i >= 0; --i) {
        res[i][0] = res[i + 1][0];
        res[i][1] = res[i + 1][1];
        if (els[i].unk) {
            for (auto &re : res[i]) {
                re.min = re.min - els[i].end;
                re.max = re.max + els[i].end;
            }
        } else {
            for (auto &re : res[i]) {
                re.min = re.min - els[i].end;
                re.max = re.max - els[i].end;
            }
        }
        if (res[i][0].max < res[i][0].min)
            rinv[0] = true;
        if (res[i][1].max < res[i][1].min)
            rinv[1] = true;

        int sub = i != eln - 1 ? 1 : 0;
        for (auto &re : res[i]) {
            if (re.min < -k + sub - els[i].min)
                re.min = -k + sub - els[i].min;
            if (re.max > k - sub - els[i].max)
                re.max = k - sub - els[i].max;
        }

        for (auto &re : res[i]) {
            if (re.min <= -k)
                re.min = -k + 1;
            if (re.max >= k)
                re.max = k - 1;
        }
    }/*
    for (i = 0; i < eln; i++) {
        for (auto &re : res[i]) {
            //if (re.max < re.min)
            //    continue;
            printf("%i min=%i max=%i\n", i, re.min, re.max);
        }
    }*/
    for (int j = 0; j < 2; j++) {
        if (res[0][j].min > 0 || res[0][j].max < 0 || rinv[j])
            continue;
        int cn = 0;
        for (i = 0; i < eln; i++) {
            assert(cn >= res[i][j].min && cn <= res[i][j].max);
            if (!els[i].unk) {
                cn += els[i].end;
                assert(cn > -k && cn < k);
                for (int k = els[i].start; k < els[i + 1].start; k++)
                    putchar(buf[k]);
                continue;
            }
            int r = els[i].end;
            int rw = std::max(res[i + 1][j].min - cn, 0);
            int rl = std::max(cn - res[i + 1][j].max, 0);
            assert(rw + rl <= r);
            cn += rw - rl;
            for (int k = 0; k < r - rw - rl; k++)
                putchar('D');
            while (rw--)
                putchar('W');
            while (rl--)
                putchar('L');
        }
        return 0;
    }
    printf("NO\n");
    return 0;
}


#include <cstdlib>
#include <cstdio>
#include <climits>
#include <utility>
#include <algorithm>

#define assert(check) if (!(check)) { printf("CHECK FAILED %s\n", #check); abort(); }

struct el {
    bool unk;
    int start;
    int min = 0, max = 0;
    int end;
};
struct rest {
    int max, min;
};

char buf[1007];
char ans[1007];
el els[1007];
rest res[1007][2];

int main() {
    int n, k;
    scanf("%i %i %s", &n, &k, buf);
    int i = 0;
    int eln = 0;
    while (i < n) {
        bool iniunk = els[eln].unk = (buf[i] == '?');
        int j = i;
        els[eln].start = i;
        while (j < n) {
            if ((buf[j] == '?') != iniunk)
                break;
            if (buf[j] == '?' || buf[j] == 'W')
                els[eln].end++;
            if (buf[j] == 'L')
                els[eln].end--;
            if (j != n) {
                if (els[eln].min > els[eln].end)
                    els[eln].min = els[eln].end;
                if (els[eln].max < els[eln].end)
                    els[eln].max = els[eln].end;
            }
            j++;
        }
        i = j;
        if (iniunk) {
            els[eln].min = 0; //-els[eln].end;
            els[eln].max = 0; //els[eln].end;
        }
        eln++;
    }
    els[eln].start = i;
    /*
    for (int i = 0; i < eln; i++) {
        if (els[i].unk)
            printf("UNK %i\n", els[i].end);
        else
            printf("VAL %i min=%i max=%i\n", els[i].end, els[i].min, els[i].max);
    }
    */
    res[eln][0] = {-k, -k};
    res[eln][1] = {k, k};
    bool rinv[2] = {false, false};
    for (i = eln - 1; i >= 0; --i) {
        res[i][0] = res[i + 1][0];
        res[i][1] = res[i + 1][1];
        if (els[i].unk) {
            for (auto &re : res[i]) {
                re.min = re.min - els[i].end;
                re.max = re.max + els[i].end;
            }
        } else {
            for (auto &re : res[i]) {
                re.min = re.min - els[i].end;
                re.max = re.max - els[i].end;
            }
        }
        int sub = i != eln - 1 ? 1 : 0;
        for (auto &re : res[i]) {
            if (re.min < -k + sub - els[i].min)
                re.min = -k + sub - els[i].min;
            if (re.max > k - sub - els[i].max)
                re.max = k - sub - els[i].max;
        }

        for (auto &re : res[i]) {
            if (re.min <= -k)
                re.min = -k + 1;
            if (re.max >= k)
                re.max = k - 1;
        }

        if (res[i][0].max < res[i][0].min)
            rinv[0] = true;
        if (res[i][1].max < res[i][1].min)
            rinv[1] = true;
    }
    /*for (i = 0; i < eln; i++) {
        for (auto &re : res[i]) {
            //if (re.max < re.min)
            //    continue;
            printf("%i min=%i max=%i\n", i, re.min, re.max);
        }
    }*/
    for (int j = 0; j < 2; j++) {
        if (res[0][j].min > 0 || res[0][j].max < 0 || rinv[j])
            continue;
        int cn = 0;
        for (i = 0; i < eln; i++) {
            assert(cn >= res[i][j].min && cn <= res[i][j].max);
            if (!els[i].unk) {
                cn += els[i].end;
                assert(cn > -k && cn < k);
                for (int k = els[i].start; k < els[i + 1].start; k++)
                    putchar(buf[k]);
                continue;
            }
            int r = els[i].end;
            int rw = std::max(res[i + 1][j].min - cn, 0);
            int rl = std::max(cn - res[i + 1][j].max, 0);
            assert(rw + rl <= r);
            cn += rw - rl;
            for (int k = 0; k < r - rw - rl; k++)
                putchar('D');
            while (rw--)
                putchar('W');
            while (rl--)
                putchar('L');
        }
        return 0;
    }
    printf("NO\n");
    return 0;
}


///Bismillahir Rahmanir Rahim
#include "bits/stdc++.h"

#define                           ll                          long long
#define                           int                         ll
#define                           fi                          first
#define                           si                          second
#define                           mp                          make_pair
#define                           pb                          push_back
#define                           pi                          pair<ll,ll>
#define                           node(a,b,c)                 mp(mp(a,b),c)
#define                           clr(x)                      memset(x,0,sizeof(x));
#define                           f(i,l,r)                    for(int i=l;i<=r;i++)
#define                           rf(i,r,l)                   for(int i=r;i>=l;i--)
#define                           done(i)                     cout<<"done = "<<i<<endl;
#define                           show(x,y)                   cout<<x<<" : ";for(auto z:y)cout<<z<<" ";cout<<endl;
#define                           fast                        ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);

using namespace std;

const ll inf=1e18;
const int mod=1e9+7;
const int M=2005;
const int offset=1002;
int dp[M][2*M+100];
int n,k;
string s;
int solve(int pos,int sum)
{
    if(pos>n)
    {
        int chk=sum-offset;
        if(chk==k || chk==-k)return 1;
        else return 0;
    }
    int val=sum-offset;
    if(val<=-k || val>=k)return 0;
    int &ret=dp[pos][sum];
    if(ret!=-1)return ret;
    ret=0;
    if(s[pos]=='W' || s[pos]=='?')
    {
        ret=ret|solve(pos+1,sum+1);
    }
    if(s[pos]=='L' || s[pos]=='?')
    {
        ret=ret|solve(pos+1,sum-1);
    }
    if(s[pos]=='D' || s[pos]=='?')
    {
        ret=ret|solve(pos+1,sum);
    }
    return ret;
}
 main()

{
    fast
    memset(dp,-1,sizeof dp);
    cin>>n>>k;
    cin>>s;
    s="#"+s;
    if(solve(1,0+offset)==0)
    {
        cout<<"NO"<<endl;
        return 0;
    }
    int sum=0;
    for(int i=1;i<=n;i++)
    {
        if(s[i]=='?')
        {
            if(solve(i+1,sum+offset))
            {
                s[i]='D';
            }
            else if(solve(i+1,sum+1+offset))
            {
                s[i]='W';
                sum++;
            }
            else if(solve(i+1,sum-1+offset))
            {
                s[i]='L';
                sum--;
            }
            else
            {
                assert(false);
            }
        }
        else if(s[i]=='W')
        {
            sum++;
        }
        else if(s[i]=='L')
        {
            sum--;
        }
    }
    f(i,1,n)
    {
        cout<<s[i];
    }
    cout<<"\n";
    return 0;

}


///Bismillahir Rahmanir Rahim
#include "bits/stdc++.h"

#define                           ll                          long long
#define                           int                         ll
#define                           fi                          first
#define                           si                          second
#define                           mp                          make_pair
#define                           pb                          push_back
#define                           pi                          pair<ll,ll>
#define                           node(a,b,c)                 mp(mp(a,b),c)
#define                           clr(x)                      memset(x,0,sizeof(x));
#define                           f(i,l,r)                    for(int i=l;i<=r;i++)
#define                           rf(i,r,l)                   for(int i=r;i>=l;i--)
#define                           done(i)                     cout<<"done = "<<i<<endl;
#define                           show(x,y)                   cout<<x<<" : ";for(auto z:y)cout<<z<<" ";cout<<endl;
#define                           fast                        ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);

using namespace std;

const ll inf=1e18;
const int mod=1e9+7;
const int M=1005;
const int offset=1002;
int dp[M][2*M+100];
int n,k;
string s;
int solve(int pos,int sum)
{
    if(pos>n)
    {
        int chk=sum-offset;
        if(chk==k || chk==-k)return 1;
        else return 0;
    }
    int val=sum-offset;
    if(val<=-k || val>=k)return 0;
    int &ret=dp[pos][sum];
    if(ret!=-1)return ret;
    ret=0;
    if(s[pos]=='W' || s[pos]=='?')
    {
        ret=ret|solve(pos+1,sum+1);
    }
    if(s[pos]=='L' || s[pos]=='?')
    {
        ret=ret|solve(pos+1,sum-1);
    }
    if(s[pos]=='D' || s[pos]=='?')
    {
        ret=ret|solve(pos+1,sum);
    }
    return ret;
}
 main()

{
    fast
    memset(dp,-1,sizeof dp);
    cin>>n>>k;
    cin>>s;
    s="#"+s;
    if(solve(1,0+offset)==0)
    {
        cout<<"NO"<<endl;
        return 0;
    }
    int sum=0;
    for(int i=1;i<=n;i++)
    {
        if(s[i]=='?')
        {
            if(solve(i+1,sum+offset))
            {
                s[i]='D';
            }
            else if(solve(i+1,sum+1+offset))
            {
                s[i]='W';
                sum++;
            }
            else if(solve(i+1,sum-1+offset))
            {
                s[i]='L';
                sum++;
            }
        }
        else if(s[i]=='W')
        {
            sum++;
        }
        else if(s[i]=='L')
        {
            sum--;
        }
    }
    f(i,1,n)
    {
        cout<<s[i];
    }
    cout<<"\n";
    return 0;

}


#include <stdio.h>
#include <string.h>

const int MAXN = 1005;
const int OFFSET = 1005;

int n, k;

char s[MAXN];
int dp[MAXN][2 * MAXN];

int solve(int pos, int score) {
    if (pos < n && (score <= OFFSET - k || score >= OFFSET + k)) return false;
    if (dp[pos][score] != -1) return dp[pos][score];
    if (pos >= n) return score == OFFSET - k || score == OFFSET + k;

    int& ans = dp[pos][score];
    ans = 0;
    if (s[pos] == 'W' || s[pos] == '?') ans |= solve(pos + 1, score + 1);
    if (s[pos] == 'L' || s[pos] == '?') ans |= solve(pos + 1, score - 1);
    if (s[pos] == '?') ans |= solve(pos + 1, score);

    return ans;
}

int main(void) {
    scanf(" %d %d", &n, &k);
    scanf(" %s", s);

    memset(dp, -1, sizeof(dp));

    if (solve(0, OFFSET)) {
        int score = OFFSET;
        for (int i = 0; i < n; i++) {
            if (s[i] == 'W') score++;
            else if (s[i] == 'L') score--;
            else if (s[i] == '?') {
                if (solve(i + 1, score + 1)) {
                    s[i] = 'W';
                    score++;
                } else if (solve(i + 1, score - 1)) {
                    s[i] = 'L';
                    score--;
                } else if (solve(i + 1, score)) {
                    s[i] = 'D';
                }
            }
        }
        for (int i = 0; i < n; i++) printf("%c", s[i]);
        printf("\n");

    } else {
        printf("NO\n");
    }
    return 0;
}


#include <stdio.h>
#include <string.h>

const int MAXN = 1005;
const int OFFSET = 1005;

int n, k;

char s[MAXN];
int dp[MAXN][2 * MAXN];

int solve(int pos, int score) {
    if (pos < n && (score <= OFFSET - k || score >= OFFSET + k)) return false;
    if (dp[pos][score] != -1) return dp[pos][score];
    if (pos >= n) return score == OFFSET - k || score == OFFSET + k;

    int& ans = dp[pos][score];
    ans = 0;
    if (s[pos] == 'W' || s[pos] == '?') ans |= solve(pos + 1, score + 1);
    if (s[pos] == 'L' || s[pos] == '?') ans |= solve(pos + 1, score - 1);
    if (s[pos] == 'D' || s[pos] == '?') ans |= solve(pos + 1, score);

    return ans;
}

int main(void) {
    scanf(" %d %d", &n, &k);
    scanf(" %s", s);

    memset(dp, -1, sizeof(dp));

    if (solve(0, OFFSET)) {
        int score = OFFSET;
        for (int i = 0; i < n; i++) {
            if (s[i] == 'W') score++;
            else if (s[i] == 'L') score--;
            else if (s[i] == '?') {
                if (solve(i + 1, score + 1)) {
                    s[i] = 'W';
                    score++;
                } else if (solve(i + 1, score - 1)) {
                    s[i] = 'L';
                    score--;
                } else if (solve(i + 1, score)) {
                    s[i] = 'D';
                }
            }
        }
        for (int i = 0; i < n; i++) printf("%c", s[i]);
        printf("\n");

    } else {
        printf("NO\n");
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define task "803E"
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
typedef vector<int> VI;
typedef long long ll;
typedef pair<int,int> PII;
typedef double db;
mt19937 mrand(random_device{}());
const ll mod = 1000000007;
int rnd(int x) { return mrand() % x;}
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
// Head:
// Source:
const int maxn = 2e3 + 7;
int n, k;
char a[maxn], b[maxn];
bool f[maxn][maxn];
int main(){
	ios_base::sync_with_stdio(0); cin.tie(0);
#ifndef ONLINE_JUDGE
    freopen(task".inp","r",stdin);
    freopen(task".out","w",stdout);
#endif
    cin>>n>>k;
    rep(i, 1, n + 1) cin>>a[i];
    f[0][k + 1] = 1;
    rep(i, 1, n + 1){
        rep(j, 1, 2 * k + 2) {
            if (j == 1 || j == 2 * k + 1)
                if (i != n) continue;
            if (a[i] == 'D') f[i][j] = f[i - 1][j];
            if (a[i] == 'W') f[i][j] = f[i - 1][j - 1];
            if (a[i] == 'L') f[i][j] = f[i - 1][j + 1];
            if (a[i] == '?'){
                f[i][j] = f[i - 1][j] | f[i - 1][j - 1];
                f[i][j] = f[i][j] | f[i - 1][j + 1];
            }
        }
    }
    if (f[n][2 * k + 1] || f[n][1]){
        int cc = 2 * k + 1; if (f[n][1]) cc = 1;
        per(i, 1, n + 1){
            if (a[i] == 'D') b[i] = 'D';
            if (a[i] == 'W') cc = cc - 1, b[i] = 'W';//f[i][j] = f[i - 1][j - 1];
            if (a[i] == 'L') cc = cc + 1, b[i] = 'L';//f[i][j] = f[i - 1][j + 1];
            if (a[i] == '?'){
                int cx = -2;
                rep(l, -1, 2) if (f[i - 1][cc + l]) cx = l;
                if (cx == -1){
                    cc = cc - 1; b[i] = 'W';
                }
                if (cx == 0) b[i] = 'D';
                if (cx == 1) b[i] = 'L', cc = cc + 1;
            }
        }
        rep(i, 1, n + 1) cout<<b[i];
    }
    else cout<<"NO";
}


#include <bits/stdc++.h>
using namespace std;
#define task "803E"
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
typedef vector<int> VI;
typedef long long ll;
typedef pair<int,int> PII;
typedef double db;
mt19937 mrand(random_device{}());
const ll mod = 1000000007;
int rnd(int x) { return mrand() % x;}
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
// Head:
// Source:
const int maxn = 1e3 + 7;
int n, k;
char a[maxn], b[maxn];
bool f[maxn][maxn];
int main(){
	ios_base::sync_with_stdio(0); cin.tie(0);
#ifndef ONLINE_JUDGE
    freopen(task".inp","r",stdin);
    freopen(task".out","w",stdout);
#endif
    cin>>n>>k;
    rep(i, 1, n + 1) cin>>a[i];
    f[0][k + 1] = 1;
    rep(i, 1, n + 1){
        rep(j, 1, 2 * k + 2) {
            if (j == 1 || j == 2 * k + 1)
                if (i != n) continue;
            if (a[i] == 'D') f[i][j] = f[i - 1][j];
            if (a[i] == 'W') f[i][j] = f[i - 1][j - 1];
            if (a[i] == 'L') f[i][j] = f[i - 1][j + 1];
            if (a[i] == '?'){
                f[i][j] = f[i - 1][j] | f[i - 1][j - 1];
                f[i][j] = f[i][j] | f[i - 1][j + 1];
            }
        }
    }
    if (f[n][2 * k + 1] || f[n][1]){
        int cc = 2 * k + 1; if (f[n][1]) cc = 1;
        per(i, 1, n + 1){
            if (a[i] == 'D') b[i] = 'D';
            if (a[i] == 'W') cc = cc - 1, b[i] = 'W';//f[i][j] = f[i - 1][j - 1];
            if (a[i] == 'L') cc = cc + 1, b[i] = 'L';//f[i][j] = f[i - 1][j + 1];
            if (a[i] == '?'){
                int cx = -2;
                rep(l, -1, 2) if (f[i - 1][cc + l]) cx = l;
                if (cx == -1){
                    cc = cc - 1; b[i] = 'W';
                }
                if (cx == 0) b[i] = 'D';
                if (cx == 1) b[i] = 'L', cc = cc + 1;
            }
        }
        rep(i, 1, n + 1) cout<<b[i];
    }
    else cout<<"NO";
}


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

typedef long long ll;

template<typename T>
void out(T x) { cout << x << endl; exit(0); }
#define watch(x) cout << (#x) << " is " << (x) << endl

const int maxn = 1010;
const int OFFSET = 1000;
int n, k;
string s;

int dp[maxn][2*maxn];

string walk(int i, int val) {
  string res;
  while (i>0) {
    int x = dp[i][val];
    if (x == val) {
      res += 'D';
    } else if (x == val-1) {
      res += 'W';
    } else if (x == val+1) {
      res += 'L';
    } else {
      assert(0);
    }
    val = x;
    i--;
  }

  reverse(res.begin(), res.end());
  return res;
}

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

  cin>>n>>k>>s;

  memset(dp, -1, sizeof dp);

  dp[0][OFFSET] = OFFSET;

  for (int i=0; i<n; i++) {
    for (int j=OFFSET-k+1; j<=OFFSET+k-1; j++) {
      if (dp[i][j] == -1) continue;
      if (s[i] == 'D') {
	dp[i+1][j] = j;
      } else if (s[i] == 'L') {
	dp[i+1][j-1] = j;
      } else if (s[i] == 'W') {
	dp[i+1][j+1] = j;
      } else if (s[i] == '?') {

	dp[i+1][j] = j;
	dp[i+1][j+1] = j;
	dp[i+1][j-1] = j;

      } else {
	assert(0);
      }
    }
  }

  // for (int i=0; i<=n; i++) {
  //   for (int j=OFFSET-3; j<=OFFSET+3; j++) {
  //     cout<<dp[i][j]<<" ";
  //   }
  //   cout<<endl;
  // }

  string s;

  if (dp[n][k+OFFSET]!=-1) {
    s = walk(n,k+OFFSET);
  } else if (dp[n][OFFSET-k]!=-1) {
    s = walk(n,OFFSET-k);
  } else {
    out("NO");
  }

  cout<<s<<endl;

  return 0;
}


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

typedef long long ll;

template<typename T>
void out(T x) { cout << x << endl; exit(0); }
#define watch(x) cout << (#x) << " is " << (x) << endl

const int maxn = 1010;
const int OFFSET = 1000;
int n, k;
string s;

int dp[maxn][maxn];

string walk(int i, int val) {
  string res;
  while (i>0) {
    int x = dp[i][val];
    if (x == val) {
      res += 'D';
    } else if (x == val-1) {
      res += 'W';
    } else if (x == val+1) {
      res += 'L';
    } else {
      assert(0);
    }
    val = x;
    i--;
  }

  reverse(res.begin(), res.end());
  return res;
}

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

  cin>>n>>k>>s;

  memset(dp, -1, sizeof dp);

  dp[0][OFFSET] = OFFSET;

  for (int i=0; i<n; i++) {
    for (int j=OFFSET-k+1; j<=OFFSET+k-1; j++) {
      if (dp[i][j] == -1) continue;
      if (s[i] == 'D') {
	dp[i+1][j] = j;
      } else if (s[i] == 'L') {
	dp[i+1][j-1] = j;
      } else if (s[i] == 'W') {
	dp[i+1][j+1] = j;
      } else if (s[i] == '?') {

	dp[i+1][j] = j;
	dp[i+1][j+1] = j;
	dp[i+1][j-1] = j;

      } else {
	assert(0);
      }
    }
  }

  // for (int i=0; i<=n; i++) {
  //   for (int j=OFFSET-3; j<=OFFSET+3; j++) {
  //     cout<<dp[i][j]<<" ";
  //   }
  //   cout<<endl;
  // }

  string s;

  if (dp[n][k+OFFSET]!=-1) {
    s = walk(n,k+OFFSET);
  } else if (dp[n][OFFSET-k]!=-1) {
    s = walk(n,OFFSET-k);
  } else {
    out("NO");
  }

  cout<<s<<endl;

  int dx = 0;
  for (int i=0; i<n; i++) {
    char c = s[i];
    if (c=='W') dx++;
    if (c=='L') dx--;
    if (i<n-1) assert(dx>-k && dx<k);
  }
  assert(abs(dx) == k);

  return 0;
}


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

typedef long long ll;

template<typename T>
void out(T x) { cout << x << endl; exit(0); }
#define watch(x) cout << (#x) << " is " << (x) << endl

const int maxn = 1010;
const int OFFSET = 1000;
int n, k;
string s;

int dp[maxn][maxn];

string walk(int i, int val) {
  string res;
  while (i>0) {
    int x = dp[i][val];
    if (x == val) {
      res += 'D';
    } else if (x == val-1) {
      res += 'W';
    } else if (x == val+1) {
      res += 'L';
    } else {
      assert(0);
    }
    val = x;
    i--;
  }

  reverse(res.begin(), res.end());
  return res;
}

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

  cin>>n>>k>>s;

  memset(dp, -1, sizeof dp);

  dp[0][OFFSET] = OFFSET;

  for (int i=0; i<n; i++) {
    for (int j=OFFSET-k+1; j<=OFFSET+k-1; j++) {
      if (dp[i][j] == -1) continue;
      if (s[i] == 'D') {
	dp[i+1][j] = j;
      } else if (s[i] == 'L') {
	dp[i+1][j-1] = j;
      } else if (s[i] == 'W') {
	dp[i+1][j+1] = j;
      } else if (s[i] == '?') {

	dp[i+1][j] = j;
	dp[i+1][j+1] = j;
	dp[i+1][j-1] = j;

      } else {
	assert(0);
      }
    }
  }

  // for (int i=0; i<=n; i++) {
  //   for (int j=OFFSET-3; j<=OFFSET+3; j++) {
  //     cout<<dp[i][j]<<" ";
  //   }
  //   cout<<endl;
  // }

  string s;

  if (dp[n][k+OFFSET]!=-1) {
    s = walk(n,k+OFFSET);
  } else if (dp[n][OFFSET-k]!=-1) {
    s = walk(n,OFFSET-k);
  } else {
    out("NO");
  }

  cout<<s<<endl;

  return 0;
}


#include<bits/stdc++.h>
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define MOD	1000000007
//#define int	long long
#define pii pair<int,int>
#define vi vector<int>
using namespace std;

string s;
int n, k;
int dp[1005][3005];

// 0 - Lose by k
// k - Balanced
// 2*k - Win by k

int32_t main(){
	cin >> n >> k;
	memset(dp,0,sizeof dp);

	cin >> s;

	dp[0][k] = 1;

	for(int i = 1; i <= n; i++){
		if(s[i-1] == 'W'){
			for(int j = 1; j < 2*k; j++){
				if(dp[i-1][j]){
					dp[i][j+1] = 1;
				}
			}
		}
		else if(s[i-1] == 'L'){
			for(int j = 1; j < 2*k; j++){
				if(dp[i-1][j]){
					dp[i][j-1] = 1;
				}
			}
		}
		else if(s[i-1] == 'D'){
			for(int j = 1; j < 2*k; j++){
				if(dp[i-1][j]){
					dp[i][j] = 1;
				}
			}
		}
		else{
			for(int j = 1; j < 2*k; j++){
				if(dp[i-1][j]){
					if(j+1 <= 2*k){
						dp[i][j+1] = 1;
					}
				}
				if(dp[i-1][j]){
					if(j-1 >= 0){
						dp[i][j-1] = 1;
					}
				}
				if(dp[i-1][j]){
					dp[i][j] = 1;
				}
			}
		}
	}
	//cout << dp[n][0] << " " << dp[n][2*k] << endl;
	if(!dp[n][0] && !dp[n][2*k]){
		cout << "NO";
		return 0;
	}
	else{
		string res = "";
		if(dp[n][0]){		// Lose
			int temp = 0;
			for(int i = n; i > 0; i--){
				if(s[i-1] == 'W'){
					res += 'W';
					temp--;
				}
				else if(s[i-1] == 'L'){
					res += 'L';
					temp++;
				}
				else if(s[i-1] == 'D'){
					res += 'D';
				}
				else{
					if(dp[i-1][temp] && i != n)
						res += 'D';
					else if(dp[i-1][temp-1]){
						res += 'W';
						temp--;
					}
					else if(dp[i-1][temp+1]){
						res += 'L';
						temp++;
					}
				}
			}
			reverse(res.begin(),res.end());
			cout << res << endl;
			return 0;
		}
		else{
			int temp = 2*k;
			for(int i = n; i > 0; i--){
				if(s[i-1] == 'W'){
					res += 'W';
					temp--;
				}
				else if(s[i-1] == 'L'){
					res += 'L';
					temp++;
				}
				else{
					if(dp[i-1][temp] && i != n)
						res += 'D';
					else if(dp[i-1][temp-1]){
						res += 'W';
						temp--;
					}
					else if(dp[i-1][temp+1]){
						res += 'L';
						temp++;
					}
				}
			}
			reverse(res.begin(),res.end());
			cout << res << endl;
		}
	}

	return 0;
}


#include<bits/stdc++.h>
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define MOD	1000000007
//#define int	long long
#define pii pair<int,int>
#define vi vector<int>
using namespace std;

string s;
int n, k;
int dp[1005][3005];

// 0 - Lose by k
// k - Balanced
// 2*k - Win by k

int ans[1005][3005];		// 1-Win, 2-Lose, 3-Draw

int32_t main(){
	cin >> n >> k;
	memset(dp,0,sizeof dp);

	cin >> s;

	dp[0][k] = 1;

	for(int i = 1; i <= n; i++){
		if(s[i-1] == 'W'){
			for(int j = 1; j < 2*k; j++){
				if(dp[i-1][j]){
					dp[i][j+1] = 1;
					ans[i][j+1] = 1;
				}
			}
		}
		else if(s[i-1] == 'L'){
			for(int j = 1; j < 2*k; j++){
				if(dp[i-1][j]){
					dp[i][j-1] = 1;
					ans[i][j-1] = 2;
				}
			}
		}
		else if(s[i-1] == 'D'){
			for(int j = 1; j < 2*k; j++){
				if(dp[i-1][j]){
					dp[i][j] = 1;
					ans[i][j] = 3;
				}
			}
		}
		else{
			for(int j = 1; j < 2*k; j++){
				if(dp[i-1][j]){
					if(j+1 <= 2*k){
						dp[i][j+1] = 1;
						ans[i][j+1] = 1;
					}
				}
				if(dp[i-1][j]){
					if(j-1 >= 0){
						dp[i][j-1] = 1;
						ans[i][j-1] = 2;

					}
				}
				if(dp[i-1][j]){
					dp[i][j] = 1;
					ans[i][j] = 3;
				}
			}
		}
	}
	//cout << dp[n][0] << " " << dp[n][2*k] << endl;
	if(!dp[n][0] && !dp[n][2*k]){
		cout << "NO";
		return 0;
	}
	else{
		map<int,char> m;
		m[1] = 'W';
		m[2] = 'L';
		m[3] = 'D';

		string res = "";
		if(dp[n][0]){		// Lose
			int temp = 0;
			for(int i = n; i > 0; i--){
				if(s[i-1] == 'W'){
					res += 'W';
					temp--;
				}
				else if(s[i-1] == 'L'){
					res += 'L';
					temp++;
				}
				else if(s[i-1] == 'D'){
					res += 'D';
				}
				else{
					int w = ans[i][temp];
					if(w == 1)
						temp--;
					else if(w == 2)
						temp++;
					res += m[w];
				}
			}
			reverse(res.begin(),res.end());
			cout << res << endl;
			return 0;
		}
		else{
			int temp = 2*k;
			for(int i = n; i > 0; i--){
				if(s[i-1] == 'W'){
					res += 'W';
					temp--;
				}
				else if(s[i-1] == 'L'){
					res += 'L';
					temp++;
				}
				else{
					int w = ans[i][temp];
					if(w == 1)				// Win
						temp--;
					else if(w == 2)			// Lose
						temp++;
					res += m[w];
				}
			}
			reverse(res.begin(),res.end());
			cout << res << endl;
		}
	}

	return 0;
}


#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#include<bits/stdc++.h>
#define int long long
#define pb push_back
#define loop(t, f, u) for (long long t = long long(f); t < long long(u); t++)
#define ppl pair <long long, pair<long long, long long> >
#define all(v) v.begin(), v.end()
#define Unique(x)  x.erase(unique(all(x)), x.end())
#define pii pair<int, char>
#define pll pair<long long, long long>
#define s second
#define f first
#define inout
#define popb pop_back
using namespace std;

void solve() {
    int n, k;
    string s;
    cin >> n >> k;
    cin >> s;
    vector<vector<int> > dp(n + 100, vector<int> (2 * k + 100, -1));
    dp[0][k] = 1;
    for (int i = 0; i < n; i++) {
        for (int j = 1; j < 2 * k ; j++) {
            if (dp[i][j] == -1) continue;
            if (s[i] == 'L') {
                dp[i + 1][j - 1] = j;
            }
            if (s[i] == 'W') {
                dp[i + 1][j + 1] = j;
            }
            if (s[i] == 'D') {
                dp[i + 1][j] = j;
            }
            if (s[i] == '?') {
                dp[i + 1][j] = j;
                dp[i + 1][j - 1] = j;
                dp[i + 1][j + 1] = j;
            }
        }
    }
    if (dp[n][2 * k] == -1 && dp[n][0] == -1) {
        cout << "NO" << endl;
        return;
    }
    int ind;
    if (dp[n][0]) ind = 0;
    else ind = 2 * k;
    for (int i = n; i >= 1; i--) {
        if (dp[i][ind] == ind - 1) s[i - 1] = 'W';
        else if (dp[i][ind] == ind + 1) s[i - 1] = 'L';
        else s[i - 1] = 'D';
        ind = dp[i][ind];
    }
    cout << s << endl;
}

signed main() {
    int t = 1;
   // cin >> t;
    while(t--) {
        solve();
    }
}


#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#include<bits/stdc++.h>
#define int long long
#define pb push_back
#define loop(t, f, u) for (long long t = long long(f); t < long long(u); t++)
#define ppl pair <long long, pair<long long, long long> >
#define all(v) v.begin(), v.end()
#define Unique(x)  x.erase(unique(all(x)), x.end())
#define pii pair<int, char>
#define pll pair<long long, long long>
#define s second
#define f first
#define inout
#define popb pop_back
using namespace std;

void solve() {
    int n, k;
    string s;
    cin >> n >> k;
    cin >> s;
    vector<vector<int> > dp(n + 100, vector<int> (2 * k + 100, -1));
    dp[0][k] = 1;
    for (int i = 0; i < n; i++) {
        for (int j = 1; j < 2 * k ; j++) {
            if (dp[i][j] == -1) continue;
            if (s[i] == 'L') {
                dp[i + 1][j - 1] = j;
            }
            if (s[i] == 'W') {
                dp[i + 1][j + 1] = j;
            }
            if (s[i] == 'D') {
                dp[i + 1][j] = j;
            }
            if (s[i] == '?') {
                dp[i + 1][j] = j;
                dp[i + 1][j - 1] = j;
                dp[i + 1][j + 1] = j;
            }
        }
    }
    if (dp[n][2 * k] == -1 && dp[n][0] == -1) {
        cout << "NO" << endl;
        return;
    }
    int ind;
    if (dp[n][0] != -1) ind = 0;
    else ind = 2 * k;
    for (int i = n; i >= 1; i--) {
        if (dp[i][ind] == ind - 1) s[i - 1] = 'W';
        else if (dp[i][ind] == ind + 1) s[i - 1] = 'L';
        else s[i - 1] = 'D';
        ind = dp[i][ind];
    }
    cout << s << endl;
}

signed main() {
    int t = 1;
   // cin >> t;
    while(t--) {
        solve();
    }
}


// Sakhiya07 - Yagnik Sakhiya

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

#define ll long long int
#define ld long double
#define ff first
#define ss second
#define pb push_back
#define all(x) x.begin(),x.end()

#define mp make_pair
#define bp __builtin_popcountll
#define MOD  1000000007
const int N = 1005;
#define FAST ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);srand(time(NULL));
ll dp[N][2*N],n,k;
string s;
ll temp = 0;
ll solve1(ll id,ll dif)
{
     if(id==n)    return dp[id][dif+N] = abs(dif)==k;
     if(abs(dif)==k)   return dp[id][dif+N] = 0;
     ll ans = dp[id][dif+N];
     if(ans!=-1)   return ans;
     if(temp==1)  cout<<"h";
     if(s[id]=='W')   ans = solve1(id+1,dif+1);
     else if(s[id]=='L')  ans = solve1(id+1,dif-1);
     else if(s[id]=='D')  ans = solve1(id+1,dif);
     else   ans = solve1(id+1,dif) | solve1(id+1,dif-1) | solve1(id+1,dif+1);
     return dp[id][dif+N] = ans;
}
void path(ll id,ll dif)
{
     if(id==n)   return;
     if(s[id]=='W')
     {
          cout<<'W';
          return path(id+1,dif+1);
     }
     else if(s[id]=='L')
     {
          cout<<'L';
          return path(id+1,dif-1);
     }
     else if(s[id]=='D')
     {
          cout<<'D';
          return path(id+1,dif);
     }
     else
     {
          if(dp[id+1][dif+1+N])
          {
               cout<<'W';
               return path(id+1,dif+1);
          }
          else if(dp[id+1][dif+N])
          {
               cout<<'D';
               return path(id+1,dif);
          }
          else
          {
               cout<<'L';
               return path(id+1,dif-1);
          }
     }
}
void solve()
{
     cin >> n >> k;
     cin >> s;
     memset(dp,-1,sizeof(dp));
     ll ans = solve1(0,0);
     if(ans)
     {
          temp=1;
          path(0,0);
     }
     else
     {
          cout<<"NO";
     }
}

int main()
{
     ll t = 1;
   //  cin >> t;
     while(t--)
     {
          solve();
     }
}


// Sakhiya07 - Yagnik Sakhiya

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

#define ll long long int
#define ld long double
#define ff first
#define ss second
#define pb push_back
#define all(x) x.begin(),x.end()

#define mp make_pair
#define bp __builtin_popcountll
#define MOD  1000000007
const int N = 1005;
#define FAST ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);srand(time(NULL));
ll dp[N][2*N],n,k;
string s;
ll solve1(ll id,ll dif)
{
     if(id==n)    return abs(dif)==k;
     if(abs(dif)==k)   return 0;
     ll &ans = dp[id][dif+N];
     if(ans!=-1)   return ans;
     if(s[id]=='W')   ans = solve1(id+1,dif+1);
     else if(s[id]=='L')  ans = solve1(id+1,dif-1);
     else if(s[id]=='D')  ans = solve1(id+1,dif);
     else   ans = solve1(id+1,dif) | solve1(id+1,dif-1) | solve1(id+1,dif+1);
     return ans;
}
void path(ll id,ll dif)
{
     if(id==n)   return;
     if(s[id]=='W')
     {
          cout<<'W';
          return path(id+1,dif+1);
     }
     else if(s[id]=='L')
     {
          cout<<'L';
          return path(id+1,dif-1);
     }
     else if(s[id]=='D')
     {
          cout<<'D';
          return path(id+1,dif);
     }
     else
     {
          if(dp[id+1][dif+1+N]==1)
          {
               cout<<'W';
               return path(id+1,dif+1);
          }
          else if(dp[id+1][dif+N]==1)
          {
               cout<<'D';
               return path(id+1,dif);
          }
          else
          {
               cout<<'L';
               return path(id+1,dif-1);
          }
     }
}
void solve()
{
     cin >> n >> k;
     cin >> s;
     memset(dp,-1,sizeof(dp));
     ll ans = solve1(0,0);
     if(ans)
     {
          path(0,0);
     }
     else
     {
          cout<<"NO";
     }
}

int main()
{
     ll t = 1;
   //  cin >> t;
     while(t--)
     {
          solve();
     }
}


// Sakhiya07 - Yagnik Sakhiya

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

#define ll long long int
#define ld long double
#define ff first
#define ss second
#define pb push_back
#define all(x) x.begin(),x.end()

#define mp make_pair
#define bp __builtin_popcountll
#define MOD  1000000007
const int N = 1005;
#define FAST ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);srand(time(NULL));
ll dp[N][2*N],n,k;
string s;
ll solve1(ll id,ll dif)
{
     if(id==n)    return abs(dif)==k;
     if(abs(dif)==k)   return 0;
     ll &ans = dp[id][dif+N];
     if(ans!=-1)   return ans;
     if(s[id]=='W')   ans = solve1(id+1,dif+1);
     else if(s[id]=='L')  ans = solve1(id+1,dif-1);
     else if(s[id]=='D')  ans = solve1(id+1,dif);
     else   ans = solve1(id+1,dif) | solve1(id+1,dif-1) | solve1(id+1,dif+1);
     return ans;
}
void path(ll id,ll dif)
{
     if(id==n)   return;
     if(s[id]=='W')
     {
          cout<<'W';
          return path(id+1,dif+1);
     }
     else if(s[id]=='L')
     {
          cout<<'L';
          return path(id+1,dif-1);
     }
     else if(s[id]=='D')
     {
          cout<<'D';
          return path(id+1,dif);
     }
     else
     {
          if(solve1(id+1,dif+1))
          {
               cout<<'W';
               return path(id+1,dif+1);
          }
          else if(solve1(id+1,dif))
          {
               cout<<'D';
               return path(id+1,dif);
          }
          else
          {
               cout<<'L';
               return path(id+1,dif-1);
          }
     }
}
void solve()
{
     cin >> n >> k;
     cin >> s;
     memset(dp,-1,sizeof(dp));
     ll ans = solve1(0,0);
     if(ans)
     {
          path(0,0);
     }
     else
     {
          cout<<"NO";
     }
}

int main()
{
     ll t = 1;
   //  cin >> t;
     while(t--)
     {
          solve();
     }
}


// Sakhiya07 - Yagnik Sakhiya

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

#define ll long long int
#define ld long double
#define ff first
#define ss second
#define pb push_back
#define all(x) x.begin(),x.end()

#define mp make_pair
#define bp __builtin_popcountll
#define MOD  1000000007
const int N = 1005;
#define FAST ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);srand(time(NULL));
ll dp[N][2*N],n,k;
string s;
ll solve1(ll id,ll dif)
{
     if(id==n)    return abs(dif)==k;
     if(abs(dif)==k)   return 0;
     ll &ans = dp[id][dif+N];
     if(ans!=-1)   return ans;
     if(s[id]=='W')   ans = solve1(id+1,dif+1);
     else if(s[id]=='L')  ans = solve1(id+1,dif-1);
     else if(s[id]=='D')  ans = solve1(id+1,dif);
     else   ans = solve1(id+1,dif) | solve1(id+1,dif-1) | solve1(id+1,dif+1);
     return ans;
}
void path(ll id,ll dif)
{
     if(id==n)   return;
     if(s[id]=='W')
     {
          cout<<'W';
          return path(id+1,dif+1);
     }
     else if(s[id]=='L')
     {
          cout<<'L';
          return path(id+1,dif-1);
     }
     else if(s[id]=='D')
     {
          cout<<'D';
          return path(id+1,dif);
     }
     else
     {
          if(dp[id+1][dif+1+N])
          {
               cout<<'W';
               return path(id+1,dif+1);
          }
          else if(dp[id+1][dif+N])
          {
               cout<<'D';
               return path(id+1,dif);
          }
          else
          {
               cout<<'L';
               return path(id+1,dif-1);
          }
     }
}
void solve()
{
     cin >> n >> k;
     cin >> s;
     memset(dp,-1,sizeof(dp));
     ll ans = solve1(0,0);
     if(ans)
     {
          path(0,0);
     }
     else
     {
          cout<<"NO";
     }
}

int main()
{
     ll t = 1;
   //  cin >> t;
     while(t--)
     {
          solve();
     }
}


#include<bits/stdc++.h>
using namespace std;
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/hash_policy.hpp>
using namespace __gnu_pbds;
#define _for(i,a,b) for(int i=(a);i<(b);++i)
#define ms(a) memset(a,0,sizeof(a))
#define ms_inf(a) memset(a,0x3f,sizeof(a))
#define ms_ninf(a) memset(a,0xcf,sizeof(a))
#define pb push_back
#define mp make_pair
#define fast ios::sync_with_stdio(0),cin.tie(0),cout.tie(0)
//#define lc (o<<1)
//#define rc (o<<1|1)
//#include<ext/pb_ds/priority_queue.hpp>
//typedef __gnu_pbds::priority_queue<no> heap;  //��ƫ��
typedef long long ll;
typedef unsigned long long ull;
ull MOD=212370440130137957ll;
int mod=1e9+7;
ll INF=1e18;
const int maxn=1e3+10;
const int maxl=1e2+10;
const double PI=acos(-1.0);
const double eps=1e-8;
mt19937_64 rng((ull)(new char));
map<int,bool>d[maxn];int n,k;char s[maxn];map<int,char>pa[maxn];
int f[maxn];
inline bool ch(char c)
{
	return c!='?';
}
inline bool ok(int now,int d)
{
	if(now<n)return abs(d)<k;
	return 1;
}
inline char ff(int e)
{
	switch(e)
	{
		case -1:return 'L';
		case 0:return 'D';
		return 'W';
	}
}
int main()
{
	fast;cin>>n>>k>>s+1;f['W']=1,f['L']=-1;
	d[0][0]=1;
	_for(i,0,n)
	{
		auto&q=d[i+1];auto&pq=pa[i+1];
		for(auto&w:d[i])
		{
			const int&e=w.first;int nx;
			if(ch(s[i+1]))
			{
				nx=e+f[s[i+1]];
				if(!ok(i+1,nx))continue;
				q[nx]=1;pq[nx]=s[i+1];
			}
			else
			{
				_for(j,-1,2)
				{
					nx=e+j;
					if(!ok(i+1,nx))continue;
					q[nx]=1;pq[nx]=ff(j);
				}
			}
		}
	}
	if(!d[n].count(k)&&!d[n].count(-k))return cout<<"NO",0;
	string ans;int c;if(d[n].count(k))c=k;else c=-k;
	for(int i=n;i;--i)
	{
		ans+=pa[i][c];
		c-=f[ans.back()];
	}
	reverse(ans.begin(),ans.end());cout<<ans;
}


#include<bits/stdc++.h>
using namespace std;
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/hash_policy.hpp>
using namespace __gnu_pbds;
#define _for(i,a,b) for(int i=(a);i<(b);++i)
#define ms(a) memset(a,0,sizeof(a))
#define ms_inf(a) memset(a,0x3f,sizeof(a))
#define ms_ninf(a) memset(a,0xcf,sizeof(a))
#define pb push_back
#define mp make_pair
#define fast ios::sync_with_stdio(0),cin.tie(0),cout.tie(0)
//#define lc (o<<1)
//#define rc (o<<1|1)
//#include<ext/pb_ds/priority_queue.hpp>
//typedef __gnu_pbds::priority_queue<no> heap;  //��ƫ��
typedef long long ll;
typedef unsigned long long ull;
ull MOD=212370440130137957ll;
int mod=1e9+7;
ll INF=1e18;
const int maxn=1e3+10;
const int maxl=1e2+10;
const double PI=acos(-1.0);
const double eps=1e-8;
mt19937_64 rng((ull)(new char));
map<int,bool>d[maxn];int n,k;char s[maxn];map<int,char>pa[maxn];
int f[maxn];
inline bool ch(char c)
{
	return c!='?';
}
inline bool ok(int now,int d)
{
	if(now<n)return abs(d)<k;
	return 1;
}
inline char ff(int e)
{
	switch(e)
	{
		case -1:return 'L';break;
		case 0:return 'D';break;
		case 1:return 'W';
	}
}
inline bool in(int x)
{
	return abs(x)<k;
}
inline void o(int i,int w)
{
	cout<<i<<" "<<w<<" "<<pa[i][w]<<"\n";
}
int main()
{
	fast;cin>>n>>k>>s+1;f['W']=1,f['L']=-1;
	d[0][0]=1;
	_for(i,0,n)
	{
		auto&q=d[i+1];auto&pq=pa[i+1];
		for(auto&w:d[i])
		{
			const int&e=w.first;int nx;
//			cout<<i<<" "<<e<<"\n";
			if(ch(s[i+1]))
			{
				nx=e+f[s[i+1]];
				if(!ok(i+1,nx))continue;
				q[nx]=1;pq[nx]=s[i+1];
//				o(i+1,nx);
			}
			else
			{
				_for(j,-1,2)
				{
					nx=e+j;
					if(!ok(i+1,nx))continue;
					q[nx]=1;pq[nx]=ff(j);
//					o(i+1,nx);
				}
			}
		}
	}
	if(!d[n].count(k)&&!d[n].count(-k))return cout<<"NO",0;
	string ans;int c;if(d[n].count(k))c=k;else c=-k;
	for(int i=n;i;--i)
	{
//		assert(d[i].count(c));//assert(pa[])
//		if(i<n)assert(in(c));
		ans+=pa[i][c];
		c-=f[ans.back()];
	}
	reverse(ans.begin(),ans.end());cout<<ans;
}


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

typedef  int ll;
typedef long double ld;
typedef pair<int,int> pi;
typedef pair<ll,ll> pll;

#define endl '\n'
#define ff first
#define ss second
#define pb push_back
#define f(i,l,r) for(ll i=l;i<=r;i++)
#define rf(i,r,l) for(ll i=r;i>=l;i--)
#define Max 5000001
#define inf 2147483647
#define llinf 9223372036854775807
#define all(v) v.begin(),v.end()
#define bp(n) __builtin_popcountll(n)
#define fast ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL)

#define d0(a) cout<<a<<' ';
#define d1(a) cout<<a<<endl;
#define d2(a,b) cout<<a<<' '<<b<<endl;
#define d3(a,b,c) cout<<a<<' '<<b<<' '<<c<<endl;
#define d4(a,b,c,d) cout<<a<<' '<<b<<' '<<c<<' '<<d<<endl;
#define d5(a,b,c,d,e) cout<<a<<' '<<b<<' '<<c<<' '<<d<<' '<<e<<endl;
#define d6(a,b,c,d,e,f) cout<<a<<' '<<b<<' '<<c<<' '<<d<<' '<<e<<' '<<f<<endl;

const ll N=1e3+5,mod=1e9+7,bit=61;
const ll M=2e3+5;

ll dp[N][M],n,k;
string s,moves="";

ll solve(ll x,ll points)
{
    if(x==n+1)
    {
        return abs(points-1000)==k;
    }
    if(abs(points-1000)==k)
    {
        return 0;
    }
    ll &ans=dp[x][points];
    if(ans!=-1)
    {
        return ans;
    }
    ans=0;
    if(s[x]=='?')
    {
        ans|=solve(x+1,points-1);
        ans|=solve(x+1,points);
        ans|=solve(x+1,points+1);
    }
    else
    {
        ll curr=points;
        if(s[x]=='W')
        {
            curr++;
        }
        if(s[x]=='L')
        {
            curr--;
        }
        ans=solve(x+1,curr);
    }
    return ans;
}

void path(ll x,ll points)
{
    if(x==n+1)
    {
        return;
    }
    if(s[x]=='?')
    {
        if(solve(x+1,points-1))
        {
            moves+='L';
            path(x+1,points-1);
        }
        else if(solve(x+1,points))
        {
            moves+='D';
            path(x+1,points);
        }
        else
        {
            moves+='W';
            path(x+1,points+1);
        }
    }
    else
    {
        moves+=s[x];
        ll curr=points;
        if(s[x]=='W')
        {
            curr++;
        }
        if(s[x]=='L')
        {
            curr--;
        }
        path(x+1,curr);
    }
}

signed main()
{
    fast;

    ll t=1;
    //cin>>t;
    while(t--)
    {
        cin>>n>>k;
        cin>>s;
        s='#'+s;
        memset(dp,-1,sizeof(dp));
        if(solve(1,1000))
        {
            path(1,1000);
            cout<<moves<<endl;
        }
        else
        {
            cout<<"NO\n";
        }
    }
    return 0;
}


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

typedef long long int ll;
typedef long double ld;
typedef pair<int,int> pi;
typedef pair<ll,ll> pll;

#define endl '\n'
#define ff first
#define ss second
#define int long long
#define pb push_back
#define f(i,l,r) for(ll i=l;i<=r;i++)
#define rf(i,r,l) for(ll i=r;i>=l;i--)
#define Max 5000001
#define inf 2147483647
#define llinf 9223372036854775807
#define all(v) v.begin(),v.end()
#define bp(n) __builtin_popcountll(n)
#define fast ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL)

#define d0(a) cout<<a<<' ';
#define d1(a) cout<<a<<endl;
#define d2(a,b) cout<<a<<' '<<b<<endl;
#define d3(a,b,c) cout<<a<<' '<<b<<' '<<c<<endl;
#define d4(a,b,c,d) cout<<a<<' '<<b<<' '<<c<<' '<<d<<endl;
#define d5(a,b,c,d,e) cout<<a<<' '<<b<<' '<<c<<' '<<d<<' '<<e<<endl;
#define d6(a,b,c,d,e,f) cout<<a<<' '<<b<<' '<<c<<' '<<d<<' '<<e<<' '<<f<<endl;

const ll N=1e3+5,mod=1e9+7,bit=61;
const ll M=2e3+5;

ll dp[N][M],n,k;
string s,moves="";

ll solve(ll x,ll points)
{
    if(x==n+1)
    {
        return abs(points-1000)==k;
    }
    if(abs(points-1000)==k)
    {
        return 0;
    }
    ll &ans=dp[x][points];
    if(ans!=-1)
    {
        return ans;
    }
    ans=0;
    if(s[x]=='?')
    {
        ans|=solve(x+1,points-1);
        ans|=solve(x+1,points);
        ans|=solve(x+1,points+1);
    }
    else
    {
        ll curr=points;
        if(s[x]=='W')
        {
            curr++;
        }
        if(s[x]=='L')
        {
            curr--;
        }
        ans=solve(x+1,curr);
    }
    return ans;
}

void path(ll x,ll points)
{
    if(x==n+1)
    {
        return;
    }
    if(s[x]=='?')
    {
        if(solve(x+1,points-1))
        {
            moves+='L';
            path(x+1,points-1);
        }
        else if(solve(x+1,points))
        {
            moves+='D';
            path(x+1,points);
        }
        else
        {
            moves+='W';
            path(x+1,points+1);
        }
    }
    else
    {
        moves+=s[x];
        ll curr=points;
        if(s[x]=='W')
        {
            curr++;
        }
        if(s[x]=='L')
        {
            curr--;
        }
        path(x+1,curr);
    }
}

signed main()
{
    fast;

    ll t=1;
    //cin>>t;
    while(t--)
    {
        cin>>n>>k;
        cin>>s;
        s='#'+s;
        memset(dp,-1,sizeof(dp));
        if(solve(1,1000))
        {
            path(1,1000);
            cout<<moves<<endl;
        }
        else
        {
            cout<<"NO\n";
        }
    }
    return 0;
}


#include <bits/stdc++.h>
#define MAXN 1005
#define ID if(0)
using namespace std;

// dp[i][j]: played i games and counter at (j-k)
// 0: not reached
// 1: simply the starting point
// 2: used win to get here
// 3: used loss to get here
// 4: used draw to get here
int dp[MAXN][MAXN*2];
int n, k;
string s;
int main() {
	cin >> n >> k;
	getline(cin, s);
	getline(cin, s);

	int c = 0;
	for (int i = 0; i < s.length(); i++) {
		if (s[i] == 'W' && (c+1) == k && (i+1) != s.length()) {
			cout << "NO" << endl;
			return 0;
		}
		if (s[i] == 'W') c += 1;
		if (s[i] == 'L') c -= 1;
		if (s[i] == '?') c -= 1;
		if (c < (-k)) c = -k;
	}

	c = 0;
	for (int i = 0; i < s.length(); i++) {
		if (s[i] == 'L' && (c-1) == -k && (i+1) != s.length()) {
			cout << "NO" << endl;
			return 0;
		}
		if (s[i] == 'W') c += 1;
		if (s[i] == 'L') c -= 1;
		if (s[i] == '?') c += 1;
		if (c > k) c = k;
	}

	// at this point it must not force k/-k prematurely
	dp[0][k] = 1;
	for (int i = 0; i < s.length(); i++) {
		for (int j = 0; j <= 2*k; j++) {
			if (dp[i][j] == 0) continue;
			int c = j-k;
			if (s[i] == 'W' && ((c < (k-1)) || (c < k && (i+1) == s.length()))) dp[i+1][j+1] = 2;
			if (s[i] == 'L' && ((c > (-k+1)) || (c > (-k) && (i+1) == s.length()))) dp[i+1][j-1] = 3;
			if (s[i] == 'D') dp[i+1][j] = 4;
			if (s[i] == '?') {
				if ((c < (k-1)) || (c < k && (i+1) == s.length())) dp[i+1][j+1] = 2;
				if (((c > (-k+1)) || (c > (-k) && (i+1) == s.length()))) dp[i+1][j-1] = 3;
				dp[i+1][j] = 4;
			}
		}
	}

	ID {
		for (int i = 0; i < s.length(); i++) {
			cout << s[i] << ' ';
		}
		cout << endl;
		for (int j = 2*k; j >= 0; j--) {
			for (int i = 0; i <= s.length(); i++) {
				cout << dp[i][j] << ' ';
			}
			cout << endl;
		}
	}

	if (dp[s.length()][0] == 0 && dp[s.length()][2*k] == 0) {
		cout << "NO" << endl;
	} else {
		string answer;
		int j = dp[s.length()][0] ? 0 : 2*k;
		for (int i = s.length(); i > 0; i--) {
			if (dp[i][j] == 2) {
				answer += 'W';
				j -= 1;
			}
			else if (dp[i][j] == 3) {
				answer += 'L';
				j += 1;
			}
			else if (dp[i][j] == 4) {
				answer += 'D';
			}
		}
		reverse(answer.begin(), answer.end());
		cout << answer << endl;
	}
}


#include <bits/stdc++.h>
#define MAXN 1005
#define ID if(1)
using namespace std;

// dp[i][j]: played i games and counter at (j-k)
// 0: not reached
// 1: simply the starting point
// 2: used win to get here
// 3: used loss to get here
// 4: used draw to get here
int dp[MAXN][MAXN*2];
int n, k;
string s;
int main() {
	cin >> n >> k;
	getline(cin, s);
	getline(cin, s);

	int c = 0;
	for (int i = 0; i < s.length(); i++) {
		if (s[i] == 'W' && (c+1) == k && (i+1) != s.length()) {
			cout << "NO" << endl;
			return 0;
		}
		if (s[i] == 'W') c += 1;
		if (s[i] == 'L') c -= 1;
		if (s[i] == '?') c -= 1;
		if (c < (-k)) c = -k;
	}

	c = 0;
	for (int i = 0; i < s.length(); i++) {
		if (s[i] == 'L' && (c-1) == -k && (i+1) != s.length()) {
			cout << "NO" << endl;
			return 0;
		}
		if (s[i] == 'W') c += 1;
		if (s[i] == 'L') c -= 1;
		if (s[i] == '?') c += 1;
		if (c > k) c = k;
	}

	// at this point it must not force k/-k prematurely
	dp[0][k] = 1;
	for (int i = 0; i < s.length(); i++) {
		for (int j = 0; j <= 2*k; j++) {
			if (dp[i][j] == 0) continue;
			int c = j-k;
			if (s[i] == 'W' && ((c < (k-1)) || (c < k && (i+1) == s.length()))) dp[i+1][j+1] = 2;
			if (s[i] == 'L' && ((c > (-k+1)) || (c > (-k) && (i+1) == s.length()))) dp[i+1][j-1] = 3;
			if (s[i] == 'D') dp[i+1][j] = 4;
			if (s[i] == '?') {
				if ((c < (k-1)) || (c < k && (i+1) == s.length())) dp[i+1][j+1] = 2;
				if (((c > (-k+1)) || (c > (-k) && (i+1) == s.length()))) dp[i+1][j-1] = 3;
				dp[i+1][j] = 4;
			}
		}
	}

	ID {
		for (int i = 0; i < s.length(); i++) {
			cout << s[i] << ' ';
		}
		cout << endl;
		for (int j = 2*k; j >= 0; j--) {
			for (int i = 0; i <= s.length(); i++) {
				cout << dp[i][j] << ' ';
			}
			cout << endl;
		}
	}

	if (dp[s.length()][0] == 0 && dp[s.length()][2*k] == 0) {
		cout << "NO" << endl;
	} else {
		string answer;
		int j = dp[s.length()][0] ? 0 : 2*k;
		for (int i = s.length(); i > 0; i--) {
			if (dp[i][j] == 2) {
				answer += 'W';
				j -= 1;
			}
			else if (dp[i][j] == 3) {
				answer += 'L';
				j += 1;
			}
			else if (dp[i][j] == 4) {
				answer += 'D';
			}
		}
		reverse(answer.begin(), answer.end());
		cout << answer << endl;
	}
}


#include <bits/stdc++.h>
using namespace std;
#define boost ios::sync_with_stdio(false);cin.tie(nullptr)
#define int long long

const int N = 1e3 + 5;
int n,k;
string s;
int dp[N][N][2];

int solve(int id,int cnt,int sign){
   //cout<<id<<" "<<cnt<<" "<<sign<<endl;
   if(id>=n){
      dp[id][cnt][sign] = (cnt == k);
      return (cnt == k);
   }
   if(cnt == k)
      dp[id][cnt][sign] = 0;

   int &tmp = dp[id][cnt][sign];
   if(tmp != -1)
      return tmp;
   tmp = 0;
   if(sign == 1)
      cnt *= -1;
   if(s[id] == '?' or s[id] == 'D')
      tmp = solve(id+1,abs(cnt),sign);
   if(s[id] == '?' or s[id] == 'L')
      tmp |= solve(id+1,abs(cnt - 1),(cnt-1)<0);
   if(s[id] == '?' or s[id] == 'W')
      tmp |= solve(id+1,abs(cnt + 1),(cnt+1)<0);
   return tmp;
}

string ans = "";
void trace(int id,int cnt,int sign){
   if(dp[id][cnt][sign] != 1)
      return;
   int tt = cnt;
   if(sign == 1)
      tt *= -1;
   if(dp[id+1][cnt][sign] == 1){
      ans += 'D';
      trace(id+1,cnt,sign);
      return;
   }

   tt--;
   int ns = (tt < 0);
   if(dp[id+1][abs(tt)][ns] == 1){
      ans += 'L';
      trace(id+1,abs(tt),ns);
      return;
   }
   tt += 2;
   ns = (tt < 0);
   if(dp[id+1][abs(tt)][ns] == 1){
      ans += 'R';
      trace(id+1,abs(tt),ns);
   }
}

int32_t main(){
   boost;
   cin>>n>>k;
   cin>>s;
   memset(dp,-1,sizeof dp);
   if(!solve(0,0,0))
      cout<<"NO"<<endl;
   else{
      trace(0,0,0);
      cout<<ans<<endl;
   }
}


#include <bits/stdc++.h>
using namespace std;
#define boost ios::sync_with_stdio(false);cin.tie(nullptr)
#define int long long

const int N = 1e3 + 5;
int n,k;
string s;
int dp[N][N][2];

int solve(int id,int cnt,int sign){
	//cout<<id<<" "<<cnt<<" "<<sign<<endl;
	if(id>=n){
		dp[id][cnt][sign] = (cnt == k);
		return (cnt == k);
	}

	if(cnt == k)
		return 0;

	int &tmp = dp[id][cnt][sign];
	if(tmp != -1)
		return tmp;
	tmp = 0;
	if(sign == 1)
		cnt *= -1;
	if(s[id] == '?' or s[id] == 'D')
		tmp = solve(id+1,abs(cnt),sign);
	if(s[id] == '?' or s[id] == 'L')
		tmp |= solve(id+1,abs(cnt - 1),(cnt-1)<0);
	if(s[id] == '?' or s[id] == 'W')
		tmp |= solve(id+1,abs(cnt + 1),(cnt+1)<0);
	return tmp;
}

string ans = "";
void trace(int id,int cnt,int sign){
	if(dp[id][cnt][sign] != 1)
		return;
	int tt = cnt;
	if(sign == 1)
		tt *= -1;
	if((s[id]=='?' or s[id]=='D') &&dp[id+1][cnt][sign] == 1){
		ans += 'D';
		trace(id+1,cnt,sign);
		return;
	}

	tt--;
	int ns = (tt < 0);
	if((s[id]=='?' or s[id]=='L') && dp[id+1][abs(tt)][ns] == 1){
		ans += 'L';
		trace(id+1,abs(tt),ns);
		return;
	}
	tt += 2;
	ns = (tt < 0);
	if((s[id]=='?' or s[id]=='W') && dp[id+1][abs(tt)][ns] == 1){
		ans += 'W';
		trace(id+1,abs(tt),ns);
	}
}

int32_t main(){
	boost;
	cin>>n>>k;
	cin>>s;
	memset(dp,-1,sizeof dp);
	if(!solve(0,0,0))
		cout<<"NO"<<endl;
	else{
		trace(0,0,0);
		cout<<ans<<endl;
	}
}


#include <bits/stdc++.h>
using namespace std;
#define boost ios::sync_with_stdio(false);cin.tie(nullptr)
#define int long long

const int N = 1e3 + 5;
int n,k;
string s;
int dp[N][N][2];

int solve(int id,int cnt,int sign){
   //cout<<id<<" "<<cnt<<" "<<sign<<endl;
   if(id>=n){
      dp[id][cnt][sign] = (cnt == k);
      return (cnt == k);
   }
   if(cnt == k)
      dp[id][cnt][sign] = 0;

   int &tmp = dp[id][cnt][sign];
   if(tmp != -1)
      return tmp;
   tmp = 0;
   if(sign == 1)
      cnt *= -1;
   if(s[id] == '?' or s[id] == 'D')
      tmp = solve(id+1,abs(cnt),sign);
   if(s[id] == '?' or s[id] == 'L')
      tmp |= solve(id+1,abs(cnt - 1),(cnt-1)<0);
   if(s[id] == '?' or s[id] == 'W')
      tmp |= solve(id+1,abs(cnt + 1),(cnt+1)<0);
   return tmp;
}

string ans = "";
void trace(int id,int cnt,int sign){
   if(dp[id][cnt][sign] != 1)
      return;
   int tt = cnt;
   if(sign == 1)
      tt *= -1;
   if(dp[id+1][cnt][sign] == 1){
      ans += 'D';
      trace(id+1,cnt,sign);
      return;
   }

   tt--;
   int ns = (tt < 0);
   if(dp[id+1][abs(tt)][ns] == 1){
      ans += 'L';
      trace(id+1,abs(tt),ns);
      return;
   }
   tt += 2;
   ns = (tt < 0);
   if(dp[id+1][abs(tt)][ns] == 1){
      ans += 'W';
      trace(id+1,abs(tt),ns);
   }
}

int32_t main(){
   boost;
   cin>>n>>k;
   cin>>s;
   memset(dp,-1,sizeof dp);
   if(!solve(0,0,0))
      cout<<"NO"<<endl;
   else{
      trace(0,0,0);
      cout<<ans<<endl;
   }
}