#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  int t;
  cin >> t;
  while (t--) {
    string s, p;
    cin >> s;
    int ctr = 0;
    bool poss = true;
    while (poss) {
      int n = s.length();
      p.clear();
      poss = false;
      for (int i = 0; i < n; i++) {
        if (i + 1 < n && ((s[i] == '0' && s[i + 1] == '1') ||
                          (s[i] == '1' && s[i + 1] == '0'))) {
          i++;
          poss = true;
          ctr++;
        } else
          p += s[i];
      }
      if (poss) {
        s = p;
      }
    }
    if (ctr % 2 == 0)
      cout << "NET\n";
    else
      cout << "DA\n";
  }
  return 0;
}
