#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int i, j, k, t, ip;
  cin >> t;
  while (t--) {
    long long int n, p, a, b, c = 0, d, x, y, z, q, r, m;
    double d1, d2;
    string s, s2;
    vector<long long int> v;
    cin >> s;
    for (i = 0; i < (s.length() - 1) && s.length() != 0; i++) {
      s2 = "";
      s2.push_back(s[i]);
      s2.push_back(s[i + 1]);
      if (s2 == "01" || s2 == "10") {
        s.erase(i, 2);
        i = -1;
        c++;
      }
    }
    if (c % 2 == 0)
      cout << "NET\n";
    else
      cout << "DA\n";
  }
  return 0;
}
