#include <bits/stdc++.h>
#define FAST ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define ll long long
#define ff first
#define ss second
using namespace std;

int f(vector < int > & v)
{
    int ans = 0;
    for(auto it : v)
    {
        if(it >= ans) ans++;
        else ans--;
    }
    return ans;
}
int main()
{
    FAST;
    int t; cin >> t;
    int n, k; cin >> n >> k;
    vector < int > v(n);
    for(int i = 0; i < n; i++) cin >> v[i];

    sort(begin(v), end(v));
    int a = f(v);
    sort(begin(v), end(v), greater < int > ());
    int b = f(v);


    int c = abs(b) % 2;

    if(abs(k) % 2 != c) return cout << "NE\n", 0;

    int tr = f(v);
    int cnt =  0;
    while(tr != k)
    {
        bool b = false;
        for(int i = 0; i < n; i++)
        {
            for(int j = 0; j < n; j++)
            {

                swap(v[i], v[j]);
                int tr0 = f(v);
                if(abs(tr - k) > abs(tr0 - k)) { b = true; tr = tr0; break; }
                swap(v[i], v[j]);
            }
            if(b) break;
        }
        if(cnt++ > 1000000) break;
    }
    
    if(cnt < 1000000)
    sort(begin(v), end(v));
    int a = f(v);

    cout << "DA\n";
    if(t == 0) return 0;
    for(auto it : v) cout << it << " ";
    cout << "\n";

    return 0;
}