#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  for (int i = 1; i <= t; ++i) {
    string s;
    cin >> s;
    int c1 = 0, c0 = 0;
    for (int i = 0; i < s.size(); ++i) {
      if (s[i] == '1')
        c1++;
      else
        c0++;
    }
    cout << (min(c0, c1) & 1 ? "DA" : "NET") << endl;
  }
}
