#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const int N = 200003;
void solve() {
  string s;
  cin >> s;
  int o = 0, z = 0;
  for (auto i : s) {
    if (i == '1')
      o++;
    else
      z++;
  }
  int c = min(o, z);
  if (c & 1)
    cout << "DA\n";
  else
    cout << "NET\n";
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int t;
  cin >> t;
  while (t--) solve();
  return 0;
}
