#include <bits/stdc++.h>
using namespace std;
const int N = 3;
vector<vector<int> > g(N);
unsigned visited[N];
void ipgraph(int edges);
void dfs(int x);
void solve() {
  string s;
  cin >> s;
  int cz = 0, co = 0;
  int n = (int)s.length();
  for (int i = 0; i < n; ++i) {
    if (s[i] - '0')
      co++;
    else
      cz++;
  }
  int mini = min(co, cz);
  if (mini & 1)
    cout << "DA\n";
  else
    cout << "NET\n";
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
void ipgraph(int edges) {
  while (edges--) {
    int u, v;
    cin >> u >> v;
    --u;
    --v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
}
void dfs(int x) {
  visited[x] = 1;
  for (int& y : g[x]) {
    if (!visited[y]) {
      dfs(y);
    }
  }
}
