#include <bits/stdc++.h>

using namespace std;

int main()
{
    #define int long long
    int t;
    cin>>t;
    int n,k;
    cin>>n>>k;
    if(n>6000) return 0;
    int a[n];
    for(int i=0;i<n;i++){
        cin>>a[i];
    }
    if((n+k)%2==1){
        cout<<"NE"<<endl;
        return 0;
    }
    int l = 0;
    int L = (n+k)/2;
    vector<int> res;
    sort(a,a+n);
    vector<int> veliki;
    vector<int> mali;
    for(int i=n-1;i>=n-L;i--){
        veliki.push_back(a[i]);
    }
    for(int i=n-L-1;i>=0;i--){
        mali.push_back(a[i]);
    }
    int tr = 0;
    for(int i=0;i<n;i++){
        if(!mali.empty() && mali.back()<tr) {
            tr--;
            res.push_back(mali.back());
            mali.pop_back();
            continue;
        }
        int th = 2*l-i;
        bool nasao = false;
        for(int j=veliki.size()-1;j>=0;j--){
            if(veliki[j]>=th){
                res.push_back(veliki[j]);
                vector<int> v1;
                for(int e=0;e<veliki.size();e++){
                    if(e!=j) v1.push_back(veliki[e]);
                }
                veliki = v1;
                nasao = true;
                l++;
                tr++;
                break;
            }
        }
        if(!nasao) {
            cout<<"NE"<<endl;
            return 0;
        }
    }

tr = 0;
for(int i=0;i<n;i++){
    if(tr>res[i]) tr--;
    else tr++;
}
if(tr==k){
    cout<<"DA"<<endl;
    if(t==1){
        for(auto u:res) cout<<u<<" ";
    }
    return 0;
}
    cout<<"NE"<<endl;
}