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