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