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