#include <bits/stdc++.h>

using namespace std;

#define ll long long
const int INF=1e9;
const ll LINF=1e18,MOD=1e9+7;
#define fi first
#define se second
#define pii pair<int,int>
#define mid ((l+r)/2)
#define sz(a) (int((a).size()))
#define all(a) a.begin(),a.end()
#define endl "\n"
#define pb push_back

void PRINT(int x) {cerr << x;}
void PRINT(ll x) {cerr << x;}
void PRINT(double x) {cerr << x;}
void PRINT(char x) {cerr << '\'' << x << '\'';}
void PRINT(string x) {cerr << '\"' << x << '\"';}
void PRINT(bool x) {cerr << (x ? "true" : "false");}

template<typename T,typename V>
void PRINT(pair<T,V>& x){
    cerr<<"{";
    PRINT(x.fi);
    cerr<<",";
    PRINT(x.se);
    cerr<<"}";
}
template<typename T>
void PRINT(T &x){
    int id=0;
    cerr<<"{";
    for(auto _i:x){
        cerr<<(id++ ? "," : "");
        PRINT(_i);
    }
    cerr<<"}";
}
void _PRINT(){
    cerr<<"]\n";
}
template<typename Head,typename... Tail>
void _PRINT(Head h,Tail... t){
    PRINT(h);
    if(sizeof...(t)) cerr<<", ";
    _PRINT(t...);
}

#define Debug(x...) cerr<<"["<<#x<<"]=["; _PRINT(x)

const int mxN=2e5;

int T,N,K;
vector<int> A;

int Probaj(vector<int> B){
    int val=0;
    for(int a:B){
        if(val<=a) val++;
        else val--;
    }
    return val;
}

void Solve(){
    cin>>T;
    cin>>N>>K;
    A.resize(N);
    for(int i=0;i<N;i++) cin>>A[i];
    int l=0,r=N-1;
    sort(all(A));
    int res=-1;
    while(l<=r){
        vector<int> B=A;
        reverse(B.begin()+mid,B.end());
        if(Probaj(B)>=K){
            res=mid;
            r=mid-1;
        }
        else l=mid+1;
    }
    vector<int> B=A;
    if(res==-1){
        cout<<"NE"<<endl;
        return;
    }
    reverse(B.begin()+res,B.end());
    if(Probaj(B)==K){
        cout<<"DA"<<endl;
        if(T==0) return;
        for(int x:B) cout<<x<<" ";
        cout<<endl;
    }
    else{
        cout<<"NE"<<endl;
    }
}

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t; t=1;
    while(t--){
        Solve();
    }
    return 0;
}