#include <bits/stdc++.h>
using namespace std;
const double PI = 3.141592653589793238460;
void solve() {
  string s;
  cin >> s;
  int n = s.size(), count = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '1') count++;
  }
  int mini = min(count, n - count);
  if (mini & 1)
    cout << "DA";
  else {
    cout << "NET";
  }
  cout << '\n';
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int t;
  t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
