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