#include<bits/stdc++.h>

using namespace std;

#define int long long

void solve(){
    int t;
    cin>>t;
    int n, k;
    cin>>n>>k;
    vector<int> v(n);
    for(int i = 0;i<n;i++){
        cin>>v[i];
    }
    if((n+k)%2!=0){
        cout<<"NE"<<endl;
        return;
    }
    if(n<=8){
        sort(v.begin(), v.end());
        int x = 0;
        for(int i = 0;i<n;i++){
            if(v[i]>=x) x++;
            else x--;
        }
        if(x==k){
            cout<<"DA"<<endl;
            for(int i = 0;i<n;i++){
                cout<<v[i]<<" ";
            }
            cout<<endl;
            return;
        }
        bool ok = false;
        while(next_permutation(v.begin(), v.end())){
            int x = 0;
            for(int i = 0;i<n;i++){
                if(v[i]>=x) x++;
                else x--;
            }
            if(x!=k){
                continue;
            }
            ok = true;
            cout<<"DA"<<endl;
            for(int i = 0;i<n;i++){
                cout<<v[i]<<" ";
            }
            cout<<endl;
            break;
        }
        if(!ok){
            cout<<"NE"<<endl;
            return;
        }
    } else if((v[0]==1)&&(v[1]==2)){
        if(k>n){
            cout<<"NE"<<endl;
            return;
        }
        if(k<=0){
            cout<<"NE"<<endl;
            return;
        }
        for(int i = k-1;i<n;i++){
            v[i] = n+k-v[i];
        }
        cout<<"DA"<<endl;
        for(int i = 0;i<n;i++) cout<<v[i]<<" ";
    } else if(abs(v[0])==1){
        int cnt = 0;
        for(int i = 0;i<n;i++){
            if(v[i]==1) cnt++;
        }
        if(n%2==1){
            if(k==1){
                if(cnt==0){
                    cout<<"NE"<<endl;
                    return;
                }
                cout<<"DA"<<endl;
                sort(v.begin(), v.end());
                for(int i = 0;i<n;i++){
                    cout<<v[i]<<" ";
                }
                cout<<endl;
            } else if(k==-1){
                if(cnt>=n-1){
                    cout<<"NE"<<endl;
                    return;
                }
                cout<<"DA"<<endl;
                sort(v.begin(), v.end(), greater<int>());
                for(int i = 0;i<n;i++){
                    cout<<v[i]<<" ";
                }
                cout<<endl;
            }
        } else{
            if(k==2){
                if(cnt<=1){
                    cout<<"NE"<<endl;
                    return;
                }
                cout<<"DA"<<endl;
                sort(v.begin(), v.end());
                for(int i = 0;i<n;i++){
                    cout<<v[i]<<" ";
                }
                cout<<endl;
            } else if(k==0){
                if(cnt==n){
                    cout<<"NE"<<endl;
                    return;
                }
                cout<<"DA"<<endl;
                sort(v.begin(), v.end(), greater<int>());
                for(int i = 0;i<n;i++){
                    cout<<v[i]<<" ";
                }
                cout<<endl;
            }
        }
    }
}

int32_t main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int t = 1;
    //cin>>t;
    while(t--){
        solve();
    }
    return 0;
}