/// 407!3 +/ \!<07!\*
#include <bits/stdc++.h>

using namespace std;

using ll = long long;
using db = long double;
using str = string;
using pi = pair<int,int>;
using vi = vector<int>;
using vpi = vector<pi>;
using vvi = vector<vi>;
#define f first
#define s second
#define sz(x) int((x).size())
#define bg(x) begin(x)
#define all(x) bg(x), end(x)
#define rall(x) x.rbegin(), x.rend()
#define sor(x) sort(all(x))
#define rsz resize
#define ins insert
#define pb push_back
#define er erase
#define ub upper_bound
#define lb lower_bound
#define FOR(i,a,b) for (ll i = (a); i < (b); ++i)
#define F0R(i,a) FOR(i,0,a)
#define ROF(i,a,b) for (ll i = (b)-1; i >= (a); --i)
#define R0F(i,a) ROF(i,0,a)
#define trav(a,x) for (auto& a: x)

const int MOD = 1e9+7; // 998244353;
const int MX = 2e5+5;
const ll INF = 1e18;
const char nl = '\n';


void solve(){
    int t;
    cin >> t;
    int n, k;
    cin >> n >> k;
    bool flip = (k != abs(k));
    if(flip) k *= -1;
    vi v(n);
    F0R(i, n){
        cin >> v[i];
        if(flip)v[i] *= -1;
    }
    if(n % 2 != k % 2){
        cout << "NE\n";
        return;
    }
    sor(v);
    int x = k - 1;
    vi nap, poz;
    ROF(i, n - k, n){
        if(x > v[i]){
            cout << "NE\n";
            return;
        }
        x--;
        poz.pb(v[i]);
    }
    x = 0;
    int med1 = v[(n - k) / 2 - 1], med2 = v[(n - k) / 2];
    //cerr << med1 << " " << med2 << "\n";
    if(flip)vi v(10000000000);
    if(x <= med2){
        while(sz(poz) && x + 1 <= med2){
            x++;
            nap.pb(poz.back());
            poz.pop_back();
        }
        multiset<int> s;
        F0R(i, n - k)s.ins(v[i]);
        x = k;
        while(x < med1){
            auto it = s.ub(x);
            if(it == bg(s)){
                cout << x << "NE\n";
                return;
            }
            poz.pb(*bg(s));
            s.er(bg(s));
            nap.pb(*(--end(s)));
            s.er(--end(s));
            x++;
        }
        while(sz(s)){
            if(x == *bg(s)){
                nap.pb(*(--end(s)));
                nap.pb(*bg(s));
            }
            else{
                nap.pb(*bg(s));
                nap.pb(*(--end(s)));
            }
            s.er(bg(s));
            s.er(--end(s));
        }
        cout << "DA\n";
        if(t){
            trav(el, nap)cout << (flip ? -1 * el : el) << " ";
            //cout << nl;
            reverse(all(poz));
            trav(el, poz)cout << (flip ? -1 * el : el) << " ";
        }
    }
    else{
        multiset<int> s;
        F0R(i, n - k)s.ins(v[i]);
        while(x > med2){
            auto it = s.lb((flip ? x : x - 1));
            if(it == end(s)){
                cout << "NE\n";
                return;
            }
            poz.pb(*(--end(s)));
            nap.pb(*bg(s));
            s.er(bg(s));
            s.er(--end(s));
            x--;
        }
        while(sz(s)){
            nap.pb(*(--end(s)));
            nap.pb(*bg(s));
            s.er(bg(s));
            s.er(--end(s));
        }
        reverse(all(poz));
        cout << "DA\n";
        if(t){
            trav(el, nap)cout << (flip ? -1 * el : el) << " ";
            trav(el, poz)cout << (flip ? -1 * el : el) << " ";
        }
    }

}


/*
Nije isto kad flipujes...

*/

int main()
{
    ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    int t; t = 1;while(t--){
        solve();
    }
    return 0;
}