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