#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;
    }
    bool x = 1;
    for (int i = 0; i < n; ++i) {
        if (a[i] != i + 1) {
            x = 0;
            break;
        }
    }
    if (x) {
        if ((n % 2 != k % 2) || k <= 0) {
            cout << "NE\n";
            return;
        }
        sort(a.begin(), a.end());
        reverse(a.begin() + k - 1, a.end());
        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 == 1 || e == -1); })) {
        if (n % 2 == 0) {
            if (k == 0) {
                sort(a.rbegin(), a.rend());
                cout << "DA\n";
                if (t == 1) {
                    for (auto& e : a) {
                        cout << e << ' ';
                    }
                    cout << '\n';
                }
            }
            else if (k == 2) {
                sort(a.begin(), a.end());
                cout << "DA\n";
                if (t == 1) {
                    for (auto& e : a) {
                        cout << e << ' ';
                    }
                    cout << '\n';
                }
            }
            else {
                cout << "NE\n";
                return;
            }
        }
        else {
            if (k == 1) {
                sort(a.begin(), a.end());
                cout << "DA\n";
                if (t == 1) {
                    for (auto& e : a) {
                        cout << e << ' ';
                    }
                    cout << '\n';
                }
            }
            else if (k == -1) {
                sort(a.rbegin(), a.rend());
                cout << "DA\n";
                if (t == 1) {
                    for (auto& e : a) {
                        cout << e << ' ';
                    }
                    cout << '\n';
                }
            }
            else {
                cout << "NE\n";
                return;
            }
        }
        return;
    }
    if (n > 8) {
        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;
}