#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    string s;
    cin >> s;
    int cnt = 0, cnt1 = 0, cnt0 = 0;
    for (int i = 0; i < s.length(); i++) {
      if (s[i] == '1')
        cnt1++;
      else
        cnt0++;
    }
    cnt = min(cnt1, cnt0);
    if (cnt % 2 == 1)
      cout << "DA\n";
    else
      cout << "NET\n";
  }
  return 0;
}
