#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
void avneetsng() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
int32_t main() {
  avneetsng();
  long long t;
  cin >> t;
  while (t--) {
    string s;
    cin >> s;
    long long n = s.size();
    long long n1 = 0, n0 = 0;
    for (auto i : s) {
      if (i == '0') {
        n0++;
      } else
        n1++;
    }
    long long k = min(n1, n0);
    if (k & 1)
      cout << "DA" << endl;
    else
      cout << "NET" << endl;
  }
  return 0;
}
