#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 main(){
    ios_base::sync_with_stdio(0); cin.tie(0);
    int t; cin >> t;
    int n, k; cin >> n >> k;

    vector<int> a(n);
    for(int i = 0; i < n; i++){
        cin >> a[i];

    }
    sort(all(a));

    if((n-k) % 2 != 0) {
        cout << "NE" << '\n';
        return 0;
    }

    multiset<int> pl, mn;
    for(int i = n-1; i >= n - (k+n)/2; i--){
       // cout << "plus " << a[i] << '\n';
        pl.insert(a[i]);
    }
    for(int i = n-(k+n)/2 - 1; i>=0; i--){
        //cout << "minus " << a[i] << '\n';
        mn.insert(a[i]);
    }

    bool moze = true;
    int x = 0;
    vector<int> ans(n);
    for(int i = 0; i < n; i++){
        if(mn.empty()){
            int val = *pl.begin();
            if(val >= x) x++;
            else x--;
            ans[i] =val;
            pl.extract(val);
            continue;
        }
        else if(pl.empty()){
            int val = *mn.rbegin();
            if(val >= x) x++;
            else x--;
            ans[i] = val;
            mn.extract(val);
            continue;
        }


        if(x > *pl.begin()){
            if(mn.empty()) {
                moze = false;
                break;
            }
            //cout << "x V " << x << ' ' << *pl.begin() << '\n';

            auto it = mn.lower_bound(x);
            if(it == mn.begin()){
                moze = false;
                break;
            }
            int val = *prev(it);
            if(val >= x) x++;
            else x--;
            ans[i] = val;
            mn.extract(val);
        }
        else{
            if(pl.empty()){
                moze = false;
                break;
            }

            auto it = pl.lower_bound(x);
            if(it == pl.end()){
                moze = false;
                break;
            }
            int val = *it;
            if(val >= x) x++;
            else x--;
            ans[i] = val;
            pl.extract(val);
        }
    }
    if(moze && x == k) {
        cout << "DA" << '\n';
        for(int i = 0; i < n; i++) {
            cout <<  ans[i] << ' ';
        }
        cout << '\n';
    }
    else{
        pl.clear();
        mn.clear();
        for(int i = n-1; i >= n - (k+n)/2; i--){
           // cout << "plus " << a[i] << '\n';
            pl.insert(a[i]);
        }
        for(int i = n-(k+n)/2 - 1; i>=0; i--){
            //cout << "minus " << a[i] << '\n';
            mn.insert(a[i]);
        }

        moze = true;
        x = 0;
        ans = vector<int>(n);
        for(int i = 0; i < n; i++){
            if(mn.empty()){
                int val = *pl.begin();
                if(val >= x) x++;
                else x--;
                ans[i] =val;
                pl.extract(val);
                continue;
            }
            else if(pl.empty()){
                int val = *mn.rbegin();
                if(val >= x) x++;
                else x--;
                ans[i] = val;
                mn.extract(val);
                continue;
            }


            if(x <= *mn.rbegin()){
                 if(pl.empty()){
                    moze = false;
                    break;
                }

                auto it = pl.lower_bound(x);
                if(it == pl.end()){
                    moze = false;
                    break;
                }
                int val = *it;
                if(val >= x) x++;
                else x--;
                ans[i] = val;
                pl.extract(val);
            }
            else{
                 if(mn.empty()) {
                    moze = false;
                    break;
                }
                //cout << "x V " << x << ' ' << *pl.begin() << '\n';

                auto it = mn.lower_bound(x);
                if(it == mn.begin()){
                    moze = false;
                    break;
                }
                int val = *prev(it);
                if(val >= x) x++;
                else x--;
                ans[i] = val;
                mn.extract(val);
            }
        }
        if(moze && x == k) {
            cout << "DA" << '\n';
            for(int i = 0; i < n; i++) {
                cout << ans[i] << ' ';
            }
            cout << '\n';
        }
        else cout << "NE" << '\n';
    }
    return 0;
}