#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t;
  cin >> t;
  while (t--) {
    string s;
    cin >> s;
    long long z = 0, o = 0, ans = 0;
    for (long long i = 0; i < s.size(); i++) {
      if (s[i] == '0')
        z++;
      else
        o++;
    }
    ans = min(z, o);
    if (ans % 2)
      cout << "DA" << endl;
    else
      cout << "NET" << endl;
  }
}
