#include <bits/stdc++.h>
using namespace std;

int t, n, k;
int a[200010];
vector<int> res;

bool r(int curr, int minus, int plus) {
	if(minus < 0 || plus < 0)
		return false;
	if(minus == 0 && plus == 0) {
		if(curr == k)
			return true;
		else
			return false;
	}
	bool ans;
	if(curr >= 2) {
		res.push_back(-1);
		ans = r(curr-1, minus-1, plus);
		if(ans)
			return true;	
		res.pop_back();
		res.push_back(1);
		ans = r(curr-1, minus, plus-1);
		if(ans)
			return true;
		res.pop_back();
	}
	else if(curr <= -1) {
		res.push_back(-1);
		ans = r(curr+1, minus-1, plus);
		if(ans)
			return true;
		res.pop_back();
		res.push_back(1);
		ans = r(curr+1, minus, plus-1);
		if(ans)
			return true;
		res.pop_back();
	}
	else {
		res.push_back(1);
		ans = r(curr+1, minus, plus-1);
		if(ans)
			return true;
		res.pop_back();
		res.push_back(-1);
		ans = r(curr-1, minus-1, plus);
		if(ans)
			return true;
		res.pop_back();
	}
	return false;
}

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);

	cin >> t;
	cin >> n >> k;
	bool case1 = true;
	for(int i = 0; i < n; i++) {
		cin >> a[i];
		if(i > 0 && a[i] != a[i-1])
			case1 = false;
	}
	if(case1) {
		int curr;
		if(a[0] > n) {
			curr = n;
		}
		else {
			curr = a[0] + (n - a[0]) % 2;
		}
		if(curr == k) {
			cout << "DA\n";
			if(t) {
				for(int i = 0; i < n; i++) {
					cout << a[0] << ' ';
				}
				cout << '\n';
			}
		}
		else {
			cout << "NE\n";
		}
	}
	else if(n <= 8) {
		while(next_permutation(a, a+n)) {
			int curr = 0;
			for(int i = 0; i < n; i++) {
				if(a[i] >= curr)
					curr++;
				else
					curr--;
			}
			if(curr == k) {
				cout << "DA\n";
				if(t) {
					for(int i = 0; i < n; i++) {
						cout << a[i] << ' ';
					}
					cout << '\n';
				}
				return 0;
			}
		}
		cout << "NE\n";
	}
	else if(n <= 500) {
		// a[i] {-1, 1}
		int minus = 0, plus = 0;
		for(int i = 0; i < n; i++) {
			if(a[i] == -1)
				minus++;
			else
				plus++;
		}
		bool ans = r(0, minus, plus);
		if(!ans) {
			cout << "NE\n";
			return 0;
		}
		cout << "DA\n";
		if(t) {
			for(auto i : res) {
				cout << i << ' ';
			}
			cout << '\n';
		}
	}

	return 0;
}