#include <bits/stdc++.h>
using namespace std;
bool isprime(long long int n) {
  for (long long int i = 2; i * i <= n; i++)
    if (n % i == 0) return 0;
  return 1;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int t = 1;
  cin >> t;
  while (t--) {
    string s;
    cin >> s;
    long long int i, c0 = 0, c1 = 0;
    long long int len = s.length();
    for (i = 0; i < len; i++) {
      if (s[i] == '0')
        c0++;
      else
        c1++;
    }
    c0 = min(c0, c1);
    if (c0 % 2 == 0)
      cout << "NET\n";
    else
      cout << "DA\n";
  }
  return 0;
}
