#include <bits/stdc++.h>

using namespace std;

void sol() {
    int t, n, k;
    cin >> t >> n >> k;
    vector<int> a(n);
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
    }
    int c = 0;
        for (int i = 0; i < n; ++i) {
            if (c <= a[i]) {
                ++c;
            }
            else {
                --c;
            }
        }
        if (c == k) {
            cout << "DA\n";
            if (t == 1) {
                for (auto& e : a) {
                    cout << e << ' ';
                }
                cout << '\n';
            }
            return;

        }
    if (all_of(a.begin(), a.end(), [&](int e){ return e == a[0]; })) {
        int c = 0;
        for (int i = 0; i < n; ++i) {
            if (c <= a[i]) {
                ++c;
            }
            else {
                --c;
            }
        }
        if (c == k) {
            cout << "DA\n";
            if (t == 1) {
                for (auto& e : a) {
                    cout << e << ' ';
                }
                cout << '\n';
            }

        }
        else {
            cout << "NE\n";
        }
        return;
    }
    if (n > 8 && t == 0) {
        int c1 = 0;
        sort(a.begin(), a.end());
        for (int i = 0; i < n; ++i) {
            if (c1 <= a[i]) {
                ++c1;
            }
            else {
                --c1;
            }
        }
        int c2 = 0;
        sort(a.rbegin(), a.rend());
        for (int i = 0; i < n; ++i) {
            if (c2 <= a[i]) {
                ++c2;
            }
            else {
                --c2;
            }
        }
        if (k >= c2 && k <= c1) {
            cout << "DA\n";
        }
        else {
            cout << "NE\n";
        }
        return;
    }
    while (next_permutation(a.begin(), a.end())) {
        int c = 0;
        for (int i = 0; i < n; ++i) {
            if (c <= a[i]) {
                ++c;
            }
            else {
                --c;
            }
        }
        if (c == k) {
            cout << "DA\n";
            if (t == 1) {
                for (auto& e : a) {
                    cout << e << ' ';
                }
                cout << '\n';
            }
            return;

        }
    }
    cout << "NE\n";
}

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