#include <bits/stdc++.h>
using namespace std;
void solve();
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int T;
  cin >> T;
  while (T--) {
    solve();
  }
}
void solve() {
  string s;
  cin >> s;
  int i, f1 = 0, f2 = 0;
  string w = s;
  for (i = 0; i < s.length() - 1; i++) {
    if (s[i] == '0' && s[i + 1] == '1') {
      s.erase(s.begin() + (i + 1));
      s.erase(s.begin() + i);
      f1++;
      if (s.empty()) break;
      if (i != 0)
        i -= 2;
      else
        i = -1;
    }
    if (s[i] == '1' && s[i + 1] == '0') {
      s.erase(s.begin() + (i + 1));
      s.erase(s.begin() + i);
      f1++;
      if (s.empty()) break;
      if (i != 0)
        i -= 2;
      else
        i = -1;
    }
  }
  int pos;
  for (i = w.length() - 1; i > 0; i--) {
    if (s[i] == '0' && s[i - 1] == '1') {
      s.erase(s.begin() + (i));
      s.erase(s.begin() + (i - 1));
      f2++;
      if (s.empty()) break;
      if (i != w.length() - 1)
        i += 2;
      else
        i += 1;
    }
    if (s[i] == '1' && s[i + 1] == '0') {
      s.erase(s.begin() + (i + 1));
      s.erase(s.begin() + i);
      f2++;
      if (s.empty()) break;
      if (i != w.length() - 1)
        i += 2;
      else
        i += 1;
    }
  }
  if (f1 % 2 || f2 % 2) {
    cout << "DA" << '\n';
  } else
    cout << "NET" << '\n';
}
