#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t;
  cin >> t;
  while (t--) {
    long long n, e = 0, o = 0;
    long long i, j;
    long long ans = 0;
    string str;
    cin >> str;
    for (i = 0; i < str.size(); i++) {
      if (str[i] == '0')
        e++;
      else
        o++;
    }
    ans = min(o, e);
    if (ans % 2 == 1)
      cout << "DA" << endl;
    else
      cout << "NET" << endl;
  }
  return 0;
}
