#include <bits/stdc++.h>
using namespace std;
long long int po(long long int x, long long int y) {
  if (y == 0) return 1;
  return x * po(x, y - 1);
}
void killer() {
  string s;
  cin >> s;
  int c = 0;
  for (auto x : s) {
    if (x == '0') c++;
  }
  int n = s.length();
  int g = min(c, n - c);
  if (g & 1)
    cout << "DA" << endl;
  else
    cout << "NET" << endl;
  return;
}
int main() {
  long long int t = 1;
  cin >> t;
  while (t--) killer();
  return 0;
}
