#include <bits/stdc++.h>
using namespace std;
void __print(long long x) { cerr << x; }
void __print(float x) { cerr << x; }
void __print(double x) { cerr << x; }
void __print(long double x) { cerr << x; }
void __print(char x) { cerr << '\'' << x << '\''; }
void __print(const char *x) { cerr << '\"' << x << '\"'; }
void __print(const string &x) { cerr << '\"' << x << '\"'; }
void __print(bool x) { cerr << (x ? "true" : "false"); }
template <typename T, typename V>
void __print(const pair<T, V> &x) {
  cerr << '{';
  __print(x.first);
  cerr << ',';
  __print(x.second);
  cerr << '}';
}
template <typename T>
void __print(const T &x) {
  long long f = 0;
  cerr << '{';
  for (auto &i : x) cerr << (f++ ? "," : ""), __print(i);
  cerr << "}";
}
void _print() { cerr << "]\n"; }
template <typename T, typename... V>
void _print(T t, V... v) {
  __print(t);
  if (sizeof...(v)) cerr << ", ";
  _print(v...);
}
vector<long long> primes;
const long long NN = 1e6 + 1;
long long prime[NN];
void seive() {
  long long i;
  for (i = 1; i < NN; i++) prime[i] = i;
  prime[0] = prime[1] = 0;
  for (i = 2; i < NN; i++) {
    if (prime[i] == i) {
      for (long long j = 2 * i; j < NN; j += i)
        if (prime[j] == j) prime[j] = i;
    }
  }
  for (i = 2; i < NN; i++)
    if (prime[i] == i) primes.push_back(i);
}
long long I_fpow(long long x, long long y, long long p = (long long)(1e9 + 7)) {
  long long res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
long long toint(const string &s) {
  stringstream ss;
  ss << s;
  long long x;
  ss >> x;
  return x;
}
string add2strings(string s1, string s2) {
  if (s1.length() > s2.length()) swap(s1, s2);
  long long n = s1.length();
  long long m = s2.length();
  long long carry = 0;
  reverse(s1.begin(), s1.end());
  reverse(s2.begin(), s2.end());
  string ans = "";
  for (long long i = 0; i < n; i++) {
    long long sum = (char)(s1[i] - '0') + (char)(s2[i] - '0') + carry;
    ans += (char)(sum % 10 + '0');
    carry = 0;
  }
  for (long long i = n; i < m; i++) {
    long long sum = (char)(s2[i] - '0') + carry;
    ans += (char)(sum % 10 + '0');
    carry = 0;
  }
  if (carry) ans += (char)(carry + '0');
  reverse(ans.begin(), ans.end());
  return ans;
}
signed main() {
  ios_base ::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t;
  cin >> t;
  while (t--) {
    string s;
    cin >> s;
    long long n = s.size();
    long long cnt = 0, cnt1 = 0;
    for (long long i = 0; i < n; i++)
      cnt += (s[i] == '0'), cnt1 += (s[i] == '1');
    long long c = min(cnt, cnt1);
    cout << (c % 2 ? "DA\n" : "NET\n");
  }
  return 0;
}
