#include <iostream>
#include <unordered_set>
#include <vector>
#include <set>
#include <algorithm>

using namespace std;

int main()
{
    int t = 0;
    cin>>t;
    int n, k = 0;
    cin>>n>>k;
    multiset<int> values;
    int current=0;
    vector<int> answers;
    for(int i = 0; i < n; i++)
    {
        int input = 0;
        cin>>input;
        if(input>= current) current++;
        else current--;
        answers.push_back(input);
        values.insert(input);
    }
    if(current == k)
    {
        cout<<"DA"<<endl;
        if(t==1 && current == k) for(int x : answers) cout<<x<<" ";
    }
    else
    {
        answers.clear();
        if((n-k)%2==0)
        {
            current = 0;
            int prev = -1;
            double up = 0;
            double down = (n-k)/2;
            bool done = false;
            if(k<0)
            {
                prev = 1;
                down = (n+k)/2;
            }
            while(up<down && !done)
            {
                if(prev < current)
                {
                    auto it = find_if(values.begin(), values.end(), [current](auto element)->bool{return element<current;});
                    if(it != values.end())
                    {
                        prev = current--;
                        answers.push_back(*it);
                        values.erase(it);
                    }
                    else {cout<<"NE"; done = true;}
                }
                else
                {
                    auto it = find_if(values.begin(), values.end(), [current](auto element){return element>=current;});
                    if(it != values.end())
                    {
                        prev = current++;
                        answers.push_back(*it);
                        values.erase(it);
                    }
                    else {cout<<"NE"; done = true;}
                }
                up+=0.5;
                //cout<<current<<" ";
            }
            while(!values.empty() && current!=k && !done)
            {
                if(k>=0)
                {
                    auto it = find_if(values.begin(), values.end(), [current](auto element){return element>=current;});
                    if(it != values.end())
                    {
                        current++;
                        answers.push_back(*it);
                        values.erase(it);
                        //cout<<current<<" ";
                    }
                    else if (it == values.end() && current != k) {cout<<"NE"; done = true;}
                }
                else
                {
                    auto it = find_if(values.begin(), values.end(), [current](auto element){return element<current;});
                    if(it != values.end())
                    {
                        current--;
                        answers.push_back(*it);
                        values.erase(it);
                        //cout<<current<<" ";
                    }
                    else if (it == values.end() && current != k) {cout<<"NE"; done = true;}
                }
            }
            if(values.empty() && current == k) cout<<"DA"<<endl;
            if(t==1 && current == k && values.empty()) for(int x : answers) cout<<x<<" ";
        }
        else cout<<"NE";
    }
}




/*1
10 -4
12 -3 -4 -5 23 9 8 1 -1 -2*/