#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t;
  cin >> t;
  while (t--) {
    string s;
    cin >> s;
    long long int len = s.length();
    long long int ct0 = 0, ct1 = 0;
    for (long long int i = 0; i < len; i++) {
      if (s[i] == '0')
        ct0++;
      else
        ct1++;
    }
    long long int m = min(ct0, ct1);
    if (m % 2 == 1)
      cout << "DA\n";
    else
      cout << "NET\n";
  }
  return 0;
}
