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