#include <bits/stdc++.h>
#define ll long long
#define endl '\n'

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false); cin.tie(0);
    ll t, N, K;
    cin >> t >> N >> K;
    vector <ll> A(N + 1);
    set <ll> s;
    for(int i = 1; i <= N; i++) {cin >> A[i]; s.insert(A[i]);}
    if((ll) s.size() == 1)
    {
        ll uv = 0;
        for(int i = 1; i <= N; i++)
        {
            if(uv <= A[i]) uv++;
            else uv--;
        }
        if(uv == K) {cout << "NE" << endl; return 0;}
        cout << "DA" << endl;
        if(t == 1) {for(int i = 1; i <= N; i++) cout << A[i] << " ";}
        return 0;
    }
    else if(N <= 8)
    {
        vector <ll> perm;
        for(int i = 1; i <= N; i++) perm.push_back(A[i]);
        sort(perm.begin(), perm.end());
        bool found = false;
        do
        {
            ll uv = 0;
            for(int i = 0; i < N; i++)
            {
                if(uv <= A[i]) uv++;
                else uv--;
            }
            if(uv == K) {found = true; break;}
        }
        while(next_permutation(perm.begin(), perm.end()));
        if(found)
        {
            cout << "DA" << endl;
            if(t == 1) {for(auto n : perm) cout << n << " "; return 0;}
        }
        else cout << "NE" << endl;
        return 0;
    }
    return 0;
}