#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define pb push_back
#define ll long long
#define mp make_pair
#define ld long double
const int N=2e5+50;
int a[N],n;
int Calc(vector<int>a){
    int x=0;
    for(auto i:a){
        if(x<=i)x++;
        else x--;
    }
    return x;
}
int Get(int i){
    vector<int>b;
    for(int j=i;j<=n;j++)b.pb(a[j]);
    for(int j=i-1;j>=1;j--)b.pb(a[j]);
    return Calc(b);
}
int main(){
    int t;scanf("%i",&t);
    int k;scanf("%i%i",&n,&k);
    for(int i=1;i<=n;i++)scanf("%i",&a[i]);
    sort(a+1,a+n+1);
    vector<int>res;
    int l=1,r=n,ind=0;
    while(l<=r){
        int mid=l+r>>1;
        if(Get(mid)>=k)l=mid+1,ind=mid;
        else r=mid-1;
    }
    if(ind){
        for(int j=ind;j<=n;j++)res.pb(a[j]);
        for(int j=ind-1;j>=1;j--)res.pb(a[j]);
        printf("DA\n");
        for(auto i:res)printf("%i ",i);printf("\n");
    }
    else printf("NE\n");
    return 0;
}