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