#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;
    }

    if((n-k)/2<0){
        cout<<"NE";return 0;
    }

    vector<ll>v,ans;
    for(int i=1;i<=n;++i)
        v.push_back(a[i]);
    sort(v.begin(),v.end());

    ll vc=(n+k)/2;
    for(ll gde=0;gde<=vc;++gde){
        //dodajem gde likova
        //pa oduzimam n-vc likova
        //pa dodajem vc-gde likova
        vector<ll>v,ans;
        for(int i=1;i<=n;++i)
            v.push_back(a[i]);
        sort(v.begin(),v.end());
        ll cur=0;
        bool ok=1;
        for(int i=0;i<gde;++i){
            auto it=lower_bound(v.begin(),v.end(),cur);
            if(it==v.end()){ok=0;break;}
            ++cur;
            ans.push_back(*it);
            v.erase(it);
        }
        if(!ok)continue;
        for(int i=n-vc-1;i>=0;--i){
            if(cur<=v[i]){ok=0;break;}
            ans.push_back(v[i]);
            --cur;
        }
        if(!ok)continue;
        for(int i=0;i<n-vc;++i)
            v.erase(v.begin());
        for(int i=0;i<vc-gde;++i){
            auto it=lower_bound(v.begin(),v.end(),cur);
            if(it==v.end()){ok=0;break;}
            ++cur;
            ans.push_back(*it);
            v.erase(it);
        }
        if(!ok)continue;
        assert(cur==k);
        cout<<"DA";
        if(T){
            cout<<'\n';
            for(ll xx:ans)cout<<xx<<' ';
            return 0;
        }
    }

    cout<<"NE";
}