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