#include <bits/stdc++.h>
using namespace std;
long long power(long long a, long long b);
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long t = 1, i;
  cin >> t;
  while (t--) {
    string s;
    cin >> s;
    long long one = 0, zero = 0;
    for (long long i = 0; i < s.size(); i++) {
      if (s[i] == '1')
        one++;
      else
        zero++;
    }
    long long val = min(one, zero);
    if (val % 2 == 0)
      cout << "NET"
           << "\n";
    else
      cout << "DA"
           << "\n";
  }
  return 0;
}
long long power(long long a, long long b) {
  long long res = 1;
  while (b) {
    if (b % 2)
      b--, res = res * a;
    else
      b = b / 2, a *= a;
  }
  return res;
}
