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