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