#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  int n;
  cin >> n;
  while (n--) {
    int zero = 0, one = 0, ans = 0;
    cin >> s;
    for (int i = 0; i < s.size(); i++) {
      if (s[i] == '0') {
        zero++;
      } else {
        one++;
      }
    }
    if (zero > 0 || one > 0) {
      ans = min(zero, one);
    }
    if (ans % 2 != 0) {
      cout << "DA" << endl;
    } else {
      cout << "NET" << endl;
    }
  }
}
