#include <bits/stdc++.h>
#define pb push_back
#define ll long long int
#define pi pair<int, int>
#define all(x) x.begin(), x.end()

using namespace std;

ll k;

void Probajsve(ll ind, ll n, vector<ll>& a, vector<bool>& visited, vector<ll>& rds, vector<ll>& res, bool& mz)
{
    if(mz) return;
    if(ind>=n)
    {
        //cout<<"usao\n";
        ll rez=0;
        for(int i=0; i<n; i++)
        {
            if(rds[i]>=rez) rez++;
            else rez--;
            //cout<<rds[i]<<" ";
        }
        //cout<<"\n";
        if(rez==k)
        {
            for(int i=0; i<n; i++) res[i]=rds[i];
            mz=true;
        }
        return;
    }
    for(int i=0; i<n; i++)
    {
        if(mz) return;
        if(!visited[i])
        {
            visited[i]=true;
            rds[ind]=a[i];
            Probajsve(ind+1, n, a, visited, rds, res, mz);
            visited[i]=false;
            rds[ind]=0;
        }
    }
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);

    ll t, n;
    cin>>t>>n>>k;
    vector<ll> a(n);
    bool tc1=true, tc3=true, tc4=true;
    for(int i=0; i<n; i++)
    {
        cin>>a[i];
        if(a[i]!=a[0])
        {
            tc1=false;
        }
        if(a[i]!=1 && a[i]!=-1) tc3=false;
        if(a[i]!=i) tc4=false;
    }
    if(tc1)
    {
        ll rez=0;
        if(n>abs(a[0]) && (n%2)!=(abs(a[0])%2)) rez=a[0]+1;
        else if(n>abs(a[0]) && (n%2)==(abs(a[0])%2)) rez=a[0];
        else if(n==abs(a[0])) rez=a[0];
        else rez=n*(a[0]/abs(a[0]));
        if(k!=rez) cout<<"NE\n";
        else
        {
            cout<<"DA\n";
            if(t==1) for(int i=0; i<n; i++) cout<<a[i]<<" ";
        }
    }
    else if(n<=8)
    {
        vector<bool> visited(n, false);
        vector<ll> rds(n, 0), res(n, 0);
        bool mz=false;
        Probajsve(0, n, a, visited, rds, res, mz);
        if(!mz) cout<<"NE\n";
        else
        {
            cout<<"DA\n";
            if(t==1) for(auto u:res) cout<<u<<" ";
        }
    }
    else if(tc3)
    {
         sort(all(a));

        ll cuvj=-1;
        for(int j=1; j<=n && cuvj==-1; j++)
        {
            ll rez=0;
            for(int i=n-j; i<n; i++)
            {
                if(a[i]>=rez) rez++;
                else rez--;
            }
            for(int i=0; i<n-j; i++)
            {
                if(a[i]>=rez) rez++;
                else rez--;
            }
            if(rez==k)
            {
                cuvj=j;
            }
            }
            if(cuvj==-1) cout<<"NE\n";
            else
            {
                cout<<"DA\n";
                if(t==1)
                {
                    for(int i=n-cuvj; i<n; i++)
                    {
                        cout<<a[i]<<" ";
                    }
                    for(int i=0; i<n-cuvj; i++)
                    {
                        cout<<a[i]<<" ";
                    }
                }
            }
    }
    /*else if(tc4)
    {
        ll mini=0, maksi=n;
        if(n%2==0) mini=2;
        else mini=1;

    }*/
    else
    {
        sort(all(a));
        ll rez=0;
        for(int i=0; i<n; i++)
        {
            if(a[i]>=rez) rez++;
            else rez--;
        }
        if(rez==k)
        {
            cout<<"DA\n";
            if(t==1) for(int i=0; i<n; i++) cout<<a[i]<<" ";
        }
        else cout<<"NE";
    }


}