#include <bits/stdc++.h>
using namespace std;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int t,n,k;
    cin >> t >> n >> k;
    vector<int> a(n);
    for ( int i = 0 ; i < n ; i++ ) cin >> a[i];
    sort(a.begin(),a.end());
    int u = 0,umin = 0;
    for ( int i = 0 ; i < n ; i++)
    {
        if ( a[i] >= u) u++;
        else u--;
    }
    for ( int i = n-1 ; i >= 0 ; i--)
    {
        if ( a[i] >= umin ) umin++;
        else umin--;
    }
    if ( t == 0)
    {
        if ( k >= umin && k <= u) cout << "DA";
        else cout << "NE";
    }
    else
    {
        if ( u == k)
        {
            cout << "DA" << endl;
            if ( t == 1 )
                for ( int j = 0 ; j < n ; j++) cout << a[j] << " ";
        }
        else if ( u < k) cout << "NE";
        else if ( umin > k) cout << "NE";
        else
        {
            for ( int i = 0 ; i < n ; i++)
            {
                swap(a[i],a[n-1-i]);
                u = 0;
                for ( int j = 0 ; j < n ; j++)
                {
                    if ( a[j] >= u) u++;
                    else u--;
                }
                if ( u == k)
                {
                    cout << "DA" << endl;
                    if ( t == 1)
                        for ( int j = 0 ; j < n ; j++) cout << a[j] << " ";
                    break;
                }
            }
        }
        if ( u > k) cout << "NE";
    }

}