#include <bits/stdc++.h>
#define int int64_t

using namespace std;

int t;
int n, k;
vector<int> a;

void solve1(){
    if(a[0]!=k){
        cout << "NE";
        return;
    }
    if(n<k || ((n-k)%2==1)){
        cout << "NE";
        return;
    }
    cout << "DA\n";
    if(t)
        for(int x : a) cout << x << " ";
}

void solve2(){
    sort(a.begin(), a.end());
    int kt;
    while(next_permutation(a.begin(), a.end())){
        kt = 0;
        for(int i = 0; i < n; i++){
            if(kt<=a[i]) kt++;
            else kt--;
        }
        if(kt==k) break;
    }
    if(kt!=k){
        cout << "NE\n";
    }else{
        cout << "DA\n";
        if(t)
            for(int x : a) cout << x << " ";
    }

}

int32_t main()
{
    cin >> t;
    cin >> n >> k;
    a = vector<int>(n);

    for(int i = 0; i < n; i++) cin >> a[i];

    bool same = true;
    for(int i = 1; i < n; i++){
        same &= (a[i]==a[i-1]);
    }
    if(same){
        solve1();
        return 0;
    }

    if(n<=10){
        solve2();
        return 0;
    }

    return 0;
}