#include <bits/stdc++.h>
long long MAX = LLONG_MAX;
long long MIN = LLONG_MIN;
using namespace std;
bool sortcol(const vector<long long>& v1, const vector<long long>& v2) {
  return (v1[0] < v2[0]);
}
long long gcd(long long a, long long b) {
  if (a == 0) return b;
  if (b == 0) return a;
  if (a == b) return a;
  if (a > b) return gcd(a - b, b);
  return gcd(a, b - a);
}
long long lcm(long long a, long long b) { return ((a * b) / gcd(a, b)); }
long long powfun(long long a, long long b) {
  long long res = 1;
  for (long long i = 1; i <= b; i++) {
    res = res * a;
  }
  return res;
}
int main() {
  string alice = "DA";
  string bob = "NET";
  long long t;
  cin >> t;
  while (t--) {
    string s;
    cin >> s;
    long long n = s.size();
    if (n == 1) {
      cout << bob;
      continue;
    }
    long long zeros = 0;
    long long ones = 0;
    for (long long i = 0; i < n; i++) {
      if (s[i] == '0')
        zeros++;
      else
        ones++;
    }
    if (ones == 0 || zeros == 0) {
      cout << bob << "\n";
      continue;
    }
    long long pos = 1;
    while (1) {
      if (pos == 1) {
        if (s.size() == 0) {
          cout << bob << "\n";
          break;
        }
        if (s.size() == 1) {
          cout << bob << "\n";
          break;
        }
        long long check2 = -1;
        for (long long i = 1; i < s.size(); i++) {
          if (s[i] == '0') {
            if (s[i - 1] == '1') {
              check2 = 1;
              s.erase(s.begin() + i);
              s.erase(s.begin() + i - 1);
              pos = 2;
              break;
            }
          } else if (s[i] == '1') {
            if (s[i - 1] == '0') {
              check2 = 1;
              s.erase(s.begin() + i);
              s.erase(s.begin() + i - 1);
              pos = 2;
              break;
            }
          }
        }
        if (check2 == -1) {
          cout << bob << "\n";
          break;
        }
      }
      if (pos == 2) {
        if (s.size() == 0) {
          cout << alice << "\n";
          break;
        }
        if (s.size() == 1) {
          cout << alice << "\n";
          break;
        }
        long long check = -1;
        for (long long i = 1; i < s.size(); i++) {
          if (s[i] == '0') {
            if (s[i - 1] == '1') {
              check = 1;
              s.erase(s.begin() + i);
              s.erase(s.begin() + i - 1);
              pos = 1;
              break;
            }
          } else if (s[i] == '1') {
            if (s[i - 1] == '0') {
              check = 1;
              s.erase(s.begin() + i);
              s.erase(s.begin() + i - 1);
              pos = 1;
              break;
            }
          }
        }
        if (check == -1) {
          cout << alice << "\n";
          break;
        }
      }
    }
  }
  return 0;
}
