#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main()
{
    int t, n, k;
    cin >> t;
    cin >> n >> k;
    vector<int>v(n);
    vector<int>per;
    for (int i = 0; i < n; i++) {
        cin >> v[i];
        per.push_back(i + 1);
    }
    bool ind = false;
    vector<int>res;
    while (next_permutation(per.begin(), per.end())) {
        long long sum = 0;
        for (int i = 0; i < n; i++) {
            if (v[per[i] - 1] >= sum)sum++;
            else sum--;
        }
        if (sum == k) {
            ind = true;
            for (int i = 0; i < n; i++) {
                res.push_back(v[per[i]-1]);
            }
            break;
        }

    }
    if (ind) {
        cout << "DA" << "\n";
        for (int i = 0; i < n; i++) {
            cout << res[i] << " ";
        }
    }
    else cout << "NE" << "\n";
}