#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t;
  cin >> t;
  for (long long int j1 = 1; j1 <= t; j1++) {
    long long int n = 0, m, b, c, a, d, e, f, x, y, z, i, j, k, t, l;
    string p;
    cin >> p;
    x = p.size();
    for (i = 0; i < x; i++) {
      if (p[i] == '0') {
        n++;
      }
    }
    c = min(n, x - n);
    if ((c) % 2 != 0) {
      cout << "DA";
    } else {
      cout << "NET";
    }
    cout << endl;
  }
  return 0;
}
