#include <bits/stdc++.h>
using namespace std;
inline int read() {
  char c = getchar();
  int x = 0, f = 1;
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = x * 10 + c - '0';
    c = getchar();
  }
  return x * f;
}
const int MOD = 1e9 + 7;
const double eps = 1e-5;
const int INF = 0x3f3f3f3f;
const long long INFLL = 0x7f7f7f7f;
int gcd(int a, int b) { return (a % b == 0) ? b : gcd(b, a % b); }
long long lowbit(long long x) { return x & -x; }
const int N1 = 1005;
const int N = 2e5 + 5;
int main() {
  std::ios::sync_with_stdio(false);
  int t;
  cin >> t;
  int ans1, ans2;
  while (t--) {
    string s;
    cin >> s;
    int cnt = 0;
    int wz = 0;
    int num0 = 0, num1 = 0;
    while (s[wz]) {
      if (s[wz] == '0')
        num0++;
      else
        num1++;
      if (num0 && num1) {
        cnt++;
        num0--;
        num1--;
      }
      wz++;
    }
    if (cnt % 2)
      cout << "DA\n";
    else
      cout << "NET\n";
  }
  return 0;
}
