#include <bits/stdc++.h>

using namespace std;

#define MAXN 200001
#define MAX 505
#define int long long

int t,n,k;
int a[MAXN];
//bool dp[MAX][MAX][MAX][4];
//pair<int,pair<int,int>> pret[MAX][MAX][MAX][4];

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;
    }
    bool subtask4=true;
    for (int i=1;i<=n;i++)
    {
        if (a[i]!=i) {subtask4=false;break;}
    }
    if (subtask4)
    {
        if ((n-k)%2!=0) {cout<<"NE"<<endl;return 0;}
        if (k<=0) {cout<<"NE"<<endl;return 0;} ///zapravo jeste kad k<=0 nema resenja
        int num1=(n+k)/2,num2=(n-k)/2;cout<<"DA"<<endl;
        if (t==0) return 0;
        for (int i=n-num1+1;i<=n;i++) cout<<i<<" ";
        for (int i=num2;i>=1;i--) cout<<i<<" ";
        cout<<endl;return 0;
    }
    /*bool subtask3=true;
    for (int i=1;i<=n;i++)
    {
        if (a[i]!=1 or a[i]!=-1) {subtask3=false;break;}
    }
    if (subtask3 and n<=500)
    {
        /* NE RADI
        int nummin1=0,numplu1=0;
        for (int i=1;i<=n;i++)
        {
            if (a[i]==-1) nummin1++;
            else numplu1++;
        }
        dp[0][0][0][1]=true;
        for (int i=1;i<=n;i++)
        {
            for (int plus1=0;plus1<=min(i,numplu1);plus1++)
            {
                int minus1=i-plus1;
                if (plus1>=1)
                {
                     if (dp[i-1][plus1-1][minus1][0]) {dp[i][plus1][minus1][1]=true;pret[i][plus1][minus1][1]={0,{plus1-1,minus1}};}
                     if (dp[i-1][plus1-1][minus1][1]) {dp[i][plus1][minus1][2]=true;pret[i][plus1][minus1][2]={1,{plus1-1,minus1}};}
                     if (dp[i-1][plus1-1][minus1][2]) {dp[i][plus1][minus1][3]=true;pret[i][plus1][minus1][3]={2,{plus1-1,minus1}};}
                     if (dp[i-1][plus1-1][minus1][3]) {dp[i][plus1][minus1][2]=true;pret[i][plus1][minus1][2]={3,{plus1-1,minus1}};}
                }
                if (minus1>=1)
                {
                      if (dp[i-1][plus1][minus1-1][0]) {dp[i][plus1][minus1][1]=true;pret[i][plus1][minus1][1]={0,{plus1,minus1-1}};}
                      if (dp[i-1][plus1][minus1-1][1]) {dp[i][plus1][minus1][0]=true;pret[i][plus1][minus1][0]={1,{plus1,minus1-1}};}
                      if (dp[i-1][plus1][minus1-1][2]) {dp[i][plus1][minus1][1]=true;pret[i][plus1][minus1][1]={2,{plus1,minus1-1}};}
                      if (dp[i-1][plus1][minus1-1][3]) {dp[i][plus1][minus1][2]=true;pret[i][plus1][minus1][2]={3,{plus1,minus1-1}};}
                }
            }
        }
        if (!dp[n][numplu1][nummin1][k+1]) {cout<<"NE"<<endl;return 0;}
        cout<<"DA"<<endl;if (t==0) return 0;
        pair<int,pair<int,int>> curr={k+1,{numplu1,nummin1}};int pointer=n;
        vector<int> answer;
        while (!(pointer==0 and curr.first==1 and curr.second.first==0 and curr.second.second==0))
        {
              pair<int,pair<int,int>> pretcurr=pret[pointer][curr.second.first][curr.second.second][curr.first];
              if (pretcurr.second.first+1==curr.second.first) answer.push_back(1);
              else answer.push_back(-1);
              curr=pretcurr;pointer--;
        }
        reverse(answer.begin(),answer.end());for (int aa:answer) cout<<aa<<" ";
        cout<<endl;return 0;
    }*/
    if (t==0)
    {
        if ((n-k)%2!=0) {cout<<"NE"<<endl;return 0;}
        sort(a+1,a+n+1);
        int maxanswer=0;
        for (int i=1;i<=n;i++)
        {
            if (a[i]>=maxanswer) maxanswer++;
            else maxanswer--;
        }
        reverse(a+1,a+n+1);
        int minanswer=0;
        for (int i=1;i<=n;i++)
        {
            if (a[i]>=minanswer) minanswer++;
            else minanswer--;
        }
        if (minanswer<=k and k<=maxanswer) {cout<<"DA"<<endl;return 0;}
        else {cout<<"NE"<<endl;return 0;}
    }
    return 0;
}