#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int tt;
  cin >> tt;
  while (tt--) {
    string s;
    cin >> s;
    string g;
    long long int n = s.size();
    long long int i = 0;
    long long int s1 = 0, s0 = 0;
    while (i != n) {
      if (s[i] == '1')
        s1++;
      else
        s0++;
      i++;
    }
    long long int c = min(s1, s0);
    if (c % 2)
      cout << "DA" << endl;
    else
      cout << "NET" << endl;
  }
}
