#include <bits/stdc++.h>
using namespace std;
void solve() {
  string second;
  cin >> second;
  long long k0 = 0, k1 = 0;
  long long n = second.size();
  for (long long i = 0; i < n; i++) {
    if (second[i] == '0')
      k0++;
    else
      k1++;
  }
  if (((n - abs(k0 - k1)) / 2) % 2 == 0)
    cout << "NET" << endl;
  else
    cout << "DA" << endl;
}
signed main() {
  long long n;
  cin >> n;
  for (long long i = 0; i < n; i++) {
    solve();
  }
}
