#include <bits/stdc++.h>
using namespace std;
const long long mxN = 5e10;
const int maxN = 5e3;
int main() {
  int t;
  cin >> t;
  while (t--) {
    string s;
    cin >> s;
    int count0 = 0, count1 = 0;
    for (char c : s) {
      if (c == '0')
        count0++;
      else {
        count1++;
      }
    }
    if (min(count0, count1) % 2 == 0)
      cout << "NET\n";
    else {
      cout << "DA\n";
    }
  }
}
