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