#include <bits/stdc++.h>
using namespace std;
long long int dx[] = {1, -1, 1, -1}, dy[] = {-1, 1, -1, 1};
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int t;
  cin >> t;
  while (t--) {
    string s;
    cin >> s;
    long long int e = 0, o = 0;
    for (long long int i = 0; i < s.size(); i++) {
      if (s[i] == '0')
        e++;
      else
        o++;
    }
    if (min(e, o) % 2)
      cout << "DA";
    else
      cout << "NET";
    cout << "\n";
  }
  return 0;
}
