#include <bits/stdc++.h>
using namespace std;
long long a, b, c, d;
string n;
int main() {
  cin >> a;
  while (a--) {
    b = c = 0;
    cin >> n;
    for (int s = 0; s < n.size(); s++) {
      if (n[s] == '0')
        b++;
      else
        c++;
    }
    if (min(b, c) % 2 == 1)
      cout << "DA" << endl;
    else
      cout << "NET" << endl;
  }
}
