#include <bits/stdc++.h>
#define ll long long
#define pb push_back
using namespace std;
int N, K, A[200005];
bool T;
void set2()
{
    do
        {
            int zb = 0;
            for(int i = 1; i <= N; i++)
            {
                if(A[i] >= zb)zb++;
                else zb--;
            }
            if(zb == K){cout << "DA\n"; if(T)for(int i = 1; i <= N; i++)cout << A[i] << ' '; return;}
        }while(next_permutation(A + 1, A + N + 1));
    cout << "NE\n";
}
int main()
{
    cin >> T;
    cin >> N >> K;
    bool sviisti = true;
    for(int i = 1; i <= N; i++){cin >> A[i]; if(A[i]!= A[1])sviisti = false;}
    if(sviisti)
    {

        if(N < abs(A[1]))
        {
            if(K == (N * A[1] / abs(A[1])))
            {
                cout << "DA\n";
            if(T)for(int i = 1; i <= N; i++)cout << A[i] << ' ';

            }
            else cout << "NE\n";
            return 0;
        }
        if((K == A[1] && (N & 1)) || (K == (A[1] + 1) && !(N & 1)))
        {
            cout << "DA\n";
            if(T)for(int i = 1; i <= N; i++)cout << A[i] << ' ';

        }
        else cout << "NE\n";
        return 0;
    }
    if(N <= 8)
    {
        set2();
    }

    return 0;
}