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