#include <bits/stdc++.h>

using namespace std;

int f(vector<int>& komb){
    int ans = 0;
    for(int i = 0; i < komb.size(); i++){
        if(komb[i] >= ans) ans++;
        else ans--;
    }

    return ans;
}

void gen(vector<int>& v, int k, vector<bool>& flag, int p, int n, vector<int>& komb, bool& c){
    if(p == n){
        int ans = f(komb);
        if(ans == k){
            c = false;
            cout << "DA\n";
            for(auto br : komb){
                cout << br << ' ';
            }
        }
        return;
    }

    for(int i = 0; i < n; i++){
        if(!flag[i]){
            komb[p] = v[i];
            flag[i] = true;
            gen(v, k, flag, p+1, n, komb, c);
            flag[i] = false;
        }
    }
}

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

    int t; cin >> t;
    int n, k; cin >> n >> k;
    bool pr = true;

    vector<int> v(n);
    cin >> v[0];
    for(int i = 1; i < n; i++){
        cin >> v[i];
        if(v[i] != v[i-1]) pr = false;
    }

    //a1 = a2 = ... = an
    if(pr){
        if(v[0] == 0){
            if(k < 0 || k > 1){
                cout << "NE\n";
            }
            if((k == 1 && n%2 == 1) || (k == 0 && n%2 == 0)){
                cout << "DA\n";
                for(int i = 0; i < n; i++) cout << v[0] << ' ';
            }
            else{
                cout << "NE\n";
            }
        }
        else if(v[0] > 0){
            if(k > v[0]+1 || k < 0){
                cout << "NE\n";
            }
            if(n >= v[0] && ((k == v[0] && n%2 == 1) || (k == v[0]+1 && n%2 == 0))){
                cout << "DA\n";
                for(int i = 0; i < n; i++) cout << v[0] << ' ';
            }
            else if(n < v[0] && n == k){
                cout << "DA\n";
                for(int i = 0; i < n; i++) cout << v[0] << ' ';
            }
            else{
                cout << "NE\n";
            }
        }
        else{
            if(k >= 0 || k < v[0]){
                cout << "NE\n";
            }
            if(n >= -v[0] && ((k == v[0] && n%2 == 1) || (k == v[0]+1 && n%2 == 0))){
                cout << "DA\n";
                for(int i = 0; i < n; i++) cout << v[0] << ' ';
            }
            else if(n < -v[0] && n == -k){
                cout << "DA\n";
                for(int i = 0; i < n; i++) cout << v[0] << ' ';
            }
            else{
                cout << "NE\n";
            }
        }
    }
    //n <= 8
    else if(n <= 8){
        vector<bool> flag(n, false);
        vector<int> komb(n);
        bool c = true;
        gen(v, k, flag, 0, n, komb, c);
        if(c){
            cout << "NE\n";
        }
    }
    return 0;
}