#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 07;
const long long mxn = 1e6 + 10;
int main(int argc, char const *argv[]) {
  long long i, j, a, b, c, d, n, m, t, h, u, v, x, y, z;
  cin >> n;
  for (i = 1; i <= n; i++) {
    string s;
    cin >> s;
    m = (long long)s.size();
    long long one = 0, zero = 0;
    for (auto ch : s) {
      if (ch == '0') {
        zero++;
      } else {
        one++;
      }
    }
    long long mn = min(zero, one);
    if (mn & 1) {
      cout << "DA"
           << "\n";
    } else {
      cout << "NET"
           << "\n";
    }
  }
  return 0;
}
