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