#include <bits/stdc++.h>
using namespace std;
int main() {
  unsigned t;
  cin >> t;
  while (t--) {
    string s;
    cin >> s;
    unsigned z = count(s.begin(), s.end(), '0');
    unsigned o = count(s.begin(), s.end(), '1');
    unsigned moves = min(z, o);
    cout << (moves % 2 == 1 ? "DA\n" : "NET\n");
  }
}
