#include <bits/stdc++.h>

using namespace std;

#define MAXN 200001
#define int long long

int t,n,k;
int a[MAXN];

int32_t main()
{
    cin>>t>>n>>k;
    for (int i=1;i<=n;i++) cin>>a[i];
    bool subtask1=true;
    for (int i=2;i<=n;i++)
    {
        if (a[i]!=a[1]) {subtask1=false;break;}
    }
    if (subtask1)
    {
        int current=0;
        for (int i=1;i<=n;i++)
        {
            if (a[i]>=current) current++;
            else current--;
        }
        if (current!=k) {cout<<"NE"<<endl;return 0;}
        cout<<"DA"<<endl;if (t==0) return 0;
        for (int i=1;i<=n;i++) cout<<a[i]<<" ";
        cout<<endl;return 0;
    }
    if (n<=8)
    {
        vector<int> perm;for (int i=1;i<=n;i++) perm.push_back(i);
        int current=0;
        for (int p:perm)
        {
            if (current<=a[p]) current++;
            else current--;
        }
        if (current==k)
        {
            cout<<"DA"<<endl;if (t==0) return 0;
            for (int i=1;i<=n;i++) cout<<a[i]<<" ";
            cout<<endl;return 0;
        }
        while (next_permutation(perm.begin(),perm.end()))
        {
            current=0;
            for (int p:perm)
            {
                if (current<=a[p]) current++;
                else current--;
            }
            if (current==k)
            {
                cout<<"DA"<<endl;if (t==0) return 0;
                for (int p:perm) cout<<a[p]<<" ";
                cout<<endl;return 0;
            }
        }
        cout<<"NE"<<endl;return 0;
    }
    return 0;
}