#include <bits/stdc++.h>
using namespace std;
const int N = 1e3 + 10;
int a[N];
string s;
int n;
int q;
int main() {
  cin >> q;
  while (q--) {
    cin >> s;
    int num0 = 0, num1 = 0;
    for (int i = 0; i < s.size(); i++) {
      if (s[i] == '0') {
        num0++;
      } else {
        num1++;
      }
    }
    if (min(num0, num1) % 2) {
      cout << "DA" << endl;
    } else {
      cout << "NET" << endl;
    }
  }
  return 0;
}
