#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
void solve() {
  string s;
  cin >> s;
  int ones = 0, zeros = 0;
  for (int i = 0; i < s.length(); i++) {
    if (s[i] == '1') {
      ones++;
    }
    if (s[i] == '0') {
      zeros++;
    }
  }
  int c = min(ones, zeros);
  if (c % 2 == 0) {
    cout << "NET"
         << "\n";
  } else {
    cout << "DA"
         << "\n";
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
