#include <bits/stdc++.h>
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long lcm(long long a, long long b) { return a * b / gcd(a, b); }
const long long N = 1e6 + 1;
using namespace std;
void solve() {
  string s;
  cin >> s;
  long long n = s.length();
  long long c1 = 0;
  long long c2 = 0;
  for (long long i = 0; i < n; i++) {
    if (s[i] == '0')
      c1++;
    else
      c2++;
  }
  long long d = min(c1, c2);
  if (d % 2 != 0)
    cout << "DA\n";
  else
    cout << "NET\n";
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(NULL);
  std::cout.tie(NULL);
  ;
  long long t;
  cin >> t;
  while (t--) solve();
  return 0;
}
