#include <bits/stdc++.h>
using namespace std;
int main() {
  int num;
  cin >> num;
  while (num--) {
    string s;
    cin >> s;
    int sum1 = 0, sum2 = 0;
    for (int i = 0; i < s.size(); i++) {
      if (s[i] == '0')
        sum1++;
      else
        sum2++;
    }
    int ans = min(sum1, sum2);
    if (ans % 2 == 0)
      cout << "NET" << endl;
    else
      cout << "DA" << endl;
  }
  return 0;
}
