#include <bits/stdc++.h>
using namespace std;

const int MAXN = 2e5 + 5;

int N, K;
int A[MAXN];

int main()
{
    ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    int T;
    cin >> T;
    cin >> N >> K;
    for(int i = 1; i <= N; i++) cin >> A[i];
    bool check = 1;
    for(int i = 2; i <= N; i++) if(A[i] != A[i - 1]) check = 0;
    int cnt = 0;
    if(N <= 10)
    {
        do{
            int sol = 0;
            for(int i = 1; i <= N; i++)
            {
                if(sol <= A[i]) sol++;
                else sol--;
            }
            if(sol == K)
            {
                cout << "DA\n";
                if(T)
                {
                    for(int i = 1; i <= N; i++) cout << A[i] << " ";
                    cout << "\n";
                }
                return 0;
            }
        }while(next_permutation(A + 1, A + N + 1));
        cout << "NE\n";
        return 0;
    }
    if(check)
    {
        if(A[1] >= K and K == N)
        {
            cout << "DA\n";
            if(T)
            {
                for(int i = 1; i <= N; i++) cout << A[i] << " ";
                cout << "\n";
            }
        }
        else cout << "NE\n";
    }
    return 0;
}