#include <bits/stdc++.h>

using namespace std;

int main()
{
    #define int long long
    int t;
    cin>>t;
    int n,k;
    cin>>n>>k;
    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-L;i<n;i++){
        veliki.push_back(a[i]);
    }
    for(int i=0;i<n-L;i++){
        mali.push_back(a[i]);
    }
    int tr = 0;
    int predjeno = 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 l = predjeno;
        int r = veliki.size()-1;
        while(l<r){
            int mid = (l+r)/2;
            if(veliki[mid]>=tr){
                r = mid-1;
            }
            else{
                l = mid;
            }
        }
        if(veliki[l]>=tr){
            tr++;
            res.push_back(veliki[l]);
            predjeno = l+1;
        }
        }

tr = 0;
if(res.size()!=n){
    cout<<"NE"<<endl;
    return 0;
}
for(int i=0;i<n;i++){
    int trs = tr;
    if(trs>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;
}