#include <bits/stdc++.h>
using namespace std;
void solve(std::istream &in, std::ostream &out);
int main() {
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(nullptr);
  std::cout.tie(nullptr);
  solve(std::cin, std::cout);
  return 0;
}
char str[105];
void solve_test(std::istream &in, std::ostream &out) {
  in >> str;
  int n = strlen(str);
  int cnt = 0;
  int c1 = 0, c2 = 0;
  for (int i = 0; i < n; ++i) {
    c1 += str[i] == '0';
    c2 += str[i] == '1';
    if (str[i] == '1') {
      if (c1 != 0) {
        ++cnt;
        --c1;
        --c2;
      }
    } else {
      if (c2 != 0) {
        ++cnt;
        --c1;
        --c2;
      }
    }
  }
  out << ((cnt % 2 == 1) ? "DA" : "NET") << '\n';
}
void solve(std::istream &in, std::ostream &out) {
  int tests;
  in >> tests;
  while (tests--) {
    solve_test(in, out);
  }
}
