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

using namespace std;

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

void solve1(){
    bool possible = false;
    possible|=(a[0]==k && n>=k && ((n-k)%2==0) );
    possible|=(a[0]==k-1 && n>=k && ((n-k+1)%2==1) );
    cout << (possible ? "DA" : "NE") << '\n';
    if(t && possible){
        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 << " ";
    }

}

void solve4(){

    if(n<k || k<0 || (n-k)%2==1){
        cout << "NE\n"; return;
    }
    cout << "DA\n";
    if(t){
        int sp = (n+k)/2;
        sp = n-sp;
        for(int i = sp+1; i <= n; i++) cout << i << " ";
        for(int i = 1; i <= sp; i++) cout << i << " ";

    }
}

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;
    bool s4 = true;
    for(int i = 1; i < n; i++){
        same &= (a[i]==a[i-1]);
    }
    for(int i = 0; i < n; i++){
        s4 &= (a[i]==i+1);
    }
    if(s4){
        solve4();
        return 0;
    }
    if(same){
        solve1();
        return 0;
    }

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


    return 0;
}