#include<iostream>
#include<vector>

using namespace std;

int main ()
{
	
	int t, n;
	cin >> t >> n;
	
	vector<int> a;
	vector<int> b;
	
	int ia, ib;
	int ta, tb;
	
	for (int i = 0; i < t; i++) {
		for (int j = 0; j < n; j++) {
			if (a[j] != 0) {
				ia= j;
				ta = a[j];
			}
			if (b[j] != 0) {
				ib= j;
				tb = b[j];
			}
		}
		if (ta != tb) {
			cout << "NE" << '\n';
		}
		else if ((ta == -tb) && ((ia - ib) % 2 == 1)) {
			cout << "DA" << '\n';
		}
		else if ((ta == tb) && ((ia - ib) % 2 == 0)){
			cout << "DA" << '\n';
		}
		else {
			cout << "NE" << '\n';
		}
	}
	
	return 0;
}