#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;
    for(int i = 0; i < n; i++)
    {
        int input = 0;
        cin>>input;
        values.insert(input);
    }
    vector<int> answers;
    if((n-k)%2==0)
    {
        int 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)
        {
            auto it = find_if(values.begin(), values.end(), [current](auto element){return element>=current;});
            if(it != values.end())
            {
                if(k>=0) current++;
                else current--;
                answers.push_back(*it);
                values.erase(it);
                //cout<<current<<" ";
            }
            else if (it == values.end() && current != k) {cout<<"NE"; done = true;}
            else {cout<<"DA";}
        }
        if(values.empty() && current == k) cout<<"DA"<<endl;
        if(t==1 && current == k && values.empty()) for(int x : answers) cout<<x<<" ";
    }
    else cout<<"NE";
}