#include<bits/stdc++.h>
using namespace std;
typedef long long li;
#define fi first
#define sc second
#define all(x) x.begin(), x.end()
#define pb push_back
#define eb emplace_back
#define pii pair<int,int>
const int maxn = 2e5+5;
int a[maxn];
int main(){
    ios_base::sync_with_stdio(0); cin.tie(0);
    int t; cin >> t;
    int n, k; cin >> n >> k;
    set<int> v;
    for(int i = 1; i <= n; i++){
        cin >> a[i];
        v.insert(a[i]);
    }
    sort(a+1, a+n+1);
    int tx = 0;
    for(int i = 1; i <= n; i++){
        if(tx <= a[i]) tx++;
        else tx--;
    }
    if(tx < k){
        cout << "NE" << '\n';
        return 0;
    }
    if(tx == k){
        cout << "DA" << '\n';
        for(int i = 1; i <= n; i++) cout << a[i] << ' ';
    }


    if(v.size() == 1){
        int x = 0;
        for(int i = 1; i <= n; i++){
            if(x <= a[i]) x++;
            else x--;
        }

        if(x == k){
            cout << "DA" << '\n';
            for(int i = 1; i <= n; i++) cout << a[i] << ' ';
            cout << '\n';
        }
        else cout << "NE" << '\n';
    }
    else if(n <= 8){
        vector<int> p(n);
        for(int i = 0; i < n; i++) p[i] = i;

        bool ok = false;
        do{
            int x = 0;
            for(int i = 0; i < n; i++){
                if(x <= a[p[i]+1]) x++;
                else x--;
            }
            if(x == k){
                ok = true;
                break;
            }
        }while(next_permutation(all(p)));

        if(ok){
            cout << "DA" << '\n';
            for(int i = 0; i < n; i++) cout << a[p[i]+1] << ' ';
            cout << '\n';
        }
        else cout << "NE" << '\n';
    }
    else if(v.size() == 2 && *v.begin() == -1 && *v.rbegin() == 1){
        // -1 1
        int ne = 0, po = 0;
        for(int i = 1; i <= n; i++){
            if(a[i] == -1) ne++;
            else po++;
        }

    }
    return 0;
}