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