#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,ok=1;
    for(auto x:gr){
        if(cur>x){
            ok=0;break;
        }
        ans.push_back(x);
        ++cur;
    }

    while(dl.size()){
        auto it=prev(dl.end());
        if(cur<=*it){
            ok=0;break;
        }
        ans.push_back(*it);
        dl.erase(it);
        --cur;
    }

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

    ok=1;cur=0;
    while(dl.size()){
        auto it=prev(dl.end());
        if(cur<=*it){
            ok=0;break;
        }
        ans.push_back(*it);
        dl.erase(it);
        --cur;
    }

    for(auto x:gr){
        if(cur>x){
            ok=0;break;
        }
        ans.push_back(x);
        ++cur;
    }

    if(ok){
        cout<<"DA";
        if(T){
            cout<<'\n';
            for(ll xx:ans)cout<<xx<<' ';
        }
        return 0;
    }else cout<<"NE";
}