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

const ll N=2e5+55;
ll a[N],n,k;

signed main(){
    ios::sync_with_stdio(0);
    cin.tie(0);

    ll T;cin>>T;
    cin>>n>>k;
    for(int i=1;i<=n;++i)
        cin>>a[i];

    if((n&1)!=(k&1)){
        cout<<"NE";return 0;
    }

    sort(a+1,a+n+1);
    multiset<ll>gr,dl;
    for(int i=1;i<=n;++i){
        if(i<=(n-k)/2)dl.insert(a[i]);
        else gr.insert(a[i]);
    }

    vector<ll>ans;
    ll cur=0;
    for(auto x:gr){
        if(cur>x){
            cout<<"NE";return 0;
        }
        ans.push_back(x);
        ++cur;
    }

    while(dl.size()){
        auto it=prev(dl.end());
        if(cur<=*it){
            cout<<"NE";return 0;
        }
        ans.push_back(*it);
        dl.erase(it);
        --cur;
    }

    cout<<"DA";
    if(T){
        cout<<'\n';
        for(ll xx:ans)cout<<xx<<' ';
    }
}