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