#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e5 + 5;
const long long mod = 1e9 + 7;
const long long inf = 0x3f3f3f3f;
const long double pi = acos(-1.0);
long long n, m, a, b, c, x, y, t;
string s;
void run() {
  cin >> s;
  a = b = 0;
  n = s.size();
  for (int i = 0; i < n; i++) {
    if (s[i] - '0')
      a++;
    else
      b++;
  }
  a = min(a, b);
  if (a % 2) {
    cout << "DA\n";
  } else
    cout << "NET\n";
}
int main() {
  std::ios::sync_with_stdio(false);
  cin >> t;
  while (t--) run();
  return 0;
}
