#include<bits/stdc++.h>
using namespace std;
int t, n, k, a[100050], uvazenost;
int main()
{
    cin >> t;
    cin >> n >> k;
    for(int i=1; i<=n; i++)
        cin >> a[i];
    sort(a+1, a+n+1);

    do{
        uvazenost = 0;
        for(int i=1; i<=n; i++)
        {
            if(a[i] > uvazenost)
                uvazenost++;
            else
                uvazenost--;
        }

        if(uvazenost == k)
        {
            cout << "DA\n";

            if(t == 1)
            {
                for(int i=1; i<=n; i++)
                    cout << a[i] << " ";
                cout << "\n";
            }
            return 0;
        }

    }while(next_permutation(a+1, a+n+1));
    cout << "NE\n";
    return 0;
}