#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    string s;
    cin >> s;
    int z = 0, o = 0;
    for (int i = 0; i < s.size(); i++) {
      if (s[i] == '0') z += 1;
      if (s[i] == '1') o += 1;
    }
    int mn = min(z, o);
    if (mn % 2 == 0)
      cout << "NET"
           << "\n";
    else
      cout << "DA"
           << "\n";
  }
  return 0;
}
