#include <bits/stdc++.h>
int main() {
  int n;
  std::cin >> n;
  for (int i = 0; i < n; ++i) {
    std::string str;
    std::cin >> str;
    int zero = 0;
    int one = 0;
    for (auto &j : str) {
      if (j == '0') {
        zero += 1;
      } else {
        one += 1;
      }
    }
    int min = std::min(zero, one);
    if (min % 2 == 0) {
      std::cout << "NET" << '\n';
    } else {
      std::cout << "DA" << '\n';
    }
  }
  return 0;
}
