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