#include <bits/stdc++.h>
using namespace std;
int t;
string s;
int main() {
  cin >> t;
  while (t--) {
    cin >> s;
    int zeroes = 0, ones = 0;
    for (char c : s) {
      if (c == '0') {
        zeroes++;
      } else if (c == '1') {
        ones++;
      }
    }
    cout << (min(zeroes, ones) % 2 > 0 ? "DA" : "NET") << endl;
  }
  return 0;
}
